We have used VMware desktop virtualization for about 4 years now. One of our labs of computers was converted into thin clients a few years ago using a procedure we found with Windows ThinPC and the VMware Horizon client.

We ran into an issue with upgrading the client to the new version recently. For some reason, we ran into an issue with the client and the version of Windows wasn't compatible.

We then decided to use Linux and convert them to that with the same look and feel with the newer client. Here is what we have as a baseline;

29 Steps total

Step 1: Install the OS

In using Lubuntu, this is a lighter OS than Ubuntu for the class of machines that we are using. We choose the defaults for most the options, except for a few. We'll outline them in the steps below. These steps that are not the default are the ones that you'll see below.

Step 2: Updates and other software choices

In our case during this step, we chose a Minimal Installation and also chose the Install third-party software for graphics and Wi-Fi hardware and additional media formats. We probably didn't have to install the third-party software, but we did as a precaution.

Step 3: Installation type

In our case, we are wiping the drive. There is no reason for us to dual boot the drive or even encrypt the drive.

Step 4: Username and computername

In this step you choose the username and computer name. For the purposes of the HOWTO, I left the computer name as what it defaults to, but you can change it to whatever you like.

For a username I chose thinclient. I also set a password and set the option below to Log in automatically. The unit will login, but setting a password on the username will allow you to secure your thin client when you need to do maintenance. Once you have done this the computer will finish installing the OS and you should be at a desktop upon reboot

Step 5: Update of OS

So as part of our configuration, we need to update the OS. In my case it popped a screen up on the desktop, but I closed it so I can go to a terminal and update it. I prefer to be there to install software when I need to start the configuration phase.

To get to a terminal you click on the menu in the lower left corner and follow System Tools -> LXTerminal

Step 6: Updating the OS

In this step you will update the OS at the terminal. It consists of two commands

sudo apt update
sudo apt upgrade

Sudo is the linux command for "admin" privileges or root access. It will ask for a password. This is what you would have set in step 4. After you are done with the updates, reboot the machine

Step 7: Install required software packages

Once the computer is back up, you will go back to a terminal screen and install five packages that are required for the VMware Horizon client install and remote maintenance.

You will install the following;
- Python 2.7
- OpenSSH Server
- NTP
- Libgstreamer1.0-dev
- x11vnc
To do that you will use the following command;

It will ask you again for the thinclient username password. Once you have, it will show you what it is going to install. Answer yes and it should start installing the packages.

Step 8: Link Python for the VMware Horizon Client install

VMware's Horizon Client for Linux requires Python 2.7 to work. Lubuntu comes with a new version that isn't compatible. We will simply need to create the symbolic link for it to work. To do that, use the following command;

sudo ln -s /usr/bin/python2.7 /usr/bin/python

Once you have done that, there should be no errors and you can continue to the next step.

Step 9: Link the GStreamer libraries for the BLAST Protocol to work

In this case, we will be leveraging the BLAST protocol on these units. In order for that to work, again we need to create symbolic links for it to satisfy the VMware Horizon Client install.

This would be the same as what you did to link Python. There are three commands you will use;

Step 10: Edit NTP config for correct time on system

In our case, NTP from the outside world is blocked, so we have to pull time from an internal source.

I pull time from our provider to my Windows AD DC. I need to go to the NTP config file and change it. In this case you will need to edit the file with the editor of your choice. I use nano, but you can use any editor of your choice.

You will do the following;

sudo nano /etc/ntp.conf

You will need to insert a line around line 21 of the config file to pull from your time source of choice. In this case it would be the following for me;

pool 10.11.0.17 iburst

Once you have done that, save and exit. In nano if you do CTRL+X, it will prompt you if you want to save the file.

Step 11: Change GRUB timeout to a shorter period

In our case, we're dealing with kids, so when a machine is booting, the less things they have to mess with, the better we are.

In this case I am going to edit the GRUB default boot time from 10 seconds to 3.

Again we edit the file by using the following command;

sudo nano /etc/default/grub

You should see a line like this;

GRUB_TIMEOUT=10

Change it to GRUB_TIMEOUT=3

Once you have done that, exit and save and then at the command prompt, type the following;

sudo update-grub

Step 12: Download and prep the VMware 64bit Linux Client for install

Now we can download the client from VMware. You can open Firefox on the client ad go to the following address to download the client;

When you have downloaded it, you can close Firefox and go back to your terminal window.

We need to do a few steps to get the file ready for install. You will need to get to the download directory. This is done this way;

cd ~/Downloads

You now need to make the file you downloaded, executable. This is done with the following command;

chmod +x VMware-Horizon-Client-4.9.0-9507999.x64.bundle

