现在很少有自带VNCserver的教程,因为之前官方系统没有自带VNC,但是现在最新版的官方系统已经自带VNCserver,只需要在设置里启用一下,然后设置就可以用啦。

1、打开树莓派设置 sudo raspi-config,选择 5、Interfacing Options ,然后回车:

2、选择3 VNC,再回车:

3、选择yes:

4、编辑vncserver,sudo vim /etc/init.d/vncserver,添加以下命令,然后保存退出:

#!/bin/sh
### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start:
# Default-Stop:
# 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
;;
esac
exit

5、修改权限:

sudo chmod  /etc/init.d/vncserver

6、设置开机自启动:

sudo update-rc.d vncserver defaults

7、重启服务器:sudo reboot

可以使用RealVNC Viewer客户端远程连接VNC服务器了。

最新文章

  1. 常见HTTP状态码列表
  2. linux 内核学习之八 进程调度过程分析
  3. Odoo Shell
  4. 安装mysql后ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var mysql 启动不了
  5. centos7优化mysql5.6配置
  6. C++ 中int,char,string,CString类型转换
  7. JS实现打字机式字符输出效果
  8. cmd命令运行php,php通过cmd运行文件
  9. Perfmon 介绍
  10. 【MFC相关】MFC入门相关
  11. PHP 运行 php-fpm 报错
  12. 安装JBoss Tool 出错
  13. C#导出Excel后关闭进程EXCEL.EXE
  14. 一个jQuery对象绑定多个事件
  15. 【转】关于Log4j
  16. iOS - 记住用户登录状态保存用户名密码
  17. Python --代码风格检查 pep8
  18. LED恒流驱动IC汇总
  19. Python3基础 dict 推导式 生成10以内+奇数的值为True 偶数为False的字典
  20. mysql主从复制-读写分离

热门文章

  1. Tomcat远程调试模式及利用Eclipse远程链接调试
  2. POJ2352 Stars [树状数组模板]
  3. caffe之那些依赖的库
  4. LeetCode 刷题记录(1-5题)
  5. http://yuedu.baidu.com/ebook/36edd3d7ba1aa8114531d911
  6. Redis:slave flush old data造成实例不可用
  7. 蚂蚁金服招聘-无线测试开发(20k-36k/月)
  8. 在Docker中运行gocd
  9. Windows系统在Python2.7环境下安装numpy, matplotlib, scipy - Lichanghao Blog
  10. 【原创】从零开始搭建Electron+Vue+Webpack项目框架(五)预加载和Electron自动更新