How can a Mac running El Capitan always be ready for a VNC connection even after a reboot?

I can vnc into the Mac with no problem but when I reboot the Mac remotely I can't vnc back in. Someone has to hook up a keyboard to the Mac and physically log in and log back out. Once the machine has been logged in locally I can once again log in remotely via Mac.

I'm using the Mac's built-in VNC as well as an installed RealVNC server. Neither will respond after a reboot.

I edited the RealVNC launch daemon to run at load but that didn't work.


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. Someone would still need to manually login with a keyboard in those cases.

The options at this point seem to be to disable Filevault or accept the fact that a person will need to login occasionally.

  • What version of mac mini is it?
    – mmmmmm
    Apr 5, 2016 at 13:32
  • el capitan. Its a new mac mini.
    – coder
    Apr 5, 2016 at 13:33
  • You can set up the Mac to automatically login to a user account at startup. Would this be a OK solution? Apr 5, 2016 at 13:42
  • 1
    After looking into setting up auto login I noticed filevault was turned on. The solution seems to be to reboot with sudo fdesetup authrestart. superuser.com/questions/1024687/…
    – coder
    Apr 5, 2016 at 15:05
  • 1
    Correct. FileVault encrypts the whole file system. There's no VNC service to run or any way to know to run it without unlocking the disk.
    – samh
    Jul 15, 2016 at 14:02

5 Answers 5


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.

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.

  • Thanks @Édouard - I've added two Apple options as well as the edovia third party program
    – bmike
    Apr 5, 2016 at 17:00

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

  • 4
    I love the resistor image. Well done +1 and some more good karma. Also, Apple officially supports headless mode on Mac Mini - so you can file bug reports if you find a case where you can't manage a headless mini without needing a dongle or adapter. I've never needed those unless you want a different initial screen resolution based on "detecting" a connected screen.
    – bmike
    Apr 5, 2016 at 15:11
  • You don't need the VGA cable though. Just plug the resistor between pins C2 and C5 in the DVI directly. apple.stackexchange.com/a/352101/40801 Feb 22, 2019 at 7:51
  • And nowdays (2022) it is finally possbile to do everything software-wise again: github.com/waydabber/BetterDisplay
    – Sascha
    Aug 11, 2022 at 13:49

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


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

Disable file vault on your startup disk, move sensitive data to another volume, and encrypt it with FileVault or some other means. I think in that case MacOS does not require a password before the OS loads.


If you want to remotely restart the machine without having to specify the user then you can specify an input file in the form of a plist. Do the following steps on the computer that you are remoting into:

  1. First you need to create a plist file that will have your credentials, open up a terminal window and paste the following: touch ~/.restart.plist. Now open up that plist file in a text editor and paste the following:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
  2. Replace USERNAME_HERE and PASSWORD_HERE in the file above with your credentials and save the file.
  3. Create an alias in your bash profile so that all you have to do is type reboot and it will do the rest for you. Open up your ~/.bash_profile in a text editor and add the line alias reboot="sudo fdesetup authrestart -inputplist < ~/.restart.plist" then save the file.
  4. Close and reopen your terminal window, or type in source ~/.bash_profile in order to update your alias to match the bash profile.

Now you'll be able to restart your remote computer with a specific user just by typing reboot into your terminal!


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .