Apple - Remote into Mac Mini after a reboot

Apple supports this out of the box. Under the Sharing preference pane you need to enable either the Screen Sharing or the Remote Management and then use the Computer Settings dialog to enable VNC.

enter image description here

The service starts up automatically when incoming network traffic on the VNC ports is detected by the OS. Now, you do need to get past any FileVault pre-login screen where the full actual OS isn't running yet. To restart and skip FileVault one time, use:

fdesetup authrestart

You might need to watch for DHCP traffic and see if the Mac is rejoining the network and asking for an address from the router if you can't find the machine on reboot. For troubleshooting, you could assign a static IP address so that you're sure it's not a DHCP issue.

The problem also could be your choice of VNC client and it's not expecting to connect to OS X Lion or newer. Some older clients break when Apple allows a choice to connect to the logged in user or a new login window. The client needs to reconnect once the session drops to log you in.

  • Are the changes to Lion's screen sharing documented anywhere publicly?
  • RealVNC on Lion

One client I like on iOS and Mac OS X is http://edovia.com/screens/ Of course Apple's free Screen Sharing app (look for it in /System/Library/CoreServices/Applications ) and Apple Remote Desktop work well, too.


VNC is tricky to use on a headless system. The way it works is that it queries the display server to get the settings so VNC can send those settings to the viewer. If nothing is connected, no parameters are sent and thus the viewer has no idea what to display. This is why I am not a fan of VNC or ARD and will only use it if I absolutely have to (95% of everything I do on headless systems is in Terminal, so this doesn't come up very often for me)

This is why you have to hook up a monitor to get screen sharing to work again. If you leave the monitor attached, VNC will work with no problems across reboots

Trick OS X into Thinking a Display is Still Attached

The easiest thing I have seen that solves this problem is getting a Dummy Display Emulator. It's clean, it's easy, and it works out the box. What it does is make OS X think a monitor is still plugged into the display so whatever settings you have configured for that "monitor" will be sent to the VNC viewer.

enter image description here

You can make your own but to me, this is not safe and very sloppy for a permanent installation. I included this option both for reference to see what is being done here (how easy it is) and to provide another option if you are in a pinch. Again, I am not a fan of this DIY hack because it's not clean and if you don't have the mDP to VGA adapter or the resistor you will have to purchase them anyway and you might only save a couple of bucks over the commercial product.

You could read the linked blog on how to do this, but the picture below alone should tell you what to do, what Apple display adapter you need, and what resistor to buy based on its color codes.

enter image description here


The solution to the problem ended up being three-fold.

The mac has filevault turned on. 'sudo fdesetup authrestart' will work with a manual reboot. It will not work however with a forced system reboot or a power outage.

  1. .bash_profile a command alias to 'sudo fdesetup authrestart'. I used 'reboot'. Now from the terminal I can type 'reboot' to property restart the system.
  2. Use a UPS for power outages

UPS

  1. If VNC becomes unresponsive ssh into the box and reboot via 'sudo fdesetup authrestart'