轉載請注明:@小五義http://www.cnblogs.com/xiaowuyi
等了一個十一假期,新買的B+終於到了。按照前兩節的方法,重新安裝了操作系統。
一、添加國內軟件源
Raspberry Pi(樹莓派)國內軟件源:(http://www.linuxidc.com/Linux/2013-10/91012.htm)
修改配置文件:
pi@aborn ~ $ vi /etc/apt/sources.list
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi deb http://mirrors.neusoft.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi deb-src http://mirrors.neusoft.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi deb-src http://mirrors.ustc.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi
(這里如果vi不會用,可以百度一下。)
修改文件后,在終端中運行:
sudo apt-get update
二、添加輸入法
這里我習慣用fcitx
於是安裝fcitx
sudo apt-get install fcitx fcitx-tables-wbpy
三、添加vnc server
sudo apt-get update sudo apt-get install tightvncserver
安裝完成后,運行
tightvncserver
這時會要求輸入控制密碼,選擇性輸入查看密碼,查看密碼只能用來查看桌面,而控制密碼才能對桌面進行操作。
此后,在電腦上安裝vnc軟件,下載地址:http://www.tightvnc.com/
安裝時,選擇自定義安裝,僅安裝tightvncviewer就可以。
每個用戶可以啟動多個VNCSERVER遠程桌面,它們用ip加端口號:ip:1、ip:2、ip:3 來標識、區分,使用同一端口會使另外登錄的用戶自動退出。
四、設定固定IP
設定成固定IP后,方便日后操作,不需要每次先讀取到IP才能工作。設定方法很簡單,通過修改文件sudo vi /etc/network/interfaces文件完成,這里會用到root權限,樹莓派root權限的獲取可參考上一節評論(http://www.cnblogs.com/xiaowuyi/p/3980037.html)。
1、有線網絡固定IP修改
原文件為:
auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
這里iface eth0 inet dhcp設置有線網絡eth0為動態獲取IP,因此可做如下修改:
auto lo iface lo inet loopback iface eth0 inet static address 192.168.1.123 netmask 255.255.255.0 gateway 192.168.1.1 allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
2、無線網絡的修改
auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet static
address 192.168.1.123 netmask 255.255.255.0 gateway 192.168.1.1
修改成功后,IP地址換為192.168.1.123。
五、vnc的使用
通過以上的安裝,每次啟動vnc后,我們就不需要再連接顯示器了,而是直接通過電腦就可以操作。具體方法是:
啟動后,電腦通過putty與其連接:
連接后,運行tightvncserver,建立一個新窗體。然后打開tightvncviewer,輸入密碼,出現窗體,如下圖:
1、停止VNC窗口:
vncserver -kill:1
2、修改密碼
vncpasswd
3、重啟服務
service vncserver restart
>>歡迎加入討論群:64770604