Remote Control of OS X (Tiger) Desktop via VNC

Posted by Dave Minor Fri, 21 Dec 2007 21:25:00 GMT

I’ve been asked to post the method that I use to easily log onto remote macs to facilitate support on some of my client’s machines. This is not rocket science, just my howto that I pieced together from several sources long forgotten (sorry). It’s very possible that this procedure will continue to work on Leopard, all of the machines I deal with are still running Tiger at this point. I think this worked with Jaguar too, but I can’t recall.

The basic idea is to log onto the remote machine via SSH, start a VNC server, then connect from the local machine and use SSH port forwarding tricks to keep yourself from leaving VNC ports open and forwarded on the remote router.

Remote Machine Setup

  • must have an administrator’s account
  • must have a static IP address on the LAN
  • install OSXvnc which is now called something else. I am running version 1.4. I’m not sure if this will work with the new server
  • create a ~/bin directory
  • in ~/bin, I have two files:
dminor$ cat bin/startvnc 
#!/bin/sh
sudo /Applications/OSXvnc.app/OSXvnc-server -rfbport 5900 \
> ~/Library/Logs/OSXvnc-server.log 2>&1 &

echo "VNC has started" 

dminor$ cat bin/stopvnc 
#!/bin/sh

sudo killall OSXvnc-server
echo "VNC has stopped" 
  • locally, run bin/startvnc and bin/stopvnc to make sure they are working properly and that they are firing off the osxvnc server
  • in ~/.bash_profile, just under my path, I put source ~/bin/startvnc and as the last line of the file, trap '$HOME/bin/stopvnc' 0
  • now when you start a terminal sesssion (locally or SSH), the vnc server will start.
  • verify in Sharing Pref Pane that the Remote Login service is checked and that you can SSH into the box.

Remote Network Setup

You’ll need to have port forwarding on the network’s router to the remote machine on port 22. As you’ll see below, there is no need to have VNC ports forwarded on the router.

Ease of Access via Hostname

It sure makes it a lot easier if you can SSH to a hostname that stays constant instead of having to determine the dynamic IP address of the remote machine each time. For dynamic IPs, I use dyndns.org to maintain a good hostname. For static IPs, I just setup an A record in the DNS zone file. Actually, if it’s a dynamic, I usually setup a CNAME record pointing to the dyndns hostname. And this works great on a local network too with bonjour.

Local Machine Setup

On your local machine, you need SSH and a VNC client. On OSX, I use Chicken of the VNC.

In my ~/.ssh/config file, I’ve setup entries for each remote machine like:
Host jkmini
  HostName jkwork.clients-domain.com
  Port 22
  Compression yes
  LocalForward 5901 127.0.0.1:5901
Now when I SSH jkmini, I get a terminal and vnc starts automatically. Here’s a sample session on the local network:
[dminor@ginger: ~]$ ssh sarahs-imac.local
Last login: Fri Dec 21 15:54:35 2007 from ginger.local
Welcome to Darwin!
VNC has started

[dminor@Sarahs-iMac: ~]$ ps aux | grep vnc
root     21718   0.0  0.2   196736   2680  p2  S     3:55PM   0:00.17 /Applications/OSXvnc.app/OSXvnc-server -rfbport 5900
dminor   21721   0.0  0.0    27812      4  p2  R+    3:55PM   0:00.00 grep vnc

[dminor@Sarahs-iMac: ~]$ logout
VNC has stopped
Connection to sarahs-imac.local closed.

In the case of a controlling a local machine (as above), I’d simply fire up Chicken of the VNC and connect to the hostname.local on the proper port (5900 here) and gain access.

On a remote session over SSH, you’ll see that we setup local port forwarding on the SSH session, so locally, port 5901 is being redirected to 5901 on the remote machine over SSH. I fire up Chicken and connect to localhost:5901.

Multiple Remote Machines That Share a LAN

I’ve also configured multiple machines behind the same router (therefore a shared public IP). I can attach to two machines on the same LAN at the same time over SSH with no problems. I may post that additional writeup one day.

