Skip to content

Building ThinStation for booting off SSD (Goal: Terminal Server Thin Clients)

aknisly edited this page Aug 5, 2021 · 5 revisions

These are my notes of the process, sans the dead-ends that I went down before figuring out my mistakes.

Environment:

  • Small school with ~ 35 aging computers, about 10 of those are for staff.
  • Currently trying to keep up with updates and normal hiccups on a Windows environment.
  • Server: Dell r710, 64G RAM, RAID, XCP-NG host; managed over Xen Orchestra

Target:

  • A VM running Linux Mint Cinnamon 20.4 and ThinLinc Terminal Server. Notes about the server here.
  • Clients (aforementioned aging computers) booting ThinStation from a small SSD, with all ThinLinc Client options baked in, leaving no options except choosing another boot device at BIOS.

Steps:

  • Cloned thinstation.git per 'Getting Started.' onto my ThinkPad W53H0 (16G RAM, Core i7, OS and home on an SSD, put the Thinstation build environment on an HDD...it was a little slow. My OS is Linux Mint 19.2) [Note: as of v6.2 this takes 11.7 GB of space.]

git clone --depth 1 git://github.com/Thinstation/thinstation.git

cd thinstation

sudo ./setup-chroot

(NOTE: if you reboot or otherwise leave the build environment, you will need to run the setup again.) Went with the default config for the first round:

cd /build

