blank screen with vnc server

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?

Thanks


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

My xstartup file:

#!/bin/sh

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

[ -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 &   
gnome-panel&    

and uncommented:

unset SESSION_MANAGER   

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

$defaultXStartup
    = ("#!/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".
       "gnome-panel&\n\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!