I hope this is helpful and not too confusing.

Posted in , ,  | 2 comments

iTempted, iIndulge

Posted by Dave Minor Fri, 06 Jul 2007 18:24:00 GMT

Posted in , ,  | 1 comment

Airport Extreme Configuration with SpeedStream 4100 DSL Modem

Posted by Dave Minor Tue, 12 Sep 2006 21:44:00 GMT

I installed SBC DSL today and it was infuriatingly harder than it should have been. Several phone calls to tech support ended with them telling me that they could solve my problem, but I’d have to pay for that level of support—$69. I’m not going to pay that much out to some script reader who knows half as much about computers as I do. I just want his script.

Now I have it. and so do you. I was able to figure out the settings after some mildly helpful google searching. Kudos go to my brother Scott who admittedly knows less about technical issues than I do, but was able to help in the googling and the nudging in the right direction. Sometimes even a geek needs some brainstorming to point them in the right direction. on to the details:

BTW, if you stumbled here via a search engine and these settings helped you, please let me know that we “stuck it to the man!”

First, I set up the Speedstream 4100 to my MacBook Pro’s wired ethernet port and ran the installer. It connected to the net just fine. When I then plugged the modem into my Airport Extreme Base Station, it wouldn’t connect. Also, a note on the bottom of the SS 4100 says Advanced Confifuration on http://192.168.0.1/. I couldn’t connect to that address either.

The AE has as it’s default setting to use 192.168.0.1 as it’s LAN IP and use 192.168.0.2 through 191.168.0.200 for DHCP addresses. While still connected to the SS 4100 via ethernet, I turned off my Airport Card so that it would look on the ethernet card for 192.168.0.1 instead of over wifi. Tada! Now I could point my browser at 192.168.0.1 and got the SS 4100 configuration page. Using the access code on the bottom of the modem, I was able to access the Admin -> Connection Configuration page.

Following instructions found here on the topic, I changed the questions “Let LAN device share Internet address?” to No from the default Yes. This forces the modem to hand out LAN side IP addresses via DHCP which I believe the AE needs.

Next, I hooked the AE into the modem and turned my Airport Card back on on the MBP. Using the AirPort Admin Utility, I connected to the AE and told it to use DHCP for Internet. The major problem I was having was that the modem was holding 192.168.0.1 for it’s use, but the AE was also holding 192.168.0.1 as it’s LAN IP. IP conflict! Under the Network tab, I told AirPort client computers to “Share a single IP address” and changed the private Class C to 10.0.1.x. I’m fairly certain that after changing to this C, you can go back to “Share a range of IP addresses”, but I haven’t yet.

After updating the AE, everything started working properly. I’ll need to do some updating of machines and IPs on my LAN to take on the new IP scheme, but that won’t be too hard. I’m fairly positive that I could have left the AE to 192.168.0.x and changed the SS 4100 to use a different IP for admin, but I chose not to muck with the modem any more than I had to. and secretly, I had been wanting to change over to 10.0.x.x anyway.

Please let me know if this information is useful to you. How hard would it be for Yahoo to put out something to this effect??

Posted in ,  | Tags , , , , , ,  | 5 comments

Up For Air!

Posted by Dave Minor Fri, 30 Jun 2006 15:35:00 GMT

Whew! sorry it’s been a while. Things have just been insanely busy recently. and I don’t see anything letting up for a while.

Here’s some major things I want to note that have been taking up my excess time:

got a new macbookpro It of course Rocks! :) The conversion to it went pretty smoothly. I didn’t let the wizard transfer everything over because I hadn’t had a “clean” install since the pre-release of OSX I think.

went to RailsConf2006 It of course Rocked! :)

I’m not sure that I can share anything enlightening about RailsConf that others haven’t posted yet, but I loved getting to meet people that I had only talked to online. and meet new folks that I will now continue to talk with.

Especially enjoyed getting to meet in person Jason Perkins who I’ve know online for several years. “You Da Man!” for helping me out with a room when my original plans fell through!

