Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Our Setup of rpitc
14-12-2014, 07:05 AM,
Our Setup of rpitc
In our office we use rpitc in production and employ scripts as well as a GUI Gibbio has built. Here's the scoop...

For our secretary and accountant we use rpitc with Gibbio's RDPGui (

Looks very professional and works great.

The rest our rpitc thin clients are used for our workstations where employees have the need to float from one workstation to the next. We leave the raspberry pi thin client logged in to it's

assigned virtual machine with a generic ID (All workstations are locked down with no Internet Access or limited network access). I have scripts on our Pi's run at boot that will autologin based

on the Pi's hostname. To achieve this I've created the following:

ConnectConfig file:

This file lists all the data my bash script will use to login to the VM it is assigned.

THINCL1 User1 MyPass
THINCL2 User1 MyPass
THINCL3 User1 MyPass
THINCL4 User1 MyPass

The layout of the above config file is as follows:
Thin Client Hostname IP of computer Pi connects too Login ID of remote computer Password of remote computer IP Address of Pi

I then created the following bash script which checks if rdesktop is running. If rdesktop is not running the script will read my ConnectConfig file, find the hostname assigned to this particular

rpitc thin client and find a match. It will find the IP of the remote computer using the credentials in the ConnectConfig file.

This of course is very insecure...I've saved my generic id and password in this file for anyone to read..but again these are generic workstations used by any and all in our office so everyone

knows what the password is to use these anyway. I wouldn't suggest this method for anyone who wants to keep the userid and password more secret.

echo $ConfigFile
echo $ThisHost
# Check if rdesktop is running
if pgrep rdesktop > /dev/null
        echo "$(date "+%m%d%Y %T") : rdesktop is already running.  Existing this script" >> $Logfile
        exit 0
    echo "$(date "+%m%d%Y %T") : rdesktop has Stopped. Attempting to restart." >> $Logfile
    string=$(grep $ThisHost $ConfigFile)
    host=$(echo $string | awk  '{ print $1 }')
    ip_addr=$(echo $string | awk '{ print $2 }')
    userid=$(echo $string | awk '{ print $3 }')
    passwd=$(echo $string | awk '{ print $4 }')
    if [ "$ThisHost" == "${host}" ]
        echo "$(date "+%m%d%Y %T") : Hostname $ThisHost  was found." >> $Logfile
        echo ". " >> $Logfile
        echo "$(date "+%m%d%Y %T") : Hostname $ThisHost was not found. Please ensure your ComputerName has been set properly" >> $Logfile
        echo ". " >> $Logfile
        exit 0
    echo ${host} ${ip_addr} ${userid} ${passwd} $ThisHost
    rdesktop -z -f -u ${userid} -p ${passwd} ${ip_addr}
        exit 0

Lastly I employ a cron job to run every two minutes and restart the rdesktop connection (essentially calling my script). This ensure each raspberry pi thin client is always

connected to their assigned VM.

*/2 * * * * export DISPLAY=:0 nohup && ~/scripts/ &..~/scripts/cron.log

We setup each Pi Thin Client with a static IP and assign a Hostname (update /etc/hostname and /etc/hosts).

Hope this helps someone with their setup as well.

Forum Jump:

Users browsing this thread: 1 Guest(s)