1、输入 sudo raspi-config 进入到系统设置中开启vnc服务
2、进入后选择 Interfacing Options 进入
3、选择 VNC 进入
4、yes
下载软件:VNC Viewer
5、连接vnc ,如果出现:显示黑屏“cannot currently show the desktop”
6、sudo raspi-config 进入选择分辨率
7、选择 Advanced Options,回车。
8、选择A5 Resolution,回车。
9、选择一个除了第一项以外的分辨率我选择最大的回车。
10、用 方向键→ 选中 finish,回车
完成
设置vnc开机启动
11、创建 sudo vim /etc/init.d/vncserver 将下面代码填写进去。
#!/bin/sh
VNCUSER='pi'
case "$1" in
start)
#以pi用户运行'vncserver :1'指令,如果使用的是其他VNC 直接替换成对应的启动命令即可
su $VNCUSER -c 'vncserver :1'
echo "Starting VNC Server for $VNCUSER"
;;
stop)
su $VNCUSER -c 'vncserver -kill :1'
echo "TightVNC Server stopped"
;;
*)
echo "Usage: /etc/init.d/vncserver {start|stop}"
exit 1
;;
esac
exit 0
12、然后对该文件添加可执行权限:sudo chmod 755 /etc/init.d/vncserver
13、添加到开机启动列表:sudo update-rc.d vncserver defaults
14、取消开机启动:sudo update-rc.d -f vncserver remove
设置完成。