2

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?

Hippyjim
  • 175
  • 3
  • 8

1 Answers1

3

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.

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