Do you want a graphical environment (GUI desktop) on your VPS server, just like on your computer at home or at work? This can be done!
This tutorial is just about how to install a graphical environment (GUI) on Linux VPS server and VNC server to let you connect to your VPS GUI desktop from your computer and to use VPS server as a desktop computer, run Firefox, Openoffice and other programs. Also, you may check our other tutorial about very good Gnome Desktop alternative LXDE which is more suitable for a low RAM configurations (lower VPS plans) here: LXDE Desktop installation tutorial
For GUI desktop installation we choose minimal Ubuntu 10.04 or Ubuntu 10.10 OS version.
Since Gnome XWindows GUI will use alot of RAM, it is recommended to choose at least VPS3 or bigger plan with 1GB or more RAM.
Or you can choose Gnome alternative - LXDE Desktop (recommended) which runs even in VPS1 plan with 256MB RAM and you can find LXDE installation tutorial here: LXDE Desktop installation tutorial for low RAM usage
Reinstall your VPS with minimal Ubuntu OS and log in to your VPS server ssh command line as “root”.
1) Preparation of empty VPS server for GUI installation:
Uninstall and remove all unnecessary services (if really not needed):
root@server:~# apt-get purge apache2* bind9* samba*
Update existing packages:
root@server:~# apt-get update
root@server:~# apt-get upgrade
Install text editor “nano”:
root@server:~# apt-get install nano
2) GUI desktop installation:
root@server:~# apt-get install ubuntu-desktop
Choose console country from the list, for example.: USA
Select keyboard layout, for example.: USA
If asked, choose optional keyboard shortcut to switch keyboard languages, for example.: Alt + Shift
Choose console charset, for example.: UTF-8
Choose console font: .Combined – Latin; Slavic Cyrillic, Hebrew, basic Arabic
3) Configuring Gnome and XWindows
root@server:~# /etc/init.d/gdm start
root@server:~# dpkg-reconfigure xserver-xorg
4) Install Remote Desktop Server (RDS), we use TightVNC for Linux:
root@server:~# apt-get install tightvncserver
5) Configure RDS VNC server, and create VNC connection password.
root@server:~# vncpasswd
This command starts server and asks you for a password. Important! This password will be used to connect to your VPS server GUI desktop, so use a secure and strong password (but not longer than 8 characters).
Also, if you want you can create additional, limited privileges connection password (read only password), with this read only password it is possible to connect to desktop, but can not do anything, just view.
If you want to create an additional read only password then for a question:
Would you like to enter a view-only password (y / n)
Answer … Y(es), and enter another password.
If the additional read only password you do not want, then respond, N.
root@server:~# vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565
6) Check whether the VNC server is running with the command:
root@server:~# ps aux | grep Xtightvnc
Xtightvnc process must be shown:
Xtightvnc: 1-desktop X-auth …
This means that the VNC server is running.
7) By default, the VNC server does not use the Gnome window manager. To make VNC server to use Gnome window manager by default, you should make some changes to the configuration files:
root@server:~# nano ~/.vnc/xstartup
If you find uncommented, then comment-out with the character # line with:
#x-window-manager &
And in the end of the file add a new line:
gnome-session &
After changes files might 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 &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
gnome-session &
8 ) Important! Run this command before restarting your VPS server, to make sure SSHD service will run automatically when your VPS server starts:
root@server:~# update-rc.d ssh defaults
9) Restart VPS server (to see that everything is working fine)
root@server:~# reboot
10) Connect to your VPS server on the SSH console after reboot and start VNC server:
root@server:~# vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565
If, after updating and upgrading packages you can not connect to your VPS server via SSH, this means that sshd service is not started. In this case, connect to our VPS server control panel on:
https://vps.cinfu.com/
On control panel select your VPS server from the list, connect to your server via Java SSH console and start sshd service manually:
root@server:~# /etc/init.d/ssh start
After that set configuration on your VPS server to launch SSHD automatically when server starts:
root@server:~# update-rc.d ssh defaults
11) Download and install VNC program on your computer from here:
http://www.tightvnc.com/download.html
11) Run VNC program on your computer:
Enter in the VNC program address bar IP address of your VPS server and the end of address add a colon : with number 1 (as in this example, we launched VNC server, with the number 1), for example.:
192.168.0.1:1
Press “Connect” button and enter VNC password you have set before:
TA-DA! You have connected to your VPS server GUI desktop
And one more thing, for some unknown reason default GUI desktop keybord shortcut to minimize all open windows is set to letter “D”, so if you type in some text and press D all GUI windows will be minimized. To fix this you have to redefine minimize all windows shortcut. Go to System->Preferences->Keyboard Shortcuts as you can see in the image below:
Find “Hide all normal windows and set focus to desktop” line and change shortcut to something else, for example Ctrl+Alt+1.
This tutorial is just about how to install a graphical environment (GUI) on Linux VPS server and VNC server to let you connect to your VPS GUI desktop from your computer and to use VPS server as a desktop computer, run Firefox, Openoffice and other programs. Also, you may check our other tutorial about very good Gnome Desktop alternative LXDE which is more suitable for a low RAM configurations (lower VPS plans) here: LXDE Desktop installation tutorial
For GUI desktop installation we choose minimal Ubuntu 10.04 or Ubuntu 10.10 OS version.
Since Gnome XWindows GUI will use alot of RAM, it is recommended to choose at least VPS3 or bigger plan with 1GB or more RAM.
Or you can choose Gnome alternative - LXDE Desktop (recommended) which runs even in VPS1 plan with 256MB RAM and you can find LXDE installation tutorial here: LXDE Desktop installation tutorial for low RAM usage
Reinstall your VPS with minimal Ubuntu OS and log in to your VPS server ssh command line as “root”.
1) Preparation of empty VPS server for GUI installation:
Uninstall and remove all unnecessary services (if really not needed):
root@server:~# apt-get purge apache2* bind9* samba*
Update existing packages:
root@server:~# apt-get update
root@server:~# apt-get upgrade
Install text editor “nano”:
root@server:~# apt-get install nano
2) GUI desktop installation:
root@server:~# apt-get install ubuntu-desktop
Choose console country from the list, for example.: USA
Select keyboard layout, for example.: USA
If asked, choose optional keyboard shortcut to switch keyboard languages, for example.: Alt + Shift
Choose console charset, for example.: UTF-8
Choose console font: .Combined – Latin; Slavic Cyrillic, Hebrew, basic Arabic
3) Configuring Gnome and XWindows
root@server:~# /etc/init.d/gdm start
root@server:~# dpkg-reconfigure xserver-xorg
4) Install Remote Desktop Server (RDS), we use TightVNC for Linux:
root@server:~# apt-get install tightvncserver
5) Configure RDS VNC server, and create VNC connection password.
root@server:~# vncpasswd
This command starts server and asks you for a password. Important! This password will be used to connect to your VPS server GUI desktop, so use a secure and strong password (but not longer than 8 characters).
Also, if you want you can create additional, limited privileges connection password (read only password), with this read only password it is possible to connect to desktop, but can not do anything, just view.
If you want to create an additional read only password then for a question:
Would you like to enter a view-only password (y / n)
Answer … Y(es), and enter another password.
If the additional read only password you do not want, then respond, N.
root@server:~# vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565
6) Check whether the VNC server is running with the command:
root@server:~# ps aux | grep Xtightvnc
Xtightvnc process must be shown:
Xtightvnc: 1-desktop X-auth …
This means that the VNC server is running.
7) By default, the VNC server does not use the Gnome window manager. To make VNC server to use Gnome window manager by default, you should make some changes to the configuration files:
root@server:~# nano ~/.vnc/xstartup
If you find uncommented, then comment-out with the character # line with:
#x-window-manager &
And in the end of the file add a new line:
gnome-session &
After changes files might 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 &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
gnome-session &
8 ) Important! Run this command before restarting your VPS server, to make sure SSHD service will run automatically when your VPS server starts:
root@server:~# update-rc.d ssh defaults
9) Restart VPS server (to see that everything is working fine)
root@server:~# reboot
10) Connect to your VPS server on the SSH console after reboot and start VNC server:
root@server:~# vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565
If, after updating and upgrading packages you can not connect to your VPS server via SSH, this means that sshd service is not started. In this case, connect to our VPS server control panel on:
https://vps.cinfu.com/
On control panel select your VPS server from the list, connect to your server via Java SSH console and start sshd service manually:
root@server:~# /etc/init.d/ssh start
After that set configuration on your VPS server to launch SSHD automatically when server starts:
root@server:~# update-rc.d ssh defaults
11) Download and install VNC program on your computer from here:
http://www.tightvnc.com/download.html
11) Run VNC program on your computer:
Enter in the VNC program address bar IP address of your VPS server and the end of address add a colon : with number 1 (as in this example, we launched VNC server, with the number 1), for example.:
192.168.0.1:1
Press “Connect” button and enter VNC password you have set before:
TA-DA! You have connected to your VPS server GUI desktop
And one more thing, for some unknown reason default GUI desktop keybord shortcut to minimize all open windows is set to letter “D”, so if you type in some text and press D all GUI windows will be minimized. To fix this you have to redefine minimize all windows shortcut. Go to System->Preferences->Keyboard Shortcuts as you can see in the image below:
Find “Hide all normal windows and set focus to desktop” line and change shortcut to something else, for example Ctrl+Alt+1.