本帖最后由 Qter 于 2020-11-30 23:55 编辑
开启VNC功能sudo raspi-config
选择5.Interfacing Options
找到VNC(远程桌面) 选择 Yes(是)enable
开始配置
1.sudo nano /etc/init.d/vncserver
2.复制下面的内容 右键粘贴进去
- #!/bin/sh
- ### BEGIN INIT INFO
- # Provides: vncserver
- # Required-Start: $local_fs
- # Required-Stop: $local_fs
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: Start/stop vncserver
- ### END INIT INFO
- # More details see:
- # http://www.penguintutor.com/linux/vnc
- ### Customize this entry
- # Set the USER variable to the name of the user to start vncserver under
- export USER='pi'
- ### End customization required
- eval cd ~$USER
- case "$1" in
- start)
- # 启动命令行。此处自定义分辨率、控制台号码或其它参数。
- su $USER -c '/usr/bin/vncserver -depth 16 -geometry 1024x768 :1'
- echo "Starting VNC server for $USER "
- ;;
- stop)
- # 终止命令行。此处控制台号码与启动一致。
- su $USER -c '/usr/bin/vncserver -kill :1'
- echo "vncserver stopped"
- ;;
- *)
- echo "Usage: /etc/init.d/vncserver {start|stop}"
- exit 1
- ;;
- esac
- exit 0
复制代码3.Ctrl+O 回车 保存
Ctrl+X退出文本编辑器
4.修改权限 sudo chmod 755 /etc/init.d/vncserver 5.添加开机启动项 sudo update-rc.d vncserver defaults 6.重启树莓派 sudo reboot 之后再右上角就会出现一个VNC的图标
然后PC端的VNC viewer打开,完成配置之后,connect,输入账户密码 账户:pi
密码:raspberry
windows 远程连接树莓派成功~
windows下载安装
VNC-Viewer-6.17.1113-Windows.exe
链接:https://pan.baidu.com/s/1crS6e-jzfKBhrgvG9GihEg
提取码:xdyu
|