1.Robot上位机的程序安装
具体配置步骤如下:
# 步骤 1 - 安装 X11VNC
# #################################################################
sudo apt install x11vnc -y
# 步骤 2 - 配置访问密码
# #################################################################
sudo x11vnc -storepasswd /etc/x11vnc.pass
# 步骤 3 - 创建服务
# #################################################################
vi /lib/systemd/system/x11vnc.service
#粘贴如下代码,最后 :wq 保存,请使用root用户,否则没有权限。
[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 ufw allow 5900
sudo systemctl enable x11vnc.service
sudo systemctl daemon-reload
最后重启。
估计很多人看到这个会头大吧,还得输入代码呀。。。。
那好吧,我写个脚本,请拿去,运行完脚本会自动重启的。
su root
wget https://github.com/longhr/ubuntu1604hub/raw/master/ubuntu1604VNC.sh
chmod u+x ubuntu1604VNC.sh
./ubuntu1604VNC.sh
即可完成。
注意:
/lib/systemd/system/x11vnc.service 必须用root权限才能写入
如果root密码不知道,可以重置root密码
sudo passwd root
2.PC端程序安装
(1)sudo apt-get install xtightvncviewer
(2)sudo apt install vinagre
(3)vinagre
(4)按“connect”,
(5)Protocol:VNC
(6)Host:192.168.1.9:5900
(7)按“connect”,输入对方密码
具体配置步骤如下:
# 步骤 1 - 安装 X11VNC
# #################################################################
sudo apt install x11vnc -y
# 步骤 2 - 配置访问密码
# #################################################################
sudo x11vnc -storepasswd /etc/x11vnc.pass
# 步骤 3 - 创建服务
# #################################################################
vi /lib/systemd/system/x11vnc.service
#粘贴如下代码,最后 :wq 保存,请使用root用户,否则没有权限。
[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 ufw allow 5900
sudo systemctl enable x11vnc.service
sudo systemctl daemon-reload
最后重启。
估计很多人看到这个会头大吧,还得输入代码呀。。。。
那好吧,我写个脚本,请拿去,运行完脚本会自动重启的。
su root
wget https://github.com/longhr/ubuntu1604hub/raw/master/ubuntu1604VNC.sh
chmod u+x ubuntu1604VNC.sh
./ubuntu1604VNC.sh
即可完成。
注意:
/lib/systemd/system/x11vnc.service 必须用root权限才能写入
如果root密码不知道,可以重置root密码
sudo passwd root
2.PC端程序安装
(1)sudo apt-get install xtightvncviewer
(2)sudo apt install vinagre
(3)vinagre
(4)按“connect”,
(5)Protocol:VNC
(6)Host:192.168.1.9:5900
(7)按“connect”,输入对方密码