Installing VNC Remote Desktop on Ubuntu Linux VPS
I have a linux Ubuntu 8.10 VPS that I would like to have GUI and use it as remote desktop pc just like what we can do with Windows XP. Here are the steps that I run.
1. Most of the VPS that delivered by VPS hosting provider is minimal setup of linux, it means that most of the time it only have SSH server installed and the other services such as HTTP server, FTP server, Mail server must be installed by our self. The default setup of VPS linux also doesn’t have window manager (GUI) hence we must install it first:
sudo apt-get install ubuntu-desktop
2. Configure the Gnome Desktop Manager and XServer
sudo /etc/init.d/gdm start sudo dpkg-reconfigure xserver-xorg
3. After we installed a window manager, next step is to install the remote desktop server, for linux we use TightVNC
sudo apt-get install tightvncserver
4. Next we need to configure the remote desktop server and create a password to access the VPS via its GUI. This command will start the server, you will be asked for a password, this password will be used as authentication when you connect to the VPS, make sure you have a strong password.
vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565
5. Now, if you execute command
ps auxYou should see an Xtightvnc process:
Xtightvnc :1 -desktop X –auth
This means the setting is OK and VNC server is running fine.
6. The default VNC server doesn’t use Gnome window manager as default, to run Gnome as default we must do some changes on the configuration file.
sudo nano ~/.vnc/xstartup
Comment "x-window-manager" and add this on the end of file:
gnome-session &
so it will look like this:
#!/bin/sh xrdb $HOME/.Xresources xsetroot -solid grey x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & #x-window-manager & gnome-session &
7. Next, do a reboot. Usually a reboot is not needed, but just to make sure you can do it.
sudo reboot8. Start the VNC server:
vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565
9. Download Tight VNC client here: http://www.tightvnc.com/download.html
10. After you install it, run the VNC client and insert your VPS IP address and VNC server number on the VNC Server field and click on “Connect”. In this tutorial the VNC server number is :1, so you must fill in :1

