By default, SELinux is enabled in CentOS 8 operating system and the VNC server will not work properly if SELinux is enabled. So it is a good idea to disable the SELinux in your system. You can disable it by editing the following file:
nano /etc/sysconfig/selinux
找到如下命令
SELINUX=enforcing
更改为:
SELINUX=disabled
保存,重启,reboot
By default, TigerVNC is available in the CentOS 8 default repository. You can install it by running the following command:
dnf install tigervnc-server tigervnc-server-module -y
Once the installation has been completed, you can proceed to the next step.
vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used
设置config
vim ~/.vnc/config
session=gnome
geometry=1920x1200
localhost
alwaysshared
设置用户桌面号
nano /etc/tigervnc/vncserver.users
:1=root
:2=abaqus
:3=ansys
systemctl daemon-reload
启动VNC
systemctl start vncserver@:1.service
设置随开机启动
systemctl enable vncserver@:1.service
sudo systemctl enable vncserver@:1 --now
设置防火墙
firewall-cmd --add-service=vnc-server --permanent
重启防火墙
sudo firewall-cmd --reload
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删