Leave a note about the installation of VNC Server on CentOS7.
Since VNC is software for remotely operating Linux GUI, it is assumed that desktop environment such as GNOME is installed on Linux itself. Install VNC Server with the following command.
# yum install tigervnc-server # rpm -qa | grep vnc-server tigervnc-server-minimal-1.2.80-0.30.20130314svn5065.el7.x86_64 tigervnc-server-1.2.80-0.30.20130314svn5065.el7.x86_64
Set the password for connecting to VNC. The password of the user who executed the following command will be set, so if you want to log in to VNC as root, execute the following command as root.
# vncpasswd Password: [enter password] Verify: [enter password again]
And start it with the following command. A value of 1 means that it will be started on port 5901, and a value of 2 means that it will be started on port 5902.
# vncserver: 1
Conversely, when stopping, add the -kill option to the option and specify the display number.
# vncserver -kill: 1
VNC Server is not always started, so I think it is good to start it as needed, so I think that it is better to operate while using the above commands properly.
If you need a desktop environment, install “GNOME Desktop” with yum groupinstall.
# yum -y groupinstall "GNOME Desktop"
Or “Server with GUI” is fine.
# yum -y groupinstall "Server with GUI"
If you prefer KDE as your desktop environment, insert “KDE Plasma Workspaces”.
# yum -y groupinstall "KDE Plasma Workspaces"
After installation, change the startup mode to graphical.target.
# systemctl set-default graphical.target # systemctl get-default graphical.target
All you have to do is reboot.
# sudo shutdown -r now
When only X Window System is enough
If you do not need a desktop environment and only need the X Window System, install “X Window System” with yum groupinstall.
# yum -y groupinstall "X Window System"
If you keep it as it is, Japanese characters will be garbled, so install Japanese fonts as you like.
# yum -y install vlgothic- *
After that, just change the startup mode and restart as before.
# systemctl set-default graphical.target # shutdown -r now
Configure settings to allow communication between the VNC server and client with firewall-cmd.
# firewall-cmd --permanent --zone=public --add-service=vnc-server # firewall-cmd --reload # firewall-cmd --list-all
VNC Server requires special client software to start and connect to it. I recommend the following software called RealVNC.
https://www.realvnc.com/download/viewer/
There are various software here, so please choose