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 -yOnce the installation has been completed, you can proceed to the next step.
vncpasswdPassword:
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=ansyssystemctl daemon-reload启动VNC
systemctl start vncserver@:1.service设置随开机启动
systemctl enable vncserver@:1.servicesudo systemctl enable vncserver@:1 --now
设置防火墙
firewall-cmd --add-service=vnc-server --permanent重启防火墙
sudo firewall-cmd --reload免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删