X
    Categories: Linux

How To access linux remote desktop session using VNC

Many times we take the linux session using  famous tool Putty. What if you need to take linux remote desktop session (GUI) session? Answer is VNC server. This post will quickly guide you about how to take remote Linux remote desktop GUI session.

Setting up an VNC server for linux remote desktop session

Steps :

1.Desktop packages installation:

Firstly you need to install the desktop packages on the server.

[root@rhel1 ~]# yum groupinstall "Desktop"

2. Tiger VNC server package installation.

Also you need to install tiger vnc package on the server which will enable us to take linux remote desktop.

[root@rhel1 ~]# yum install vnc-server

3. Setting up an VNC user for Linux remote desktop session.

If you want to create any special user for Linux remote desktop session then you can create using procedure below otherwise you can also use any existing users for the same. Here I am adding new user “vncuser”.

[root@rhel1 ~]# useradd user1
[root@rhel1 ~]# passwd user1
Changing password for user user1.
New password:
BAD PASSWORD: it is based on your username
Retype new password:
passwd: all authentication tokens updated successfully.
[root@rhel1 ~]#

Once you are done with user creation you need set VNC password using vncpasswd command as below:

[root@rhel1 ~]# su - user1
[user1@rhel1 ~]$ vncpasswd user1
Password:
Verify:
[user1@rhel1 ~]$ exit
logout
[root@rhel1 ~]#

4. Setting up an screen resolution for the linux remote desktop session.

Now to setup the screen resolution you need to add below lines of code under the file “/etc/sysconfig/vncservers

VNCSERVERS="1:user1"
VNCSERVERARGS[1]="-geometry 1024x768"

In the above lines code we have defined screen size of “1024×768” for our remote user “user1”.

After saving the file start the VNC service as below:

[root@rhel1 ~]# service vncserver start
Starting VNC server: 1:user1
New 'rhel1.lab.com:1 (user1)' desktop is rhel1.lab.com:1

Starting applications specified in /home/user1/.vnc/xstartup
Log file is /home/user1/.vnc/rhel1.lab.com:1.log

[ OK ]
[root@rhel1 ~]#

5. Access linux remote desktop

For accessing the Linux remote desktop from the Linux OS use below command.

vncviewer 192.168.216.134:1

Now to take this Linux remote desktop session from the windows server you must download the tiger vnc java enabled viewer from this link.

Once download click on the jar file named as “tightvnc-jviewer.jar”. and enter the ip of server under remote host box.

Once clicked on Connect Button system will ask for password . Please enter user1’s vnc password set within step3 using vncpasswd command.

You are now finally connected to Linux remote desktop.

 

View Comments (0)

Related Post