Skip to content

RHEL vnc server – tigervnc

cpx September 16, 2013 2 min read CentOS Red Hat

On Red Hat Enterprise Linux 6:

yum install tigervnc-server tigervnc

On Red Hat Enterprise Linux 5:

yum install vnc vnc-server

On Red Hat Enterprise Linux 3 and 4:

up2date vnc vnc-server

Edit the /etc/sysconfig/vncservers file to include the users will be running VNC servers. Add a line to that file as follows:

VNCSERVERS="N:user"

Where N is the number of the display VNC server will be running and user is the username by which the server will be run as. Multiple displays and users can be specified by placing a space between them, as follows:

VNCSERVERS="N:user1 Y:user2"

Note: If the X Window System is used, display 0 cannot be used for VNC as it is already being used by X.

For each user specified, a VNC password needs to be set. VNC passwords are completely separate from the normal system password for that account. A user can set their VNC password by executing the vncpasswd command as shown below:

vncpasswd
Password:
Verify:

root may run vncpasswd username command to set password for username, but this may lead to mistakes. The user should run the command vncpasswd by himself, which will create a directory ~username/.vnc owned by the username.

By default, VNC starts up only a simple window manager and a terminal window. For the full Red Hat desktop environment, refer How do I configure vncserver to start GNOME or KDE by default in Red Hat Enterprise Linux ?.

In order to start the vncserver service immediately, run the following command:

service vncserver start

For example:

service vncserver start
Starting VNC server: 1:user1

In order for the vncserver service to start persistently after reboot, run the following command:

chkconfig vncserver on

Note: This command will simply return a command prompt. For example:

chkconfig vncserver on
chkconfig --list vncserver
vncserver       0:off   1:off   2:off    3:on    4:on    5:on    6:off

Now that VNC is running, vncviewer command can be used to connect from a remote Linux machine to the proper VNC-based X session. If the remote system is running Windows, a Windows-based VNC viewer program can be freely downloaded from the website http://www.tigervnc.org/.

vncviewer vncserver-ipaddress:N

To connect to the user display using the vncviewer client, replace N with the number of the VNC-based X session where the application is running.

0 0 votes
Article Rating
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x