Monday 11 November 2013

Starting VNC on Ubuntu 12.04 with full desktop

    In this post I will mention the method which can be used to display full Ubuntu 12.04 desktop to VNC clients. I have noticed that starting from Ubuntu 12.04, VNC clients don't show full desktop. First I will mention the steps to install VNC Server and connect a client to it. I will also show the terminal only desktop which is the default screen. Then I will mention the method which can be used to display full desktop



Installing VNC Server on Ubuntu 12.04

Open a terminal and make sure that no vncserver is already installed by executing which vncserver command, if the command has no output, it means you need to install the server else server is already installed and you can skip the installation part. In order to install the server execute sudo apt-get install vnc4server as shown below.

arslan@ubuntu:~$ sudo apt-get install vnc4server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  thunderbird-globalmenu
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  xbase-clients
Suggested packages:
  vnc-java
The following NEW packages will be installed:
  vnc4server xbase-clients
0 upgraded, 2 newly installed, 0 to remove and 378 not upgraded.
Need to get 2,090 kB of archives.
After this operation, 5,457 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main xbase-clients all 1:7.6+12ubuntu2 [2,322 B]
Get:2 http://us.archive.ubuntu.com/ubuntu/ precise/universe vnc4server i386 4.1.1+xorg4.3.0-37ubuntu4 [2,087 kB]
Fetched 2,090 kB in 17s (119 kB/s)                                                                                                                                                                          
Selecting previously unselected package xbase-clients.
(Reading database ... 142188 files and directories currently installed.)
Unpacking xbase-clients (from .../xbase-clients_1%3a7.6+12ubuntu2_all.deb) ...
Selecting previously unselected package vnc4server.
Unpacking vnc4server (from .../vnc4server_4.1.1+xorg4.3.0-37ubuntu4_i386.deb) ...
Processing triggers for man-db ...
Setting up xbase-clients (1:7.6+12ubuntu2) ...
Setting up vnc4server (4.1.1+xorg4.3.0-37ubuntu4) ...
update-alternatives: using /usr/bin/vnc4server to provide /usr/bin/vncserver (vncserver) in auto mode.
update-alternatives: using /usr/bin/Xvnc4 to provide /usr/bin/Xvnc (Xvnc) in auto mode.
update-alternatives: using /usr/bin/x0vnc4server to provide /usr/bin/x0vncserver (x0vncserver) in auto mode.
update-alternatives: using /usr/bin/vnc4passwd to provide /usr/bin/vncpasswd (vncpasswd) in auto mode.
update-alternatives: using /usr/bin/vnc4config to provide /usr/bin/vncconfig (vncconfig) in auto mode.
arslan@ubuntu:~$ 

Now start the vncserver and specify password.


arslan@ubuntu:~$ vncserver
You will require a password to access your desktops.
Password:
Verify:
New 'ubuntu:1 (arslan)' desktop is ubuntu:1
Creating default startup script /home/arslan/.vnc/xstartup
Starting applications specified in /home/arslan/.vnc/xstartup
Log file is /home/arslan/.vnc/ubuntu:1.log
arslan@ubuntu:~$ 







Password can be changed at later time using vncpasswd command as shown below.



arslan@ubuntu:~$ vncpasswd
Password:
Verify:
arslan@ubuntu:~$


Now connect to VNCServer using a suitable client like Real VNC Viewer. It can be seen that the VNC session is only displaying terminal window as shown below.





If above screen shows up execute gnome-session, this worked for me and full Ubuntu desktop became available.





No comments:

Post a Comment