**树莓派:VNC远程登录Raspbian图形界面安装**(tightvncserver)
sudo apt-get update//更新软件源,最后会读取软件包列表
sudo apt-get upgrade//升级
sudo apt-get dist-upgrade/更新所有软件
安装软件:sudo apt-get install {软件名}
删除软件:sudo apt-get remove {软件名}
Raspbian的默认用户名是:pi,默认密码是:raspberry)
安装:tightvncserver
命令行输入:sudo apt-get install tightvncserver
安装好之后请一定先使用此命令设置一个VNC密码:命令:vncpasswd
先输入操作密码两次,然后会询问是否设置一个查看(view-only)密码,按自己喜欢,一般没必要。选no
设置开机启动
设置开机启动,需要在/etc/init.d/中创建一个文件。例如tightvncserver:
(注:启动脚本的名称,有和程序名一致的习惯)
sudo vi /etc/init.d/tightvncserver
内容如下:
#!/bin/sh
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: local_fs
# Required-Stop:local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop tightvncserver
### END INIT INFO
# More details see:
# http://www.penguintutor.com/linux/tightvnc
### Customize this entry
# Set the USER variable to the name of the user to start tightvncserver under
export USER=’pi’
### End customization required
eval cd ~$USER
case "$1" in
start)
# 启动命令行。此处自定义分辨率、控制台号码或其它参数。
su $USER -c '/usr/bin/tightvncserver -depth 16 -geometry 800x600 :1'
echo "Starting TightVNC server for $USER "
;;
stop)
# 终止命令行。此处控制台号码与启动一致。
su $USER -c ‘/usr/bin/tightvncserver -kill :1’
echo “Tightvncserver stopped”
;;
*)
echo “Usage: /etc/init.d/tightvncserver {start|stop}”
exit 1
;;
esac
exit 0
注:USER变量的值为默认用户名,这里是pi。
然后给tightvncserver文件加执行权限:sudo chmod 755 /etc/init.d/tightvncserver
并更新开机启动列表:sudo update-rc.d tightvncserver defaults
重启树莓派:sudo shutdown -r now
常用安装命令:http://blog.csdn.net/oppo62258801/article/details/78866464