1 安装X11VNC
sudo apt-get install x11vnc -y
2 配置登陆密码
sudo vu /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
3 设置开机自启
sudo systemctl enable x11vnc.service
sudo systemctl daemon-reload
4 配置防火墙
关闭防火墙或者开放5900端口
sudo ufw allow 5900
jae@jae-ubuntu:~$ sudo ufw allow 5900
[sudo] password for jae:
Rules updated
Rules updated (v6)
5 Reboot
sudo reboot