Step1:WIN10上安装tightvnc
下载地址:http://www.tightvnc.com/
下载完成后,默认设置安装即可。
在这一步也可以选择仅安装viewer。
Step2:raspberry上安装tightvnc
sudo apt-get update //更新软件列表
sudo apt-get install tightvncserver //安装tightvncserver
tightvncserver //运行tightvncserver (第一次运行时会提示设置密码)
Step3:raspberry上设置tightvnc开机自启
sudo su //进入超级用户
sudo nano /etc/init.d/tightvncserver //在init.d下创建tightvncserver ,tightvncserver 内容如下:
#!/bin/sh
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: $syslog $remote_fs $network
# Required-Stop: $syslog $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts VNC Server on system start.
# Description: Starts tight VNC Server. Script written by James Swineson.
### END INIT INFO
# /etc/init.d/tightvncserver
VNCUSER='pi'
case "$1" in
start)
su $VNCUSER -c '/usr/bin/tightvncserver :1'
echo "Starting TightVNC Server for $VNCUSER"
;;
stop)
pkill Xtightvnc
echo "TightVNC Server stopped"
;;
*)
echo "Usage: /etc/init.d/tightvncserver {start|stop}"
exit 1
;;
esac
exit 0
编辑完成后修改权限:
sudo chmod 755 /etc/init.d/tightvncserver
sudo update-rc.d tightvncserver defaults
sudo reboot
Step4:win10上启动vncviewer
connect后输入密码登录即可
vncviewer可同时连接多个server,因此可同时控制多个树莓派桌面