Saturday, September 5, 2009

Connecting to Mac OS X via VNC

In the entirety of my house, I happen to be the only Windows user (and an Avid one at
that!  Macintosh can suck my Windows 7 Orb!), but for some occasions I too wish I could use the Macintosh. 
For such things as the local web server, and in the future possibly making iPhone applications.

I don’t like going downstairs to use the best non-laptop Macintosh.  Its hooked up to a High Definition
Projector system, and it is simply a burden to try to get anything code-wise with it done, without either
sitting up close to the screen, or using Apple+ to make it larger, so, I did what any geek would attempt to
do.  Get Apple’s Screen Sharing system working with my Windows Box.

href=""> alt="Mac vs. PC - Best of both Worlds?" width="500" height="313" />

I have
to be honest with you.  It was a hassle and it was definitely NOT worth it. 
Regardless of client side settings, VNC was incredibly slow over the Local Network.

as some of you may wish to try this yourself, I’ve included the instructions after the break.


I actually registered on this forum just to post this solution. I hope it will
make many others happy!

Motivation for going through these hoops:
I needed to
access the desktop of an old OSX machine every now and then from a windows VNC client. Details of that
machine are:
Dual G5 OSX 10.4 without monitor/keyboard.


Remote Desktop had never been enabled before on that machine.
- SSH access however was available.

how do you turn on Apple Remote Desktop / VNC Server on a machine where it never ran before? That part was
easy to find on the net: SSH as an admin user onto the OSX machine. Then execute this command:

/System/Library/CoreServices/RemoteManagement/ -activate -configure
-access -on -users admin -privs -all -restart -agent

Try to connect with your VNC
client now. If it works, good, you're done. The above command takes care even of restarting the Remote
Desktop Service when the computer is rebooted.

But if you're not so lucky (like I was)
and the connection fails with a message like:
- "Server did not offer supported security type"
- "No matching security types" (realVNC)
- "Incompatible Version" (UltraVNC)

stuck. What happened in this case is that the VNC password has never been setup properly. Follow these
simple steps while still logged in as admin user to set up a default password ("pass" in our case):

Switch off RDP:
/System/Library/CoreServices/RemoteManagement/ -stop

Go to the Preferences directory:
cd /Library/Preferences

- edit the following
files using vi (if you're not familiar with vi, be very careful to follow the instructions to the iota!):

Put the following lines into this file (hint: copy
them from here rather than typing them). Instruction for vi newbies:
- copy the text below into
your clipboard
- set focus to the ssh window
- press the 'i' key. This puts vi into text
insert mode
- paste the text. If you're on windows/cygwin, click to top left of the cygwin ssh
window -> Edit -> Paste
- press the 'Esc' key
- enter the keystrokes
':wq', colon tells vi you are about to enter a command, w is the command for write, q for quit.




edit the file sudo vi
press the 'i' key and type enabled, hit
return, 'Esc' and ':wq'

- set the default VNC password to 'pass' by editing this file:
and copy/paste this string (the encoded password) into that file:

- Now the files need to have their ownerships and
access rights configured properly. Do this by executing the following commands after each other:

chmod 644
sudo chown root:admin

chmod 644
sudo chown root:admin

chmod 400
sudo chown root:wheel

stop and start the Remote Desktop Server, or reboot the machine:

To just restart the
Remote Desktop first stop it:
/System/Library/CoreServices/RemoteManagement/ -stop

restart it:
/System/Library/CoreServices/RemoteManagement/ -activate -configure
-access -on -users admin -privs -all -restart -agent

or, alternatively, reboot the

sudo shutdown -r now

Connect to the server and enter your
password we set to "pass" above. Set the password to something else by opening the System Preferences ->
Sharing -> Apple Remote Desktop -> Access Privileges and set the password in the "VNC viewers
may control the screen with password:" to something else.


this helped!


Balt Indermuehle


1 comment:

  1. VNC is no doubted, a quality remote support tool. Additionally, one may even consider
    using other remote support tools such as logmeinrescue, gosupportnow, GoToMyPC etc. or deploying on premise
    remote support appliance such as RHUB or Bomgar appliances.