In your terminal type the following command to launch VNC server to create an initial configuration file:
vncserver :1
Open the configuration file in vim:
vim ~/.vnc/xstartup
Press the ‘i’ key on your keyboard to get into the insert mode which will allow you to enter text into the file. Edit the file to look like so :
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
After you’re done, enter ‘Ctrl + :’ and type ‘wq’ to save and quit the file.
Great! We’re almost done with the configuration. Now, let’s restart the VNC server by killing it first and then starting it up.
To kill the vnc server and start it again, type the following command:
vncserver -kill :1
vncserver :1
Congratulations, you’re done with the configuration for Ubuntu Desktop.