Monday, March 25, 2013

Raspberry Pi RDP

Raspberry Pi Remote Desktop Protocol

First to get the Windows PC ready, use the guide on this site Howtogeek.com to set RDP.

Then using the RPI-TC OS from rpitc.blogspot.com on the Raspberry Pi.

I was able to use the instructions from "The New Tech Tv" in this episode tnt008-raspberry-pi-yummy-cli

Here is the set up in a shortened form.

After installing the OS to the Raspberry Pi, find the IP address of your pi, by running "ifconfig" in a terminal.
Then go to http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html, Download PuTTY on your Windows PC and install it.

Use PuTTY to connect to your pi. (If you need help because you haven't used putty and you need to see what this looks like, watching the "The New Tech Tv" episode 8 and it will show you where to put your information)

Once you have connected to your Pi, you will get a pop up window the first time you connect to it, just click ok.

If everything has gone correctly, you will then see a little windowed terminal.
We need to login with "root" and password is "raspberry"

Now we will go to the Desktop in the Terminal, use "cd /root/Desktop"

Now to see whats on the desktop use the command "ls"

There are a few different shortcuts, but the one we want to use is, RDesktop.

In your Terminal use "nano RDesktop Example!.desktop"

This will open the shortcuts parameters, some of which we will want to change.
This is roughly what it will look like


[Desktop Entry]
Name=Windows 7
Exec=rdesktop -u Vm -p -f -E -x m -z -P 192.168.123.6
Type=Application Terminal=False
Icon=/usr/share/pixmaps/RDesktop.png
Categories=Application;Network;X-Red-Hat-Base;X-SuSE-Core-Internet;

In the Name Field label as you want.
On the Exec line, you will want to put your username after the "-u" (mine is called Vm)
-p is to prompt for a password, -f for fullscreen, and after the -P put the Ip Address of the windows Pc you will be RDP'ing into.

Now if you want this to startup when the Pi starts here is what you do.

Type "cd  /root"
Then "nano win7start.sh"
Then Type

#!/bin/bash
#sleep 5
usr/bin/rdesktop -u Vm -p -f -E -x b -z -P 192.168.123.5

and click Control and O to write the file, and Control X to exit nano

Then we need to make it an exicutable script, type "chmod +x win7start.sh"
Hit enter,

In a Terminal "cd /etc/xdg/lxsession/LXDE/"
Then typel "nano autostart"

It will look like this

#@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
#@xscreensaver -no-splash
@leafpad /root/README


we want to change it to this


#@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
#@xscreensaver -no-splash
#@leafpad /root/README

@lxterminal --command "/root/win7start.sh"

and click Control and O to write the file, and Control X to exit nano.

Now it's time to reboot and see if it works!

It worked for me!

Have fun with it, and More posts to come.

As a side note, while this is very cool, it also opens your Windows Pc to more vulnerabilities, by using RDP.
In some cases, it may be wiser not to use this protocol, but that is up to you and your Admins.