I am doing some hardware development and I need to run my apps as root to access the low level hardware on my pi 4. I do my development over VNC and the default VNC user is 'pi' rather than root. How do I set up a vnc server that uses root rather than pi?

1 Answer 1


You do not need to do that. This would imply that the desktop runs as root, which might be possible, but is neither desirable nor really useful. VNC just shows the remote desktop for whichever user is logged in there (pi by default). This has nothing to do with who's running a particular application, though. You can always run any application as root by calling it using sudo. Or do sudo -i to get a root shell.

  • And extra tip: With everything up-to-date, you should not need to run anything as root to access gpio, spi or i2c busses.
    – PMF
    Sep 27, 2020 at 19: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.