On 10.04 LTS I was able to run vnc4server on display :1 and get a new desktop. This was great as I could work from home without people seeing what was on my screen (:0 was in a "locked screen" state).

When replicating this on 12.04 LTS I just get a blank desktop and have not been able to find out what the difference is?

Anyone else experienced this, or has anybody else got a VNC setup where you can connect to a screen other than the one which is display :0?



Had same problem. Couldn't find a solution online. Here is what worked for me. (assuming you already have Gnome installed)

My xstartup file:


# Uncomment the following two lines for normal desktop:
# exec /etc/X11/xinit/xinitrc
gnome-session –session=gnome-classic &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

I added:

gnome-session –session=gnome-classic &   

and uncommented:


Also modified $defaultXStartup section of /usr/bin/vncserver so that the default xstartup is the same as above:

    = ("#!/bin/sh\n\n".
       "# Uncomment the following two lines for normal desktop:\n".
       "unset SESSION_MANAGER\n".
       "# exec /etc/X11/xinit/xinitrc\n".
       "gnome-session –session=gnome-classic &\n".
       "[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup\n".
       "[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n".
       "xsetroot -solid grey\n".
       "vncconfig -iconic &\n".
       "x-terminal-emulator -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n".
       "x-window-manager &\n");

And that did the trick for me!

  • This the only answer in the entire internet that works for me! – Vasilis Jun 23 '15 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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