Saturday, May 4, 2013

Using a Raspberry Pi as a Thin Client for RDP/RemoteFX/VMWare View or Citrix

There is a cool project by Gibbio at blogger that uses Debian Linux as a base turn the Raspberry Pi into a thin client that works with RDP, VMWare View, Citrix, OpenNX, and Spice.  After imaging your SD card you can plug and go. I've tested it with RDP complete with RemoteFX, and it works well with a few caveats which I'll note below.


Requirements

  • Raspberry Pi Rev B with a network connection, monitor, kb, etc.
  • A SD card at least 2GB in size. The faster the better. 

Let's Set it Up

  1. Insert the SD card to a workstation to image it. On that workstation: 
  2. Download the ISO. Links here.
  3. Unpack the ISO to a temporary directory. 
  4. If you're on Linux, skip to step 6. Download DD for windows from here.
  5. Unpack DD to a working directory and make note of where it is; we'll be using it in a moment. 
  6. Insert your SD card and wipe out all partitions on it. I'll assume you know how for Linux; in Windows use Diskpart: Diskpart (Enter), List Disk (Enter), Select Disk X (Enter), List Partition (Enter), Select Partition X (Enter), Delete Partition (Enter). Repeat list, select, delete for each partition on the SD card then Exit (Enter). Make sure you don't execute this sequence on any other drives or you will loose all your data!
  7. Image the drive using DD: dd bs=1M if=c:\temp\RPi-TC_ARMv6j_r1.img od=d: WHERE: c:\temp\RPi... = the image location and od=d: references the location of the SD card. Update: If you have issues with dd, give Roadkill's disk imager a try. 
  8. Remove the SD card (properly) and insert it into the Raspberry Pi
  9. Start it the Pi. 
 

Using RDP


Once the Pi Boots (Note that boot animation) you'll see a bunch of icons on the desktop. To connect to an RDP session, do the following:
  1. Double click on X2Go Client 
  2. Click the "New Session" button in the upper left corner. 
  3. Name the session, enter the host (make sure the host name corresponds to the cert CN)
  4. Enter your login as domain\username
  5. Change "Session Type" to "Connect to Windows terminal server" and check the "Direct RDP Connection"
  6. Click the "Settings" tab and change the Display to the desired resolution. (Fullscreen works) Note that I haven't been able to get xfreerdp to work yet but rdesktop is working. 
  7. Click "OK"
  8. Click the newly created session and then enter in your password. 
  9. Enjoy your RDP session! If you selected Fullscreen, note that the kb combo to go back to a window is CTRL+ALT+ENTER

RDP Notes: 


  • As of now it seems that NLA is not supported, though I'm looking into it. To disable NLA uncheck the box labled "Allow connections only from computers running Remote Desktop with Network Level Authentication" in the "Remote" tab of the advanced system properties dialog of the machine you're connecting to.
  • RemoteFX works, but it is actually slower than standard RDP. I'm looking into this too.
  • Audio redirection, clipboard, multitouch, and USB passthrough don't seem to work. Guess what, I'm looking into that. 

Misc Notes:


  • I haven't tried the other clients yet, though I can report success using the VMWare view client direct from a friend. 
  • The Raspberry Pi has issues with some mice. If your mouse seems unresponsive try a different model. 
  • The newest build uses a tweaked kernel. Though I haven't needed to, you can switch back to the standard Raspberry Pi kernel by changing the line kernel=kernel.img to kernel=kernel-std.img in /boot/config.txt and rebooting. Debian comes with Vi and Nano that you can use to modify it.


Overall this is a interesting project that has been alot of fun to play around with. As always if you have any questions or comments throw them in the comments section!

Update: I'm getting quite a few hits on this one and I just want to underscore before it is proposed in production at your company that it's not quite ready for prime time yet due to the issues listed above. I look forward to helping drive it there though; I intend on updating as I drive towards tweaking RDP to be perform better.

And more importantly, there is a new build posted here! Note Remmina isn't working yet but Gibbio is working on it.

Update 6/27:  Gibbio has posted a new build that looks quite interesting. Among other things he has provided the XFCE desktop environment.

Update 7/1: The newest build works fine with xfreerdp which seems to perform a bit better than rdesktop. To use it, either launch from a terminal or create a shortcut with the following syntax:

xfreerdp /v:server.domain.ext /u:UserName /p:Password /d:DOMAIN /f /cert-ignore

Where: /v: is the target machine, /u: is the username to use, /p:is that user's password, /d:is the domain in which the user resides, /f is for fullscreen mode (if desired) and /cert-ignore is to ignore an untrusted cert, which is likely if you're using the default self-signed certs. For the rest of the options, see the wiki page.

Links: Olivier Muret: French Raspberry Pi RDP Writeup

Thanks for reading!

11 comments:

Wav3head said...

Good Project!

I've tested it at my Company and it's great!
but i have one question.
How did you realize the genius bootanimation?

Greetz,
Kroeger

Toby Meyer said...

Thanks Kroeger; I'm glad you enjoy the animation... I didn't create it, I only wrote this article about setting it up. The package has been put together by Gibbio. That boot animation is amazing; almost worth the price of admission alone.

Thanks for reading!

Hilton Travis said...

I notice that there is an XFreeRDP example shortcut on the desktop, but no matter what I try, it seems I cannot use XFReeRDP to make a connection to any servers I have - either directly nor through RDP Gateway as every time, there's an SSL protocol error.

Toby Meyer said...

Heyya Hilton!

Have you looked at the certificate name associated with the RDP host? By default FreeRDP enforces host->published host name matching and is even case sensitive with its enforcement. This means if your server is named SerVer01.mynetwork.local and your connection points to Server01.mynetwork.local it will fail with an SSL error because the cert name does not match the host name.

Hopefully that's your issue... if not feel free to follow up and we'll get to the bottom of it. Thanks for reading!

Dipin Thomas said...

Hi ,

This is working only as a RDP client but not as a thin client, where multiple user can login and all having live sessions.

How to use it as thin clinet, help me. write to dipinthomas2003@gmail.com

It will a great help.

Thanks

Toby Meyer said...

Hi Dipin!

I'm a bit confused about what you're trying to do but I'll address both possibilities. If you're hoping multiple users can use the Raspberry Pi at one time, that really won't be possible because the Pi doesn't have enough power to host multiple sessions that require any real processing power. If you're talking about multiple Pis accessing a single server, you would need to ensure you're setup and licensed correctly on that server. For example, you would need TS Licensing for Windows servers if that's what you're trying to access. Good luck!

Dipin Thomas said...

Hi Toby,

I am trying the second, multiple pi to one server. Windows part i got it working, needed some minor changes only TS licensing part if left.

Actually i am looking out for linux where i need not worry about licensing. I am not able to get rdesktop working properly with linux, can you help ??

Thanks...

Toby Meyer said...

@Dipin

For remoting to a Linux server you'll want to utilize either the OpenNX client with a solution like FreeNX or X2Go, both of which (clients) are built into Gibbio's build. Give 'em a shot!

pi3g said...

The boot animation has been realized as a video, which is killed once the booting has been complete. A nice idea :-)

Baylink said...

SSL certname matches are case sensitive on the DNSname part?

That *has* to violate an RFC somewhere; the DNSname itself is *explicitly* case-insensitive.

I'm going to have to look into that.

sandeep rdp said...

RDP Thin clients are cost effective and alternative to PC’s. It largely depends on host computer to fulfill its computational roles. It improves maintenance and security due to central administration of the hardware and software in the servers.

Now RDP thin clients are come with citrix ready