Configure VNC Server

Install VNC Server to connect with GUI from remote client.

[1] Install VNC Server.

[[email protected] ~]# dnf install tigervnc-server -y

[2] If Firewalld is running, allow VNC service.

[[email protected] ~]# firewall-cmd --permanent --add-service=vnc-server
success
[[email protected] ~]# firewall-cmd --reload
success

[3] Login as a user you'd like to configure VNC connection and set like follows.

# set the permission to exec
[[email protected] ~]# chmod +x /usr/bin/vncpasswd

# set VNC password
[[email protected] ~]# vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? y
Password:
Verify:

# start VNC server
[[email protected] ~]# vncserver :1 -geometry 800x600
New 'futurelinux.org:1 (root)' desktop is futurelinux.org:1

Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/futurelinux.org:1.log

# stop VNC server
[[email protected] ~]# vncserver -kill :1
Killing Xvnc process ID 7664

[[email protected] ~]# vi /root/.vnc/xstartup

# end line: add like follows
exec /usr/bin/gnome-session

# start with diplay number [1], screen resolution [800x600]
[[email protected] ~]# vncserver :1 -geometry 800x600
New 'futurelinux.org:1 (root)' desktop is futurelinux.org:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/futurelinux.org:1.log