安装
yum install tigervnc-server -y
拷贝配置文件
cp /lib/systemd/system/vncserver\@.service /lib/systemd/system/vncserver@:1.service
修改配置文件
vim /lib/systemd/system/vncserver@:1.service
替换< USER>为用户名
配置、启动vnc
systemctl enable vncserver@:1.service //开机启动
systemctl start vncserver@:1.service
firewall-cmd --add-service=vnc-server --permanent
firewall-cmd --reload
systemctl status vncserver@:1.service
修改vnc配置(MATE桌面)
vim ~/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc#export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
# x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
mate-session &