- 安装x11vnc及各种依赖
- 设置vnc密码:sudo x11vnc -storepasswd <password> /etc/x11vnc.pass
- 设置为开机启动:sudo vi /lib/systemd/system/x11vnc.service 添加以下内容:
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target
4. 建立服务:
sudo systemctl daemon-reload
sudo systemctl enable x11vnc.service
![576f8a12c652ad26da0bfb4ad30cc481.png](https://i-blog.csdnimg.cn/blog_migrate/b6bf73b1675274d457117845a21a5954.jpeg)