Virtual desktops
Christian Cawley explains how to create a Citrix-style virtual desktop with Raspberry Pi and a Linux server.
Christian Cawley explains how to create a Citrix-style virtual desktop with Raspberry Pi and a Linux server.
Raspberry Pi computers have come a long way since their first release in 2012, but one thing that has been largely absent is support for standard desktop tasks. While a Raspberry Pi 3B+ can substitute as a typical desktop for common office tasks, as soon as there is a need to deal with image editing, presentations, video processing, or other intensive tasks, it’s time to rely on a ‘real’ computer.
However, the Raspberry Pi’s flexible nature and minimal profile make it the ideal device to connect to a server-based computing environment. This server, running hosted, shared desktops and application virtualisation, could be running Linux or even Windows.
Enjoy your Pi!
Several systems have been developed that enable you to use a Raspberry Pi as a thin client. This is essentially a low-spec computer optimised for a remote connection to a server which is running one or more virtual desktops. It’s a dynamic popularised by Citrix, enabling affordable, low-spec PCS to be distributed around offices while a central server does the hard work. In terms of “affordable, low-spec PCS” the Raspberry Pi is probably the winner, even if its “personal computer” credentials are up for debate.
Regardless, it makes a perfect thin client, particularly for Windows-based servers. Various options are available for including using the Raspberry Pi Thin Client project, which includes Citrix, and Vmware Horizon – as well as VNC-, SSH- and Rdp-based solutions.
However, there is a simpler, Linux-only option. Employed mainly by Greek schools and colleges, Linux
Terminal Server Project (LTSP) is a Linux-server thin client system. It’s usually set up with a standard Linux server running several virtual desktops that are connected to lower-spec Linux PCS.
It just happens that the Raspberry Pi is an ideal lowspec thin client terminal, compatible with the ltsp-server that LTSP uses…
It’s fun to stay at the LTSP
The starting point is to ensure ltsp-server is installed on your Linux box. In the terminal, start by updating and upgrading your system: sudo apt update sudo apt upgrade
Next, install ltsp-server itself, along with dnsmasq
(for DNS and DHCP management) and tftpd-hpa for
FTP support.
sudo apt install ltsp-server dnsmasq tftpd-hpa
The next step is to set up a client image. Various configurations are available, but the default option should work fine. sudo ltsp-build-client
This step will take a while to complete, making this a good opportunity to begin setting up your Raspberry Pi with the LTSP client software and have a cup of tea.
You’ll find it all at the LTSP
The build client command is required for ltsp-server to run correctly, providing a small disk image which the client computer can download and run from RAM. To use a Raspberry Pi with LTSP, you’ll need Berryterminal.
With this installed, your Raspberry Pi will be set up as a
LTSP client upon each boot.
Start with a fresh microsd card and install Berryboot (http://bit.ly/lxf250-berryboot). This is a downloadable bootloader and operating system installer for the Pi, much like NOOBS. It can be copied to the microsd card via the file manager, without writing any disk image files.
Once it’s downloaded, extract the zipped Berryboot contents to a formatted microsd card, then eject, insert it in your Raspberry Pi’s card reader, and power up. With the Pi booted into Berryboot, select Berryterminal, then Install. Multiple operating systems can be installed; if you choose this, a boot menu will appear each time you restart your Raspberry Pi.
By now the client should have been built on the server. Open a terminal to add the ltsp-manager PPA and install the LTSP Manager tool: sudo add-apt-repository ppa:ts.sch.gr; apt update sudo add-apt-repository ppa:franz-die/ltsp-manager; apt update sudo apt install ltsp-manager
With this installed, create a new profile using the Users > New user menu, taking the time to add the user to the correct group. Bear in mind that any user accounts created here will be accessible from any client device running Berryterminal.
Once installed, you’ll need to configure Berryboot.
The easiest way to do this is to wait until the terminal prompt appears, then unplug the Pi, as there is no shortcut command. Ensure that the disk access LED is not flashing when you do this.
Next, replace the microsd card in your PC’S card reader. Browse to the boot directory and find cmdline. txt, then open it in your text editor. You’ll find a series of options, all on a single line, in the standard command = condition format. You’re going to append this line to get Berryterminal working:
SERVER=SERVER.IP.ADD.RESS
Adding this ensures that the terminal can find the server without any issues. You can also make some changes to the keyboard layout.
XKBLAYOUT=EN
This will specify a British keyboard, but you could use =fr for French, for instance. Similarly, you can set a language for the entire environment with:
LDM_LANGUAGE=EN
Meanwhile, to save time logging in, you can use the autologin feature:
LDM_AUTOLOGIN=TRUE LDM_ Username=username12 LDM_PASSWORD=PASSWORD
Each time Berryterminal boots, your Raspberry Pi will automatically sign into the LTSP server. Your Raspberry Pi is now configured as a terminal ready to connect to the local LTSP server. All of the intensive processing work will be done on the server, letting you run software that wouldn’t normally be compatible with the Raspberry Pi.
As it’s a common solution see the box on page 74 and the one below for more details about getting LTSP up and running with Windows Server via Wtware.