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

Contextual Spelling

Posted by Dave Minor Tue, 01 May 2007 18:18:00 GMT

I can’t believe I haven’t noticed this before and I don’t know to what extent it works. In some apps (mail.app, safari forms except this one that I’m filling out), if you right click on a word, there will be alternative suggestions of the word available. I also hadn’t noticed the “look up in dictionary” option.

I have used the Esc key to show me suggestions, but that doesn’t work in all apps either. I’m really not sure why the right click won’t work in this form field while it did on another site.

Maybe someone will comment on when and how this works.

Posted in  | no comments

No Audio in Some Apps

Posted by Dave Minor Sat, 31 Mar 2007 03:46:42 GMT

for my future reference (since this has happened to me a couple of times and it always takes me a long time to determine what the problem is):

Mac OS X: No audio from certain multimedia content

Posted in  | no comments

Scroll QT Frames

Posted by Dave Minor Thu, 15 Feb 2007 00:02:33 GMT

I just stumbled across this accidentally and thought it was cool. When pausing a QuickTime video, the scroll wheel on my mouse advances the movie by frame in both directions.

what would call negative advancing? advancing and departing, no. advancing and de-advancing, hmm. shuttling by frame in both directions!

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

Spam, not just for lunch anymore

Posted by Dave Minor Mon, 28 Aug 2006 15:53:00 GMT

Tim Bray says:
I don’t know about you, but in recent weeks I’ve been hit with high volumes of spam promoting penny stocks. They are elaborately crafted and go through my spam defenses like a hot knife through butter.

I feel your pain Tim. I, too, have been hammered with spam in recent weeks. I actually spent a good part of the day Friday tweaking my spam settings to try to pick up more. I think I did some good. For most of Friday, Saturday, and Sunday, very few messages made it to my mail client. Then this morning, there were a dozen or so. :(

Posted in ,  | no comments

Fix for No Audio from Some Apps

Posted by Dave Minor Thu, 24 Aug 2006 03:06:12 GMT

I’m not sure why it took me this long to find a fix for this problem. Lazy I guess. Since I got my Macbook Pro, I have had problems with some apps (flash and quicktime specifically) being silent. I could see video, but no audio.

I finallyl googled it tonight and found the solution. So here it is for anyone who comes across it:

http://docs.info.apple.com/article.html?artnum=300832

Posted in  | no comments

Monolingual, But Not Rosetta

Posted by Dave Minor Mon, 07 Aug 2006 21:38:00 GMT

Over the weekend, I ran Monolingual 1.3.3 to remove some unused pieces of my MacBook Pro system to free up a little disk space.

Things started going badly. Like installing system upgrades (Security Update 2006-004) would fail and some applications like Quicken would not launch.

About the time I started doing an archive and reinstall, I remembered running Monolingual. I pulled up their site and sure enough in their FAQ, it mentions not deleting the PowerPC architecture stuff on an intel box. Great!

The good news is that I’m thinking that after the archive and install, I’ll be in pretty good shape with just a few applications needing to be copied from the backup (my SuperDuper! backup was of course hosed too).

My hope in blogging this is that someone will either NOT remove the PowerPC architecture stuff on their intel mac or help them in fixing the problem afterwards. This is a lot less dismal than reinstalling each application by hand due to a “master level directory structure corruption” which is what Apple diagnosed it as.

It all could be fixed if they would just let us choose which languages we wanted to install from the beginning.

Posted in ,  | 2 comments

/usr/local/bin: Not a directory

Posted by Dave Minor Mon, 16 Jan 2006 17:44:34 GMT

Here’s an FYI for anyone who runs across this. It’s really pretty straight forward but had me spooked for a minute.

I was installing an app from source. When I ran sudo make install, I didn’t get an error, but I also didn’t have anything in my /usr/local/bin directory because it wasn’t a directory at all, but a single file.

This freaked me out at first because I compile a lot of things from source on my main box, but this was on a different box. I had /usr/local and /usr/local/lib directories intact. I went to a completely fresh install of Tiger and noticed that /usr/local does not exist out of the box on Tiger. The Tiger box I was having problems with was not a fresh install, but an upgrade from Panther.

My hypothesis (which turned out to be correct) was that the make had run a $ cp package_bin /usr/local/bin, but since there wasn’t a /usr/local/bin already created, it just copied my binary to a file called bin in /usr/local.

To test this, I did:

    $ sudo mv /usr/local/bin /usr/local/bin.old
    $ sudo mkdir /usr/local/bin
    $ sudo make install

Then I compared the file sizes of /usr/local/bin.old and /usr/local/bin/package_bin and found them to be identical in size. That led me to conclude that my hypothesis was correct and now everything works nicely.

Hopefully this will help someone in their attempt to install apps from source who are having trouble with ”/usr/local/bin: Not a directory” issues.

Posted in  | no comments