(TIP - If you don't want to type the entire file name, you should be able to hit the Tab key after you have placed a space after the +x)

Step 13: Installing the client

Now that the bundle is executable, we can install it. You can follow the tip from above and put sudo ./ on a command line and then press the Tab key and it should start installing.

You will have to accept the license agreement on the pages. There is 22 pages of the license agreement you can go through it by pressing the space bar until you get to a, "Do you agree?" prompt. Type yes and go on.

Now you will need to choose what features you want installed with the client. I will outline how I answered below. Your requirements for your environment may be different.

Once you have answered these questions, you can press enter to start the install.

Step 14: Finishing the VMware install

Once this has run, you will get two more questions.

It will want to know if you want to Register and start installed services after the install and check the system for compatibilities.

Choose yes for each of these. This will scan your computer for the required libraries and ensure they are installed. If not you will get a screen that will tell you what is missing. In my screen, everything is ready to go.

Step 15: Creating the view-mandatory-config

Now we need to create a config file to tell the client how to behave on startup. This can be found in the following document from VMware;

(Please note that the first two lines after the = you will put your connection server with the FQDN without the () but with the "" on either side)

Step 16: Create script to run the view client in a "loop"

So in our view-mandatory-config, we have at the end a line that says;

view.once="TRUE"

When the desktop logs out, we are still connected to the server as the user and they can see all the pools they are provisioned to. We wanted the client to be ready for another user to use the machine once they logged out. This is where the line in the config comes into play, but we also didn't want to drop to a desktop either.

We developed a simple looping script to ensure this would work as intended.

You should go back to your terminal window and type the following;

nano viewclient.sh

Do not use sudo before this. We don't need to be root to create this script.

Once you have exited and saved, you will need to make this one executable to by doing this;

chmod +x killscript.sh

Step 18: Script to end the viewclient script locally

So if you go the the client physically to perform maintenance, we created a script to run locally to end the client and not reboot.

To use this one, you can get to the start menu by pressing Ctrl+Esc and going to a terminal.

Again, make sure you are still root to create this script. We are going to call it Endview.sh.

The script should look like this;

#! /bin/bash

pgrep -f viewclient | xargs kill

We need to make it executable with the following command;

chmod +x endview.sh

Step 19: One last script security measure.

We need to ensure the two scripts, endviewclient.sh and killscript.sh can only be run by root. We'll do the following two commands;

sudo chown root killscript.sh
sudo chown root endviewclient.sh

We also need to do the following as well as root;

sudo chmod 700 killscript.sh
sudo chmod 700 endviewclient.sh

Step 20: Keep machine from locking

Now we need to ensure that the machine won't lock and require a password to unlock.

To do so you will go to the menu -> Preferences -> Power Manager
Go to the security tab and select "Never" at Automatically lock the session

Step 21: Configure SSH access

We installed SSH server so you can perform some remote maintenance to the computer. We need to ensure the following is done to keep the unit secure.

You will need to Disable X11 forwarding to ensure you are not running two view clients at once.

To do this you need to edit the sshd_config file. We will do the following at a terminal window;

sudo nano /etc/ssh/sshd_config

Find the line X11Forwarding yes and change it to X11Forwarding no.

Save the file and close it.

Step 22: Limit SSH and VNC connections

In this case I wanted to limit the connections to the SSH server by subnet. We also have VNC running on the unit and limited VNC connections as wellThis is done through the ufw. To do this you will do the following commands.

This will allow you SSH and VNC from any management subnets that you trust

Step 23: Shut the computer down on a schedule

We have students leave at this building at 2:30, we decided an hour later, we'll shut the computers off on a schedule.

We do this by editing the crontab this way;

sudo nano /etc/crontab

before the last #, insert a line and put the following to your needs;

30 15 * * * root shutdown -h now

Save and exit

Step 24: (Optional Steps)

After building this how to, we found various issues with our clients that we had to iron out. First, we had an issue with the sound on our units muting randomly. We actually came at this from two directions. First we implemented a script to ensure the audio was not muted and we also implemented VNC as well.

Second, we found that we had an issue with the VMware view client with identical client ID's

Step 25: Create script to unmute sound

After creating this HOWTO, we found that our sound was sporadically muted on the machine. We would have to go to the machine and unmute it manually.

We found that when we created this script, we could unmute the sound;

nano unmute.sh

#! /bin/bash

export DISPLAY=:0
amixer -q -D pulse sset Master unmute

Save this as the thinclient user, not as root. It will not run correctly as root.

After saving it, run the following;

sudo chmod +x unmute.sh

Step 26: Schedule the unmute script

Again, we decided that we would schedule this to run every 10 minutes to ensure that the machine was not muted.

As the thinclient user, at the prompt, type;

crontab -e

In the crontab, put the following line;

*/10 * * * * /home/thinclient/unmute.sh

Save it and it should then run as the thin client user every 10 minutes.

Step 27: Configure x11vnc

As a part of the security as well, we will need to set a password on the x11vnc. To do that, you will use the following command;

x11vnc -storepasswd

You will put your password in there twice and then it will ask you where to save the password. Accept the defaults and you should be ok with it then.

Usually x11vnc will run one time. In this case I created a script to run on start up to ensure it will run. It looks like the viewclient.sh script;

nano x11vncstart.sh

#! /bin/bash

#run x11VNC all the time
while true; do x11vnc -usepw; done

Save the file and once you have done that do the following to make it executable;

Now we ensure the viewclient.sh, x11vncstart.sh, and unmute.sh scripts that were created will start automatically when the computer starts.

This is in the menu under Preferences -> Default applications for LXSession Goto Autostart.

In the line under Manual autostarted applications add the following

./unmute.sh
./x11vncstart.sh
./viewclient.sh

Click the add button for each script. The client should be setup and configured for use now.

The unmute.sh does not loop. This only runs one time when the thin client is started up or rebooted and the crontab that was setup in step 26 will handle the script from here on out.

Step 29: Imaging the machine (Optional)

Once you are done, if you are going to create an image of the thin client, you can do so now, as long as you didn't connect your View Client to your Horizon server. If you did, it would have created a client ID and that will clone as well.

Simply shut the computer down and create your image. In our case, we used CloneZilla and could image the lab in about an hour or so.

When you apply the image to your computer, you will need to change the hostname as it will match what your master machine was. To do that, you do the following;

sudo nano /etc/hostname

Simply change the name in that file and then save it and reboot.

We built this so that we could utilize the newer Horizon View client and start leveraging the BLAST protocol. Overall we see no difference in small scale testing over our current PCoIP environment.

We thought that this allowed us some more management over the PC remotely without going with a full thin client solution from a vendor.