i am trying to use vnc on ubuntu 13.04 but I am unable to get full desktop. SO far what I have got is a error message that says "Failed to load session ubuntu-2d", or a blank screen or a desktop background with no shortcut icons or a desktop background with only a terminal window and no icons, with different changes in code. I want to have a full desktop view with toolbars and launcher, for all the functionality I need. I have the xstartup file [ both for user and root ] as
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
#exec /etc/X11/xinit/xinitrc
[ -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 &
gnome-session --session=gnome-classic &
But its showing only a blank screen and the error message. Any ideas how to solve this?
Also I am running Ubuntu on my machine using Oracle VirtualBox, can that be a part of problem?
Best Answer
I think you should be using x11vnc. I've tried
vnc4server
andtightvnc
, neither worked well.Difference between x11vnc and traditional Unix VNC. x11vnc interacts directly with physical displays.
Install x11vnc
sudo apt-get install x11vnc
Create VNC password
x11vnc -storepasswd
NOTE: defaults to
~/.vnc/passwd
file. Alternatively, usevncpasswd
or-storepasswd
pass file Store password pass as the VNC password in the file file. Once the password is stored the program exits. Use the password via "-rfbauth file
". If called with no arguments, "x11vnc -storepasswd
", the user is prompted for a password and it is stored in the file ~/.vnc/passwd. Called with one argument, that will be the file to store the prompted password in.Start x11vnc
Change the VNC port to listen on
The VNC port to listen on (a LibVNCServer option), e.g. 5900, 5901, etc. If specified as "-rfbport PROMPT" then the x11vnc -gui is used to prompt the user to enter the port number.
This force x11vnc to use port 5901 (this is VNC display :1.)
If something else is using that port x11vnc will exit immediately. If you do not supply the
-rfbport
option, it will autoprobe starting at 5900 and work its way up to 5999 looking for a free port to listen on.Send x11vnc to background
Go into the background after screen setup. Messages to stderr are lost unless -o logfile is used.
VNC password file
The option
-rfbauth .vnc/passwd
provides additional protection by requiring a VNC password for every VNC viewer that connects. Thevncpasswd
orstorepasswd
programs, or thex11vnc -storepasswd
option can be used to create the password file.x11vnc
also has the slightly less secure-passwdfile
and-passwd XXXXX
options to specify passwords.