Fast Screen Sharing with Quicksilver Enable Screen Sharing from the Terminal in Leopard
Feb 29

VNC GuestDigging around in a NetBoot-Install.dmg file created by NetRestore Helper, I found a nice little gem.

In Leopard, and perhaps earlier versions of Mac OS X, we’re able to start a VNC server with the machine serial number as a password. This is particularly interesting for a managed network or lab environment.

As an example, I’m starting a VNC server in my NetBoot-Install image with the following shell script:

# Credit to Mike Bombich for this snippet

VNC="/System/Library/CoreServices/RemoteManagement/AppleVNCServer.bundle/Contents/MacOS/AppleVNCServer"

if [ -x "$VNC" ]; then
    "$VNC" -noRegister -serialNumber &
fi

I’m then able to quickly connect with Cmd+K in the finder:
Connect to Server

If you’re scripting this, here’s a quick way to snag the serial number. I do this before I bless a client machine to netboot, so I have the serial number to connect back up once it’s in the NetRestore system.

system_profiler SPHardwareDataType | \
  grep -i 'serial number' | \
  perl -ple 's/.*:\s+(\w+).*?/$1/'

3 Responses to “Leopard VNC Server Serial Number Password”

  1. Lolopb Says:

    Thanks.

    Not that I don’t like Perl but I find it a little bit too much to get just a piece of info, awk does it very well :

    awk ‘{print $3}’

    in your case.

    ioreg is nice also to get the informations but needs more handling to really get what you need.

    Finally, If you have Admin Tools installed, just use /System/Library/ServerSetup/SerialNumber. It will output the first 8 characters of the serial number.

  2. Jeff McCune Says:

    Lolopb,

    Great information. Thanks for posting!

  3. Clay Caviness Says:

    And since you’re using awk, get rid of the unneeded grep:

    awk ‘/Serial/ { print $3 }’

Leave a Reply