yum install -y x11vnc
默认yum源中没有x11vnc的, 在epel.repo里有
为x11vnc创建密码
-
x11vnc -storepasswd
-
sudo mv ~/.vnc/passwd /etc/x11vnc.pwd
设置开机启动服务
1.新建配置文件 /etc/systemd/system/x11vnc.service
-
[
-
Description=Remote desktop service (VNC)
-
Requires=display-manager.service
-
After=display-manager.service
-
-
[
-
Type=forking
-
ExecStart=/usr/bin/x11vnc -display :0 -forever -shared -bg -rfbauth /etc/x11vnc.pwd -o /var/log/x11vnc.log
-
ExecStop=/usr/bin/killall x11vnc
-
Restart=on-failure
-
RestartSec=5
-
-
[
-
WantedBy=multi-user.target
2.启动开机服务服务
-
sudo mv x11vnc.service /etc/systemd/system/
-
sudo systemctl daemon-reload
-
sudo systemctl enable x11vnc.service
-
sudo systemctl start x11vnc.service原文: https://blog.csdn.net/weixin_33853794/article/details/93115571