Configure VNC Server

Install VNC Server to connect with GUI from remote client.

[1] Install VNC Server.

[root@futurelinux ~]# dnf install tigervnc-server -y

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

[root@futurelinux ~]# firewall-cmd --permanent --add-service=vnc-server
success
[root@futurelinux ~]# 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
[root@futurelinux ~]# chmod +x /usr/bin/vncpasswd

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

# start VNC server
[root@futurelinux ~]# 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
[root@futurelinux ~]# vncserver -kill :1
Killing Xvnc process ID 7664

[root@futurelinux ~]# vi /root/.vnc/xstartup

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

# start with diplay number [1], screen resolution [800x600]
[root@futurelinux ~]# 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