Wednesday, April 15, 2009

Getting VNC and the VPN to play nicely together

I work from home regularly but have always found my work laptop's display to be difficult to use for long periods of time. When my laptop wasn't on the VPN I had been using Microsoft's RDP to make use of my incredibly beautiful iMac 24" display to proxy for the laptop display. However this doesn't work when the laptop is on the VPN since incoming RDP connections are blocked by my employer.

As I worked from home more and more I finally got irritated enough by RDP's inability to display a full resolution version of the laptop's display and the inability of any of this to work when on the VPN to do something about it all. At least for now I don't want to have a separate monitor or try to go to a KVM setup.

I had already implemented the ability to SSH from my Windows laptop to the iMac using public key authentication. This allowed me to use VNC from the work laptop to the iMac and ensured I could keep all personal info off of the work machine. This capability is required in order to do the next steps (well, the public key part isn't required, password authentication would be OK but isn't recommended for security reasons). There are a lot of sites with info on setting up SSH and VNC to use from a work machine to a home Mac. I'm not gonna duplicate that info here. Once you have that working the rest should be trivial for you so the exact details have been left as an exercise for the reader :-) But here's the overview...
  • I copied my original SSH script to create two more on the laptop. One for use when the laptop is on the VPN (in which case I use the public domain name of my iMac) and the other for when the laptop is off the VPN (in which case I have to use the IP address of the iMac). The scripts are identical to the one I use to SSH from the laptop to the iMac for accessing the iMac except the "-L" is replaced by a "-R" with the "R" telling SSH to set up a reverse mapping. Also the port is changed from 5900 to 5901 (see the note below for why).
  • I run RealVNC's service mode server on the laptop. Once the reverse SSH connection is established I can then use Chicken of the VNC to display the laptop's "screen" on the iMac (other VNC viewers should work too).
  • Since the iMac accepts incoming VNC connections on the default port 5900 the "Display" number must be "1" (i.e. port 5901) when accessing the laptop's display. Otherwise CotVNC will try to display the iMac's screen in it's window resulting in a cool but useless and frustrating recursion. For an address have CotVNC connect to localhost.
The main point of this blog entry is to let you know this is possible. If you have a question shoot me a message but note I can't provide detailed support. Also, FWIW, the reverse SSH technique is not Mac-specific and can be used on other flavors of OS.

Wednesday, April 1, 2009

Skype is Approved

Skype just came out with an iPhone version of their app. It allows calls over Wifi - i.e. it doesn't use up your mobile phone minutes. Calls to other users on Skype are free and there are low cost plans for calling landlines. The international calling rates are especially low compared to other long distance options.

The iPhone app is great for a 1.0 app. It's existence prompted me to set up an account and install the Mac and Windows versions as well. Calls on the iPhone are very clear. The one call I've done on my iMac was very good as well (even using the builtin microphone).

I'm a believer. This thing has legs :-)