VPN access on Mint using rdesktop

This post was going to begin with one of my occasional bulletins on the fortunes of Luton Town, beloved club of my mate, Simon. However, the man himself has been bitten by the blogging bug and the resultant musings on all things Teradata ( and various other topics) can be seen here.
So instead, I’d invite you to consider the Nordic majesty that is Milford Sound. Nestled in the heart of Fjordland in New Zealand’s South Island, this watery expanse evokes awe and wonder, even in a land where jaw-dropping scenery is always just around the next bend.
Milford Sound was itself named after the equally picturesque sounding Milford Haven. Yes, Milford Haven in Wales, site of one of the largest oil terminals in Europe.
I should note at this point that the Welsh Ambassador has demanded that I point out that Milford Haven does have some nice bits.

Moving swiftly on, in the vain hope of avoiding domestic disharmony, my point is, the fact that two things share common characteristics doesn’t mean that they are necessarily identical.

All of which provides a somewhat tortuous link to the subject of this post, namely, setting up remote desktop access via a VPN on Mint.

Now, you’d think this was pretty much the same as on Ubuntu, and it is…up to a point.

First off, the download for the VPNC Network Manager package

sudo apt-get install network-manager-vpnc

Click on the network manager icon …

Creating the VPN connection

Select a Cisco compatible VPN

Provide the information you got from your network Admin (Gateway, Group Name, Group Password).

NOTE – at this point, I had to re-boot before my newly created VPN connection appeared in Network Manager.

Now all you need to do is go to the Internet Menu and select Terminal Services Client…except it’s not there on Mint. Oh.
Where as Ubuntu offers the tsclient utility as it’s standard, friendly GUI to type in all the requisite information ( IP Address, login details etc), Mint doesn’t include it out of the box.
Instead, we need to look at using rdesktop.
Fear not, dear reader, for although setting this up does, initially at least, require a foray into the wacky world of shell scripting, it’s easy enough to set this up to run without having to go to the command line every time you feel the need to logon to work.

rdesktop

There’s a useful forum post on rdesktop here.

Anyway, if I want to remote onto my PC (which for the sake of this example has an IP Address of 192.168.1.57) …

rdesktop 192.168.1.57 -u mike -p mypassword -r clipboard:PRIMARYCLIPBOARD -g 80%

So, we pass in the IP address, the username on the target machine (-u mike), the password (-p mypassword),

The -r switch enables re-direction of a device ( in this case, the clipboard on the target machine).

The -g switch specifies the screen size of the rdesktop window as a percentage of the total screen size.

Making it Prettier with Zenity

Despite being, what could be (and has been) characterised as a “Command Line Codger”, I would quite like to have a nice GUI rather than doing all that typing, especially if I need to connect to more than just my work PC.
Fortunately, Zenity is on hand to offer a bit of GUI goodness without too much messing about

#!/bin/sh 
targetIP=$(zenity --list \ 
   --title="Choose the Host you want to connect to" \ 
   --column="Target IP" --column="Host Description"\ 
            192.168.1.57 "My Desktop"\ 
            192.168.1.80 "Prod Server" ) 
uname=$(zenity --entry \ 
    --title="Username"\ 
    --text="Enter Username") 
pwd=$(zenity --entry \ 
    --title="Password"\ 
    --text="Enter Password" --hide-text) 

rdesktop $targetIP -u $uname -p $pwd -r clipboard:PRIMARYCLIPBOARD -g 80% -a16 
exit 0 

Run this and we get :

Pick a machine, any machine...

Now all we need to do is obviate the need to open a Terminal Window altogether. Have a look here for the steps for adding a script to the menu. On this occasion ( at least on Mint11), the steps are identical to those on it’s Ubuntu cousin.

International relationships are at a delicate stage at the moment. It’s Deb’s “touchy time”…Wales are playing England in the Six Nations soon. Hopefully a foot-massage and a judiciously applied glass of white wine will avert a diplomatic incident…for now.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s