Ubuntu|使用x11vnc进行远程桌面连接

1

安装x11vnc

$ sudo apt-get update
$ sudo apt-get install x11vnc

2

生成密码

$ x11vnc -storepasswd

3

开启服务

$ x11vnc -auth guess -once -loop -noxdamage -repeat - rfbauth /home/robomaster/.vnc/passwd -rfbport 5900 -shared

4

设为开机启动

$ sudo nano /lib/systemd/system/x11vnc.service

插入以下代码

[Unit]
Description=Start x11vnc at startup.
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -once -loop -noxdamage -repeat -rfbauth /home/USERNAME/.vnc/passwd -rfbport 5900 -shared

[Install]
WantedBy=multi-user.target
$ sudo systemctl daemon-reload
$ sudo systemctl enable x11vnc.service

注意在这之前不要尝试更老版本的VNCServer否则我出现莫名其妙的错误,然后日常重装Ubuntu

5

连接时出现错误
Unable to connect to VNC Server using your chosen security
setting. Either upgrade VNC Server to a more recent version from
RealVNC, or select a weaker level of encryption.
在服务器端使用

gsettings set org.gnome.Vino require-encryption false

降低服务器端的安全等级(不推荐)。

你可能感兴趣的:(Ubuntu)