树莓派安装vnc server并设置自启动
生活随笔
收集整理的這篇文章主要介紹了
树莓派安装vnc server并设置自启动
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
- 在SSH終端輸入sudo raspi-config, 這里需要打開幾個選項:
- expand_rootfs – 將根分區擴展到整張SD卡;
- change_pass – 默認的用戶名是pi,密碼是raspberry;
- change_timezone – 更改時區, 選擇Asia – Shanghai;
- configure_keyboard, 選English(US);
- change_locale – 更改語言設置,選擇en_US.UTF-8和zh_CN.UTF-8
設置完成后,選擇Finish,會提示是否重啟,選擇Yes
在樹莓派上安裝vnc服務端(debian):sudo apt install tightvncserver
修改vnc密碼:vncpasswd
創建vnc-server配置文件:sudo vi /etc/init.d/tightvncserver ,在這個文件里輸入如下內容:
### 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 requiredeval cd ~$USERcase "$1" instart)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然后給增加執行權限,并啟動服務:
sudo chmod +x /etc/init.d/tightvncserver
sudo service tightvncserver stop
sudo service tightvncserver start
安裝chkconfig, 并將vnc服務設為開機啟動:
sudo apt-get install chkconfig
chkconfig --add tightvncserver
chkconfig tightvncserver on
轉載于:https://www.cnblogs.com/leviatan/p/9428188.html
總結
以上是生活随笔為你收集整理的树莓派安装vnc server并设置自启动的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: matlab 2ask原理,基于Matl
- 下一篇: 三方集成 - 友盟分享总结