You will be asked for a password to access the remote desktop, this password is the one you set on step 4.
August 4th, 2009 - 11:14
Amazing!! thanks for the walkthrough! make my night!!
October 25th, 2009 - 01:35
This is certainly the most straight forward description I have seen. It worked for me first time, thanks!
November 26th, 2009 - 08:37
Please can you do a rtorrent tutorial i’m begging YOU
November 26th, 2009 - 15:17
@mysoogal I will check on it
November 28th, 2009 - 14:40
Thanks for a straight forward and simple guide!
Cheers
January 5th, 2010 - 08:05
This quick little throw away kludge worked for me;
#!/bin/bash
#Install X
sudo apt-get install ubuntu-desktop
#
#startx
sudo /etc/init.d/gdm start
#
#Configure xserver
sudo dpkg-reconfigure xserver-xorg
#
#Install tightvncserver
sudo apt-get install tightvncserver
#
#Start vncserver to test
sudo vncserver :1 -depth 16 -pixelformat rgb565
#
#Verify server is running
ps -ef | grep Xtightvnc
#Kill vncserver and reboot
sudo tightvncserver -kill :1
#
#Switch vncserver Window Manager to Gnome
sudo sed -i “s/x-window-manager/gnome-session/” /$HOME/.vnc/xstartup
#
#Get viewer message
echo “Get vncviewer from here; http://www.tightvnc.com/download.html”
#
#Reboot
echo “Will reboot in 5 seconds, ctrl-c to exit.”
sleep 5
sudo reboot
February 5th, 2010 - 07:08
Cheers Markus, Haven’t tried your source above yet, but looks promising!
February 24th, 2010 - 05:36
I found your tutorial very thourough, but I am lost already on instruktion 2.
When I write sudo /etc/init.d/gdm start I get:
sudo: /etc/init.d/gdm: command not found
I have googled this, but fail to find a next step forward. Any ideas here?
Thanks
February 24th, 2010 - 06:24
what ubuntu version do you have? desktop/server? 8.x/9.x?
installing ubuntu-desktop meta package should install gdm also
can you try run:
cd /etc/init.d
sudo ls
March 5th, 2010 - 14:10
use the –fix-missing option in the first command.
sudo apt-get install ubuntu-desktop –fix-missing
March 5th, 2010 - 14:08
Very useful, worked a treat! Thanks.
March 24th, 2010 - 08:15
Bless you sir, this worked quite well.
April 2nd, 2010 - 02:14
Hey, great tutorial. Im using Ubuntu 9.10 (Karmic Koala) and am having some trouble with the gdm starting and Xserver. Also it doesnt seem the tightvnc was included on the basic installation. when i try to install it, says that its not found. Any ideas? it would be much appreciated.
Thanks, Jeff
April 3rd, 2010 - 20:52
tightvnc seem no longer in Ubuntu’s standard APT repo. you either have to search for another repo to install using apt-get or install it by compile it from source code.
July 10th, 2010 - 03:26
actually the package of tightvncserver is available on “universe” add this to your /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu hardy universe
deb-src http://archive.ubuntu.com/ubuntu hardy universe
deb http://archive.ubuntu.com/ubuntu hardy-updates universe
deb-src http://archive.ubuntu.com/ubuntu hardy-updates universe
June 7th, 2010 - 00:25
how do you fix the keybord i cant get it to work
June 7th, 2010 - 08:22
see my other post: http://markus.revti.com/2009/11/ubuntu-9-04-keyboard-mapping-problem-on-tight-vnc/
June 27th, 2010 - 23:35
Hello , everything gone smoothly but now when trying to connect , everything goes fine but we get gray screen , see it here http://img17.imageshack.us/img17/203/blacktc.jpg
can you help , please?
June 28th, 2010 - 00:44
what virutalization do you use?, how much RAM does your VPS have? what ubuntu version do you use? does the Gnome installation went smooth?
June 28th, 2010 - 02:34
the VPS is on Veportal , I think everything went smooth yes , i would really be thankfull if you could help :(
June 28th, 2010 - 02:47
sorry , the VPS has 1.5GB ram ubuntu version is 8.10 but updated it before installation as it needed that
June 28th, 2010 - 03:14
have you done step 6:
6. The default VNC server doesn’t use Gnome window manager as default, to run Gnome as default we must do some changes on the configuration file.
sudo nano ~/.vnc/xstartup
Add this on the end of file:
gnome-session &
June 28th, 2010 - 03:32
i tried that but in SSH was giving me error That not a valid comand sudo nano
so i did vi ~/.vnc/xstartup then edited the file and added that , that was the only thing im not sure if i did correct , but sudo nano ~/.vnc/xstartup won’t work , says Invalid command , i would really be very thankfull if take a minute and login to SSH and see if i did that correctly
June 28th, 2010 - 03:34
this is what i get when loged in with TightVNC
img687.imageshack.us/img687/9391/blackpe.jpg
June 28th, 2010 - 04:22
can you look at the vnc server log file? and see if there is an error message. big chances that your vps is hitting its limits as veportal use openvz and openvz vps always having problem with soft limits, see /proc/user_beancounters to check it.
June 28th, 2010 - 04:19
that means you don’t have nano (text editor) installed, i like nano better that vi as it’s easier to use.
apt-get install nano
that should install nano and and you can run nano ~/.vnc/xstartup
June 28th, 2010 - 05:10
Hi Markus , I cheked everything is ok , and re did all the steps you said the only thing i dont see is ( Xtightvnc :1 -desktop X –auth ) when i excute ps aux , any idea?
June 28th, 2010 - 10:03
Man Thank you! the vps is from http://host90.com we contacted them and they did a fresh install woopa we now can access the graphical interface!
June 30th, 2010 - 01:38
Good to hear, if you need a Xen based VPS you can contact http://www.halfdedi.com
June 30th, 2010 - 01:56
Thanks a lot for this.