Enable VNC from the Command Line on Mac OS 10.6
January 31, 2010
Julia’s Mac Pro has been failing randomly as of late. For a while, I suspected the RAM. After having swapped out all the sticks in all possible configurations, several hours of other diagnostics, and a few angry words, it appears that the video card is what is at fault; Without the video card the computer appears to work correctly (it’s too early to know for sure). Unfortunately it’s quite difficult to run Photoshop from an ssh session so I needed to get VNC (Apple Remote Desktop) rolling from the command line.
Disclaimer: The options I used are insecure. Please see the help output below for all possible options.
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/\
Contents/Resources/kickstart \
-configure \
-allowAccessFor -allUsers -privs -all \
-clientopts \
-setvnclegacy -vnclegacy yes -vncpw mypass \
-restart -agent -console
The basic rundown of the flags: enable access for all users with all available privileges, use legacy VNC, set the VNC password to “mypass”, and restart the agent and console.
You should be able to access the computer via VNC. I use Chicken of the VNC.

Help Output
Help output is accessed by passing kickstart the -help flag:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/\
Contents/Resources/kickstart -help
Add your comment
No HTML; Only URLs and line breaks are converted.
Comments
This doesn't actually START the service if it isn't running though, it only configures it - or am I missing something?
Posted by Rob
It does start the service. The -restart flag will start the service even if it is not currently running.
Posted by Jared Kuolt