I've set up my Raspberry Pi to work without a monitor, and I access it via VNC.

The menu doesn't give me a shut down option any more, so I have to shut down via command line.

When I plug in a monitor I'm able to shut down via the menu - how can I enable shut down over VNC?

1 Answer 1


You cannot.

The X session that you see is running in user space. You will need privileges to shutdown. If you start an X session using xinit or startx, it will not allow you to shut down either. You may only logout (xfce). If you start an x session from a display manager like gdm, lightdm, xdm, mdm etc, the X session is running with some privileges. command line is the best you can do.

Alternatively, you can write a script with gksudo poweroff It shall ask you for your password and shall proceed with the shutdown. You can place a shortcut on the desktop or as an applet in your taskbar.

  • 1
    Also, if you don't want to enter your password each time, you can add an entry to the /etc/sudoers file.
    – Thomas
    Commented Feb 20, 2013 at 15:36
  • As suggested- making a shortcut is the simpliest. What OS are you using ?
    – guyd
    Commented Sep 4, 2017 at 4:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.