I'm having problems when running vncserver with "sudo" or "su".
A VNC Server session (like any other graphical application) should never be run with "sudo" (or even with "su"). To run any graphical program as root, it is generally safer to use "gksudo" (under GNOME) or "kdesudo" (under KDE).For VNC Server, it is better to run it from a root login shell. The commands "sudo su -" or "su -" can be used to start such a shell, and then vncserver can be run safely from there.
The problem is that some of the user's environment is preserved by a plain "su" (without the '-' ). This can cause problems when an application runs as root, but writes files in the user's own home directory.
To restore ownership of all files in the home directory (hopefully fixing the problem), run this command as root:
chown -R user /home/user(replace both "user" occurrences with the actual username)
From then on, avoid running VNC Server directly with "sudo" or "su"; always add the dash '-' as described above.
Related Articles
No related articles were found.Attachments
No attachments were found.Visitor Comments
Article Details
Last Updated
12th of December, 2011
