VNC 架設

Erasin發表於2013-12-18

VNC-SERVER

title: Raspberry Pi VNC遠端控制伺服器
tags: raspberrypi,vnc,raspbian,樹莓派

OS: Raspbian “wheezy”

安裝服務

安裝 tightvncserver

# apt-get isntall tightvncserver

使用編輯器建立 啟動指令碼 /etc/init.d/tightvncserver
指令碼內容:

### BEGIN INIT INFO
# Provides: tightvnc
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server as a service
# Description: Start VNC Server as a service.
### END INIT INFO
#!/bin/sh
# /etc/init.d/tightvncserver
# Customised by Stewart Watkiss

# Set the VNCUSER variable to the name of the user to start tightvncserver under
VNCUSER='pi'
eval cd ~$VNCUSER
case "$1" in
start)
  su $VNCUSER -c '/usr/bin/tightvncserver :1'
  echo "Starting TightVNC server for $VNCUSER "
  ;;
stop)
  pkill Xtightvnc
  echo "Tightvncserver stopped"
  ;;
*)
echo "Usage: /etc/init.d/tightvncserver {start|stop}"
exit 1
;;
esac
exit 0
#

修改指令碼所屬許可權

sudo chmod 755 /etc/init.d/tightvncserver

或者

sudo chmod +x /etc/init.d/tightvncserver

設定開機啟動

sudo update-rc.d tightvncserver defaults

執行

vncserver

設定訪問密碼,會出現兩次,之後會詢問一個只讀密碼,n跳過

使用vnc客戶端訪問

預設 ip:5901

本文來源:http://www.shumeipai.net/thread-1394-1-1.html

相關文章