./build --savedir --allmodules [added --allmodules since this will be used on real hardware, not VM's

Per the 'Deployment Page',

fdisk -l |grep -e "Disk /" (my USB thumb drive is on /dev/sdc)

mkmbrdrv -o /build/boot-images/syslinux -p d:0:boot /dev/sdc

I tried this on a ThinkPad W500, and...success! Next step: try trimming out unnecessary packages, and adding the NoMachine NX client.

If you like Nano for text editing, do this in the chroot building environment; I like Neovim, so I did this from another terminal window:

cd <path-to-environment>

sudo nvim build.conf [sudo isn't needed in the chroot environment]

Removed (commented out):

  • VMWare, Virtualbox-4.1, and qemu lines (Machine module list)
  • module CIFS
  • all language packages except English-US
  • package freerdp
  • package chrome
  • package cups

Added (uncommented):

  • package networkmanager (for wifi)
  • package thinlinc
  • package custom-idle

Ran the build again:

./build --savedir --allmodules

ThinLinc package won't install

The version of the client had changed, so I got an error in the build process. As was noted here, the file name comes from /build/build.urls, so I updated the param thinlincurl to match the link of the client download (tar.gz package), and all worked as it should.

Fine-Tuning the Configuration

Now for the details. I want users to get to their desktop sessions with as few clicks as possible, setting as few options as possible. So I want to pass on these parameters:

  • Wifi SSID and key; some of the clients will use wifi Per ThinLinc Documentation, I added these first to the thinstation.conf.network, only to discover that these are only valid for boot time configuration. So I added them to the bottom of thinstation.conf.buildtime:

SESSION_0_TYPE=thinlinc SESSION_0_THINLINC_SERVER=pc.pilgrimcs.org SESSION_0_THINLINC_CONFIG_NFS_SERVER_ENABLED=0 SESSION_0_THINLINC_CONFIG_NFS_EXPORTS=/mnt/usbdevice,rw,/mnt/cdrom,ro SESSION_0_THINLINC_CONFIG_NFS_SERVER_ENABLED=1 SESSION_0_THINLINC_CONFIG_SOUND_ENABLED=1 SESSION_0_THINLINC_CONFIG_NFS_ROOT_WARNING=0

and commented out

  • ThinLinc client launches on startup, no option to close it, no access to desktop environment (possibly this?)
  • Server IP; there will only be one target server
  • Update TS on client boot OR (HDUPDATE (not sure which is preferable?); we may migrate to actual thin client hardware (maybe [Chromeboxes](link to chromebox hack script)?) depending on the difference in power consumption over time, but for now, I plan to acquire small (16G or less) SSD's. For our accounting class (which uses QuickBooks), I may need to leave some clients dual-booting into Windows, so I'll set a short BIOS time-out to let users choose the Windows drive if they need a desktop version of QB. NOTE: this will also make it trivial to hand out multiple TS images (e.g, one for staff and one for students), if that becomes helpful.
  • Custom-idle; we have trouble getting our student computers turned off at the end of the day. However, I don't want to turn teachers' computers off automatically, unless at a certain time of the day (night), because they may be away from their machines for longer than the time-out I want to set for the student computers.

The documentation is detailed, but it took a bit to wrap my brain around the configuration file structure.

I believe I want to edit the thinstation.conf.buildtime, so I saved a copy as .orig, and will edit this one.

Local-Install

(From here

Back in build.conf, I added (uncommented):

  • package local-install
  • package netfiles

I set these parameters to match our situation: param basepath prod param baseurl http://192.168.10.38 param basename thinstation

I tested the server (which is an NGINX server that I was able to get files onto via rsync, and off of via wget), but ran into issues. I'm holding off on this until I know for sure it isn't a LAN settings issue.

xdesktop-kiosk

Back in build.conf, I added

  • package xdesktop-kiosk

I couldn't find much help on configuration options, but from this page, I tried remove from build.conf:

  • #package xfwm4 #package xfwm4-extra #package xfce4-power-manager #package terminal # Terminal emulator for xfwm4 -- Pulls in xfwm4 #package thunar # File Manager for xfwm4 -- Pulls in xfwm4

Add: package openbox # A spartin clean/fast window manager.
package xdesktop-kiosk # A locked down desktop kiosk using the openbox wm (See packages/xdesktop-kiosk/build/conf for # more help.

removing (commenting) these lines from thinstation.conf.buildtime:

  • #SESSION_0_TYPE=xfwm4
  • #SESSION_0_AUTOSTART=on

...and adding these lines to thinstation.conf.buildtime (make sure to uncomment the relevant lines):

Setup for a "desktop kiosk" e.g. a desktop without any system menus

SESSION_0 and SESSION_1 is MANDATORY. More sessions may be added.

#ICONMODE=MANUAL
MENU_SHOWABOUT=true # Have an about box or not

SESSION_0_TITLE="openbox"
SESSION_0_TYPE=openbox
SESSION_0_AUTOSTART=On

SESSION_1_TITLE="Exit"
SESSION_1_TYPE=poff
SESSION_1_AUTOSTART=Off
SESSION_1_ICON=On

Add any additional package you may want, but keep AUTOSTART=Off and

ICON=On for each session

#SESSION_2_TITLE="NX"
#SESSION_2_TYPE=nx
#SESSION_2_NX_GENERAL_SERVER_HOST=192.168.10.10
#SESSION_2_AUTOSTART=Off
#SESSION_2_ICON=On

End of desktop kiosk setup

the options set here are those that go in the .nxs file

I may be starting to figure this out: I found the nxclient.cfg in the build environment right where it should have been. I'm assuming that this is like other /etc files in that it provides a template if none exists. So probably there should be a place to create a customized version of this, but I don't know where it goes.

In recent NoMachine Enterprise Client installs, this corresponds with player.cfg. There are decent explanations in this doc.

Also in this doc are instructions about the connection file, which is a config file saved for every connection you set up in the client. In Linux, these are stored at /Documents/NoMachine/. Again, this is easy to find, if you know where to look. Probably the best way to get the right options set here is to run the client from your desktop, set up a session like you want it (In my case, the connection is called "PCS Terminal Server."), then open the connection file (/Documents/NoMachine/PCS Terminal Server.nxs), and adapt the configuration (or at least the relevant lines/sections) to 50nx in the build environment. This isn't a straightforward copy/paste, because the format in 50nx is different, but the instructions are clear. For example, in my connection file (PCS Terminal Server.nxs), I have this line in the section:

The format in 50nx looks like this:

SESSION_#_NX_GENERAL_SERVER_HOST="192.168.10.10"

Questions: what is the

Attempts at Leaning the Build

From build.conf

  • package gnome-control-center
  • package volumeicon
  • package xorg7-vmware
Clone this wiki locally