Skip to content

Latest commit

 

History

History
109 lines (69 loc) · 4.5 KB

BUILD.md

File metadata and controls

109 lines (69 loc) · 4.5 KB

You need git, Virtualbox and Vagrant. You can use this software on any system: Windows, Linux or MacOS X.

Prepare the workplace

Clone this repository:

git clone https://github.com/selivan/thinclient.git
cd thinclient

Create machine that will be used as template for our image. If you want to create minimal working image, set install_gui_and_rdp_client:no in vars.yml. If you are going to build an image for 32-bit hardware, set config.vm.box to "ubuntu/xenial32" in Vagrantfile.

vagrant up template

Create machine that will work as PXE server for testing. Also it is used to provision configuration to template machine with Ansible.
vagrant up server

Reload template to boot with new kernel.
vagrant reload template

Customize thin client image

Log into template machine.
vagrant ssh template

Here you can customize your thin client image: install packages, configs, ...

Do not:

  • Remove package virtualbox-guest-utils
  • Remove openssh-server
  • Change type and settings of first network interface

If you do one of this actions, then you should do further work inside template virtual machine manually, without vagrant.

After all work is done, build images inside template machine:

vagrant ssh template
cd /vagrant
./build.sh all

You will get this artifacts in /vagrant/build directory:

  • vmlinuz - linux kernel
  • initrd.img - initial ram disk
  • rootfs.squashfs - root FS image
  • home.tar.gz - compressed home directory for user ubuntu
  • pxelinux.0, ldlinux.c32 - pxelinux network bootloader files
  • pxelinux.cfg/default - configuration for pxelinux. Boot parameters are set here.

Notice: ssh keys for ubuntu user, generated by Vagrant, are not included in home directory for security reasons.

Test result

Create machine to test created images. It is configured to boot from server machine over network. vagrant up test

Command will end up with error, it's OK: first interface is used for network boot, vagrant can not connect to it. After creating the test machine don't use vagrant up to launch it second time: Vagrant messes up custom configuration of first interface. Just run test machine from Virtualbox interface.

Remove storage SCSI controller from test machine in Virtualbox. With my versions of linux kernel and virtualbox it sometimes makes kernel crash. Some rare bug, may not affect you.

Server machine is cofigured as DHCP and TFTP server(dnsmasq), and HTTP server(nginx). HTTP is used to transfer huge rootfs image and home directory archive. In test environment you can transfer huge files with TFTP. But in real networks it is not very suitable for this task.

Start test machine. If everything is OK, it should boot with your image over network from server machine.

Shortcuts for connection to RDP servers are created from parameter rdpservers in pxelinux.cfg. It takes form
<server name 1>:<address>:<port>:<xfreerdp params>;<server name 2>:<address>:<port>:<xfreerdp params> xfreerdp parameters should be divided by % instead of spaces. Example:

rdpservers=dc1:dc1.example.net:3389;dc2:dc2.example.net:3390:/sec:rdp%/bpp:24

This will generate this two desktop shotucuts:

  • dc1: xfreerdp /workarea /f /v dc1.example.net:3389
  • dc2: xfreerdp /workarea /f /v /sec:rdp /bpp:24 dc2.example.net:3390

Check freerdp documentation and xfreerdp --help for possible parameters.

Overlays

It is possible to mount one or more file archives(*.tar.gz) over root filesystem. For example, you can add some software in /opt only for several workstations, without modifying the whole image.

Parameters in pxelinux.cfg:

overlayproto=http overlays=overlay1.tar.gz;overlay2.tar.gz

This will download http://<pxe server ip>/overlay1.tar.gz and http://<pxe server ip>/overlay2.tar.gz and mount them over root filesystem.

Fallback mode for graphics

If your graphic card does not work good with video drivers, you can use uvesafb framebuffer mode as fallback. You should set desired screen resolution and color depth manually in boot parameters.

Parameters in pxelinux.cfg:

uvesafb=mode_option=1280x800-32;scroll=ywrap

Documentation on uvesafb: