vnc鏈接 ubuntu 16

http://www.linuxdiyf.com/linux/21503.htmlhtml

Ubuntu 16.04 LTS 安裝VNC,在搜索上找了不少教程,不是太老,就是說的驢脣不對馬嘴,因此忍不住寫一些以正視聽。linux

Ubuntu 16.04 LTS是最近出的LTS版本系統,估計將來也會有長期的使用頻率,配置好遠程桌面,會極大方便工做和生活。不少人也會採用SSH遠程管理,鑑於SSH安裝和使用是很簡單的事情,就不贅述了。git

VNC有不少選擇,VNC4server,tigervncserver等等,都不推薦,難裝又難用。通過屢次實驗和測試,最後只採用 x11vnc 做爲VNC服務器端。github


具體配置步驟以下:ubuntu


步驟 1 - 安裝 X11VNC 
sudo apt-get install x11vnc -y服務器


步驟 2 - 配置訪問密碼oop

sudo x11vnc -storepasswd /etc/x11vnc.pass測試


步驟 3 - 建立服務server

vi  /lib/systemd/system/x11vnc.servicehtm

#粘貼以下代碼,最後 :wq 保存,請使用root用戶,不然沒有權限。
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target


步驟 4 - 配置和啓動服務

sudo systemctl enable x11vnc.service
sudo systemctl daemon-reload


最後重啓。

估計不少人看到這個會頭大吧,還得輸入代碼呀。那好吧,我寫個腳本,請拿去,運行完腳本會自動重啓的。

su root

wget https://raw.githubusercontent.com/longhr/vnchub/master/ubuntu1604VNC.sh

chmod u+x ubuntu1604VNC.sh

./ubuntu1604VNC.sh

便可完成。

相關文章
相關標籤/搜索