Linux Mint 18 和 Ubuntu 16.04 VNC伺服器安裝設定

隨手筆記 以便不時之需
同時提供給天下IT人方便

更新系統:
apt-get -y update
apt-get -y upgrade

安裝VNC:
apt-get -y install x11vnc numlockx

設定VNC密碼:
x11vnc -storepasswd /etc/x11vnc.pass

寫入開機啟動設定檔:

cat > /lib/systemd/system/x11vnc.service << EOF [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 EOF

開機自動啟動:
sudo systemctl daemon-reload
sudo systemctl enable x11vnc.service