Network Admin Guide To Deploying Thin-Clients -- By Peter Banda
Deploying thin-clients to connect to a remote desktop server (RDP) automatically can be a challenging task for network administrators who have little or no knowledge of how windows servers work. When writing this guide I used a Microsoft windows 2008 server because at least it is common and it shares some common features with the new 2012 server while the thin client, an hp t5000 was running Debian, a Linux distribution. That is the minimum of what you need to deploy thin-clients plus a local area network. Make sure that the server and the thin-client can ping each other and activate RPD on the windows server.
In case RDP is a nightmare to you! To activate it, login to the server and open server manager. On the right hand side of the server manager window, click configure remote desktop and select the second option, that says allow connections from computers running any version of remote desktop. Click select users to add users that will be allowed to RDP (administrator is added by default), then click apply and ok.
Our main goal is to make sure that the thin-client connects to the windows server at startup, without your intervention. To achieve that we need to develop a script that do the work for us, every time the thin-client starts up. So lets go for a short description of the main linux commands that we will be using.
1. cp: it’s a short name for copy. Its used to copy a file/folder from one location to another, the same as copy and paste in GUI
2. chmod: this changes file/folder access privileges. Its used to define who should have read, write and execute privileges in linux.
3. rdesktop: this is our command of the day! Its what actually initiates a remote desktop from the thin-client to the server.
Copy the script bellow and paste it onto notepad on the server. Or, alternatively, if you are viewing this page on the thin-client you can just open text editor and paste it there, then save it as auto_rdesktop.sh. But I will assume that you are viewing this page on the windows server or any other computer running windows and that you have a flash drive.
while [ "$i" == 5 ]
ping -q -c 1 $c
if [ $ping_result == 0 ]
rdesktop -f -u "" 192.168.0.1;
sudo shutdown -h now
Its a simple script but it should do the work that we want. Note that when you copy and save the script on a windows computer as auto_rdesktop.sh, windows will not recognise the file extension sh. Don’t worry, just send the file to your flash drive and plug it on the thin-client.
Ok, lets see how we should configure the script to work as we expect on the thin-client.
First things first, this is what you need to know when transferring the script to linux computer, in this case Debian. Root user, is the super user on unix/linux distros , like administrator in windows environment. No one is allowed to login using root, but only execute commands as root.
To execute a command as root, type sudo before the command, sudo means super-user -do the system may or may not ask for password depending on its configurations.
When the script is configured, it will load at start-up and when it does not find an RDP server or RDP port has some problems, the thin-client will be forced to shut down. To avoid this open the script and remove the last line that says ‘sudo shutdown –h now’ and save, when something is wrong with the configurations or RDP server, the thin-client will not shutdown. Below are instructions on how to load and configure the script.
1. Copy the script to this location on the thin client (or it can be copied to any location as long as it doesn’t get mixed up with text documents, but this location is the safest dir for scripts): /etc/init.d
If the script is on a usb drive, insert it on the thin-client and note the name of the usb drive,
It should be in the range usb0, usb1, usb2 ....
Open xterminal and issue this command, replacing usb0 with whatever name the thin-client has given your usb drive. cp /media/usb0/auto_rdesktop.sh /etc/init.d
Assuming that you want to copy the script to the init.d directory, or if its a different directory replace the /etc/init.d in the command with whatever directory path you select.
2. To make sure that you (any user or group) can edit the script on the thin-client, on the xterminal type: chmod 777 /etc/init.d/auto_rdesktop.sh and press enter.
Replace any occurrence of 192.168.0.1 in the script with your RDP server’s ip address
The script connects to RDP server in full screen mode to disable that, remove –f in the
rdesktop -f -u "" 192.168.0.1;
After editing type 755 /etc/init.d/auto_rdesktop.sh and press enter
Mode 755 will only allow root user to edit and execute and all other users and groups to only execute. Exit xterminal.
3. Press Alt+F2
A small windows shows, then type: gnome-session-properties and press enter
4. Click startup programs, then add
Browse to /etc/init.d (or to anywhere you copied the script), select the script and click OK, then close.
5. Restart the thin-client to connect to RDP server
6. To alternate between remote desktop and gnome just press ctrl+alt+enter
You can copy the script to as many as thin-clients you want.