# Restart VNC service REMOTELY!



## RoadKingRick (Jul 31, 2009)

You may never need this, but if you do, it is the best trick ever.
I administer my XSERVER remotely via the built in Apple VNC.  However, the VNC service occasionally crashes, and locks my session. It also refuses any more VNC logins.  This is particularly frustrating when I am off site! Apple has analyzed this and has no explanation or fix.
BUT!!
One talented and determined technician came up with this magic workaround.  If SSH access is enabled on the server, you can connect to the server via an SSH client (PUTTY is great for Windows clients),  and run this command:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent

You must log in with admin rights, and must enter the admin password again to run the command.  It can take a minute to run. After it finishes, VOILA! you can login again via VNC.
Believe me, this is a Godsend if you need it!


----------



## Giaguara (Aug 16, 2009)

Yep - and there are even more options you can play with remotely once you kickstart ARD: http://support.apple.com/kb/HT2370?viewlocale=en_US


----------



## atkinsonde (Nov 12, 2010)

RoadKingRick - This is a neat trick. Every once in a while the VNC server goes down, just as you say, and I am permanently off site (I run daily display monitor updates for the place I used to work) and so would have to call the teck to go and reboot!! I appreciate you taking the time to post this.
- David


----------



## Giaguara (Nov 13, 2010)

And that Apple KB is worth bookmarking for everyone who needs to remote control a server or wants to remote log in or control their (client) system remotely.

The use of kickstart to restart ARD or VNC services on the remote Mac system isn't limited to Mac OS X Server, it also works with the clients, as long as remote login is enabled. It has saved me countless steps...


----------



## eli5 (Mar 28, 2018)

Almost 9yrs later and this thread is still giving!

Just registered to say a massive thank you.


----------

