Install VNC Server to connect with GUI in RHEL/CentOS Linux

Virtual network computing (VNC) is a type of remote-control software that makes it possible to control another computer over a network connection. Keystrokes and mouse clicks are transmitted from one computer to another.

### Install VNC Server

[root@testos ~]# yum install -y tigervnc-server

### If firewalld is running, allow VNC service

[root@testos ~]# firewall-cmd –add-service=vnc-server –permanent
success
[root@testos ~]# firewall-cmd –reload
success

### Login with a user you would like to configure VNC session.
### Set VNC password

[testuser@testos ~]$ vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n

start VNC session with diplay number [1], screen resolution [800×600]

[testuser@testos ~]$ vncserver :1 -geometry 800×600

New ‘testos.unixtest.com:1 (testuser)’ desktop is testos.unixtest.com:1

Creating default startup script /home/testuser/.vnc/xstartup
Creating default config /home/testuser/.vnc/config
Starting applications specified in /home/testuser/.vnc/xstartup
Log file is /home/testuser/.vnc/testos.srv.world:1.log

### Stop VNC process

[testuser@testos ~]$ vncserver -kill :1

### Install VNC Viewer on client computer to connect to VNC server.

Leave a Comment