Tech in T: depth + breadth‎ > ‎OS‎ > ‎Linux‎ > ‎


sudo apt-get install ubuntu-desktop

VNC server requires some packages to load GUI

sudo apt-get install -y gnome-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

sudo apt-get install -y vnc4server

sudo apt-get install -y lxde # toget rid of blank gray screen

vim .vnc/xstartup


    vncserver -kill :1

sudo apt-get install -y  gnome-core # gdm as display manager

vim .vnc/xstartup

gnome-panel &

gnome-settings-daemon &

metacity &

nautilus &

Add firewall rule to allow all ports

find ip of machine    sandbox-morteza:1

$ sudo yum install tigervnc-server tigervnc -y
$ sudo adduser vnc
$ su vnc
$ vncpasswd
$ exit   # exit from vnc user

$ vim /etc/sysconfig/vncservers
uncomment last two lines, put user vnc, remove -localhost
# VNCSERVERS="2:vnc"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp"

In the above section, you can set up multiple users for connection. Say you had three users that needed access using different resolutions. To accomplish this, you could enter something like:
VNCSERVERS="1:vncuser1 2:vncuser2 3:vncuser3"
VNCSERVERARGS[1]="-geometry 640x480"
VNCSERVERARGS[2]="-geometry 800x600"
VNCSERVERARGS[3]="-geometry 1600x1200"

Firewall rule for VNC access:
sudo vim /etc/sysconfig/iptables        # add following line
-A INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT
sudo service iptables restart

$ sudo service vncserver start

$ sudo chkconfig vncserver on
$ chkconfig --list | grep vncserver
vncserver       0:off   1:off   2:on    3:on    4:on    5:on    6:off