Viriiguy
Posts: 13
Joined: Sun Jul 17, 2016 2:26 pm

[Tutorial] Pi as a Windows Terminal Client

Fri Nov 11, 2016 11:10 am

I work for a manufacturer of Styrofoam products. On our production floors it can be a very hostile environment for a full fledged PC, so we have always made heavy use of WYSE terminals and Terminal Servers. As you may know, WYSE terminals are not the cheapest things to buy, so when faced with the need to replace our 100+ aging terminals I started looking into alternatives. After a bit of research and trying out some products that failed miserably.. I decided to give the Pi3 a shot. With just a little bit of work, I now have several perfectly functional Raspberry Terminal Clients in our plants. So I thought I would share with you my setup. That way you too can recreate this cost saving tool for your own workplaces, or even your home... Assuming you have a Windows terminal Server at home.

So what is the benefit of going this route? Cost savings and a device that can withstand harsh environments and high temps. With this setup you have a Windows Desktop for under $90 that can be deployed in a matter of minutes. My scripts are setup to automatically connect to the Terminal server upon boot up. Also, if the user logs off the session on the terminal server, they will be instantly reconnected! Same if it loses internet connection at any point. Once the connection comes back, it reconnects.

So without further ado, here are the complete steps to recreate this on your own Pi3 running the latest Raspbian with Pixel.

Setup VNC Server for remote connections
Under Start>Preferences>Raspberry Pi Configuration
Go to interfaces and turn on VNC. This will autostart it. While there go to localization and set up all options there for timezone, keyboard, wireless, etc etc etc.
Then right click on the VNC icon in the toolbar and select options.
Set authentication to VNC password and encryption to prefer off. Click apply. Type in what you want for the password.
Under privacy, uncheck notify when user connects.
Under updates, uncheck allow VNC to check automatically.


Install RDesktop and configure it to auto launch at startup and to auto reconnect.

Sudo apt-get install rdesktop

To auto start terminal on boot from command line:
cd ~
sudo nano .config/lxsession/LXDE-pi/autostart
add this line to the bottom
@lxterminal

This will open the terminal upon login

To change what user it logs into, or to change what TS it logs into,
Cd ~
Sudo nano /home/pi/rdpstart
Put the following line in this new file, -d is the Domain -u is the username -p is the password -f tells it to go full screen. Change the Domain, username, password and terminal server name to match your setup.
while true; do rdesktop –d yourdomain –u username –p password –f terminalserverName; done
Save

Sudo chmod +x /home/pi/rdpstart

Create the script to run rdpstart

Sudo nano superscript
In this file put ./rdpstart and save it

Then run
Sudo chmod 755 superscript

Next link this file to the ./bashrc so it runs when terminal is opened.
Sudo nano .bashrc
Go to the end of the file and put this line
./superscript
Save and exit.

To get out of the rdp loop, to change functions.. Log off the Terminal server, then hit CTRL-C as soon as you see the terminal window and the linux desktop. This will cancel the script until the terminal is closed and opened again.

To disable Screen Sleep

sudo nano /etc/lightdm/lightdm.conf
Add the following lines to the [SeatDefaults] section:
# don't sleep the screen
xserver-command=X -s 0 dpms




To change the admin password

Sudo passwd root

Disable the sleep function on the wireless card.

sudo nano /etc/network/interfaces

Add new line with wireless-power off right BELOW the line iface wlan0 inet manual

Save and reboot your Pi. It will now connect to your terminal server and log in, so long as you put in the right info for the domain, username, password and terminal server name.

Thank you and I hope this helps someone,
Randy

jayrcomajig
Posts: 2
Joined: Tue Jan 31, 2017 4:51 am

Re: [Tutorial] Pi as a Windows Terminal Client

Wed Feb 01, 2017 9:02 pm

hello I am new to raspberry pi and there may be some basics that I missed in this procedure you made. I was reading through your procedure and there are things I wanted to ask you that I have some confusions.

1.) In step 2 after installing rdesktop, i tried to input the
cd ~
sudo nano .config/lxsession/LXDE-pi/autostart

and another prompt has showed up and you mentioned here to add "@lxterminal" at the bottom.
the question is, should I press ctrl+0 (writeout) to save it to this prompt?


Thank you and you have a nice day!

jayrcomajig
Posts: 2
Joined: Tue Jan 31, 2017 4:51 am

Re: [Tutorial] Pi as a Windows Terminal Client

Thu Feb 02, 2017 7:02 pm

hello I am new to raspberry pi and there may be some basics that I missed in this procedure you made. I was reading through your procedure and there are things I wanted to ask you that I have some confusions.

1.) In step 2 after installing rdesktop, i tried to input the
cd ~
sudo nano .config/lxsession/LXDE-pi/autostart

and another prompt has showed up and you mentioned here to add "@lxterminal" at the bottom.
the question is, should I press ctrl+0 (writeout) to save it to this prompt? after that should i proceed to the next step?

2.) after I input all the procedure, when i reboot the raspberry pi. Why do I get "./superscript: line 1: ./rdpstart: Permission denied" and when I re-arrange the program I also get "./superscript: line 1: ./rdpstart: no such file or directory"

what do they mean?

i'm sorry for the redundancy of the previous questions.

Thank you and you have a nice day!

meunierf
Posts: 1
Joined: Sun Dec 24, 2017 5:01 pm

Re: [Tutorial] Pi as a Windows Terminal Client

Sun Dec 24, 2017 5:02 pm

Which version of Windows terminal server are you using ?

Thanks

Return to “Networking and servers”