The last news is late breaking. I finalized a deal this morning to purchase a 1977 Cessna 172 180hp conversion. I’ll get some pictures of the actual bird next week and post them. I’m pretty pumped. I’ve been looking at several airplanes and this one just completely Felt Right to me. There were pros and cons to all of them, but my gut feeling was very different with this plane. Which is weird since I’ve really been a pro-piper guy. Anyway, I can’t wait to start flying it.

Posted in , ,  | no comments

New Toy

Posted by dminor Thu, 13 Nov 2003 20:04:00 GMT

I got one—a bluetooth headset! Oh the joys of wireless cellular communication. The only wires in my phone world now are the rechargers. With all my bluetooth woes early on, I was trying not to get my hopes up for this to work. It worked like a charm. and most of the features work too, including some that depended on the phone. It will take some time to get used to the device on my ear—similar to wearing glasses. I almost had my left ear broken in, when I decided to change the position to my right ear. Now I’m working it in again. Hopefully things will remain smooth.

Posted in  | no comments

Sh! Listen. Yeah!

Posted by dminor Mon, 06 Oct 2003 22:38:00 GMT

The TiBook went under the knife this morning. Hopefully the awful noises I’ve been having will now be gone forever.

As an added benefit, it appears that my battery is lasting longer than before.

Posted in  | no comments

Cingular Questionable

Posted by dminor Mon, 29 Sep 2003 00:02:00 GMT

After having Sprint PCS for 5 years and never really having a problem, I had to switch when we moved since I couldn’t take/receive calls on my Sprint phone.

So we switched to Cingular. It’s been OK. However, this weekend, we were completely without service for about 36 hours on the GSM network. Argh! Appears to be back now.

Posted in  | no comments

Bad Apple, Genious!

Posted by dminor Sun, 28 Sep 2003 23:58:00 GMT

I’ve spent months with an intermittent noise coming from my TiBook. I have called AppleCare about it, taken it to the Apple Store on mulitple occasions. It simply wouldn’t make the noise while I was there.

Saturday morning, I took the train downtown and walked to the big Apple Store on Michigan. They first really blew me off. I sat at the genious bar taking up precious stool space on a busy weekend morning.

When I first arrived, I told the “genious” that the fan between the power button and right speaker was going out. He laughed at me and said there was no way sound could come from that space and that it was funny how people could hear sounds coming from places that couldn’t make noise. He wanted to take my machine and “check it in.” I laughed and muttered some stuff under my breath.

So when it started whining, I called over the other genious who had seemed like he would be more helpful. So the scoop is: There is a fan there. It is going bad. I still have my machine to work on until the part comes in. And genious’ aren’t always so bright.

Posted in  | no comments

Way to Go Apple!

Posted by dminor Sun, 14 Sep 2003 03:22:00 GMT

With my previous PowerBook, if I accidentally disengaged the battery while pulling it in or out of the carrying bag, I was in big trouble. Not only did I have to restart the machine, I had to while plugged in to the wall which was a problem in that I don’t always carry my power adapter.

Something I have noticed with my TiBook is that when the battery becomes disengaged, it doesn’t require plugging in to the wall to recover. Not only that, but it doesn’t crash either! Let me repeat that: removing the battery from the laptop while in sleep mode doesn’t crash the machine.

Now I’m not advocating that you should go removing the battery from your sleeping PowerBook to test this, but on a couple of occassions, my machine has woken from sleep after the battery goes flying across the room. Go Figure. Can your laptop do that?

Posted in  | no comments

Blue in the Face!

Posted by dminor Thu, 14 Aug 2003 06:42:00 GMT

My bluetooth woes are over for the most part. To test failure at the usb bluetooth adapter, I purchased another adapter tonight and it paired with my phone immediately!

Life is good for the moment, except that I now own two bluetooth adapters, but no more dialing phone numbers that should be in my phone already!

Now if only I could get a bluetooth headset to work like that…

Posted in  | no comments

Older posts: 1 2