Ubuntu and Microsoft VPN Setup or: How I Learned to Stop Worrying and Work From Home in Linux - Adventures in Switching to Linux

Wednesday, December 19, 2007

Ubuntu and Microsoft VPN Setup or: How I Learned to Stop Worrying and Work From Home in Linux

I work for a small company with a Microsoft based VPN. As employees of a small company, we have the luxury of being able to work from home when necessary. Since my primary computer at work is running Windows XP and already has everything I need configured, the easiest way to work from home is to connect to the VPN and then create a Terminal Services connection to my machine and work as if I am there (minus the second monitor).

Note: If you have a different, non PPTP VPN, your mileage may will vary. This is the only VPN I have ever connected to with Linux.

Step 1: Connecting to the VPN

The first step in this of course is to get connected to the VPN. It turns out, at least in Gutsy Gibson, this is a fairly easy task. All you really need to do is install the "VPN Connection Manager (PPP generic)" in Applications -> Add/Remove...

Once you have that installed, just left click on the network icon in the system tray, select VPN Connections -> Configure VPN. Click the Add button to configure a new connection. Configuring the VPN was straightforward for me. I entered in the Connection Name, Gateway (this is the IP address of your VPN server) and under the Routing tab I set it to only route traffic to the VPN local network over the VPN by adding We intentionally setup our work network to be 10.10.10.x so it would not conflict with the home network of any other employees. Most routers default to using 10.0.0.x, 192.168.0.x or 192.168.1.x (you don't often see a 172.16.x.x - 172.31.x.x internal network). Everything else I left as the default.

After configuring my new VPN connection I did have one little issue. The connection didn't show up when I again clicked the network icon in the system tray. I think to fix this you can just restart the network manager but I had to restart my system anyway due to a kernel update required restart.

Once you have the VPN connection configured, then you can just click on the network icon, select VPN Connections and click on your newly created connection. You will then get a dialog to enter in your username and password. As it is connecting to your VPN, the network icon will have a little yellow swoosh thing that flows into a little lock on the network icon. Once connected, the lock stays constant.

Step 2: Connecting to the my computer at work with rdesktop

The next thing I need to do is connect to my work computer using Terminal Services / Remote Desktop. I am not really sure what the difference is between those two terms so I will use them interchangeably. The default install of Gutsy Gibson has a "Terminal Server Client" installed. It is the last option under Applications -> Internet. It handles 2 types of connections: Virtual Network Computing (VNC) and Remote Desktop Protocol (RDP).

VNC is platform-independent and works pretty well. When in Windows, I have TightVNC running as a server so I can connect to my home system from anywhere, even the Java client in a browser. I am sure I will setup a VNC server in Linux for the same purpose eventually. RDP is primarily a Windows solution. The "Terminal Server Client" is really just a nice front end for the actual applications, rdesktop and vncviewer, that are used to connect to a remote system.

The information you need to know is self explanatory if you have ever used Remote Desktop on Windows. You need to know the IP or host name of the computer you are connecting to, select the RDPv5 protocol (only use the plain RDP protocol if you have to connect to an NT4 machine, I hope you don't), enter your username (skip the password, it asks again later anyway) and the domain (I am pretty sure you do not always need this). I also go to the Display tab and change my connection to full screen mode but that is your call. Important Note: To get out of full screen mode, hit the key combination CTRL + ALT + ENTER. The native Windows client handles this much, much better as it has a little bar in the top center that works like a menu bar with auto hide and is only shown when you mouse over it or explicitly pin it to show.

And that is all there is to it! Now I am Working from Home in Linux!


Ramon said...

I am trying to connect to my remote computer in my work network but there is no way to make the Terminal Server Client to connect to my remote computer. It says connection refused. I can connect the VPN network but no way to work remotely. Any help on that?


alex smith said...
This comment has been removed by a blog administrator.
Bradley White said...

Thanks.It works good.Nice configuration.

Richard B. McCall said...

Thank you.Good solution for VPN client.
It works amazing on Linux.
Cool installation guide.