峯言凬语 O ever youthful O ever weeping~
本无意与众不同,怎奈何口味太重。
首页
平水韵
颜色表
ABOUT
文章分类
友情链接
Config VNC on CentOS7
2019-04-10 |Nonni | TSI
yum update

防火墙:

firewall-cmd --permanent --add-service vnc-server
systemctl restart firewalld.service

X-Window:

yum groupinstall "X Window System"
yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts
unlink /etc/systemd/system/default.target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

sync
reboot

VNC SERVER:

cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

vim /etc/systemd/system/vncserver@:1.service
找到最下面的类似几行替换:

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=simple
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver :1 -geometry 1280x720 -depth 24"
PIDFile=/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'
[Install]
WantedBy=multi-user.target

重启systemd:

systemctl daemon-reload

设置密码:

vncpasswd

控制命令:
开机启动VNC:

systemctl enable vncserver@:1.service

启动服务:

systemctl start vncserver@:1.service

or

vncserver

关闭 VNC 服务:

systemctl stop vncserver@:1.service

禁止VNC开机启动:

systemctl disable vncserver@:1.service

VNCview连接:
IP:1

respond-post-322

添加新评论

请填写称呼
请填写合法的电子邮箱地址
请填写合法的网站地址
请填写内容