ubuntu16.04 vnc server最简安装方式

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huangkangying/article/details/89222197

由于ubuntu 16.04采用unity图形化界面,安装其它的vnc server需要安装很多的依赖库,甚至有的需要改成gnome或xfce桌面。这样的改动风险很大,有时会导致以前的很多程序不能正常使用。
x11vnc依赖很小,不需要改变unity桌面环境。下面的shell可以一键布署,简单好用。

###########################################
# Step 1 - Install X11VNC 
# ################################################################# 
sudo apt-get install x11vnc -y
# Step 2 - Specify Password to be used for VNC Connection 
# #################################################################
sudo x11vnc -storepasswd /etc/x11vnc.pass
# Step 3 - Create the Service Unit File
# #################################################################
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
# Step 4 -Configure the Service 
# ################################################################
echo "Configure Services"
sudo systemctl enable x11vnc.service
sudo systemctl daemon-reload
sleep 10
# Step 5 - Restart System 
# ################################################################
sudo shutdown -r now

猜你喜欢

转载自blog.csdn.net/huangkangying/article/details/89222197