Install VNC Server(x11vnc)in ubuntu 16.04

The Vino server is only available after you have logged in to system locally.
x11vnc is a VNC server that is not dependent on any one particular graphical environment.

1.Remove the default Vino server:
$ sudo apt-get -y remove vino
2.Install x11vnc:
$ sudo apt-get -y install x11vnc
3.Create the directory for the password file:
$ x11vnc -storepasswd

It will respond with:

Enter VNC password:
Verify password:
Write password to /home/USERNAME/.vnc/passwd?  [y]/n y
Password written to: /home/USERNAME/.vnc/passwd

One may execute the following in a terminal:

$ x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /home/USERNAME/.vnc/passwd -rfbport 5900 -shared -capslock -nomodtweak

Here a few settings that would be common to adjust depending on your environment:

  • To set x11vnc to request access each time when set without a password, include the -nopw -accept popup:0 options.
  • To set x11vnc to only listen for the next connection, include the -once option.
  • To set x11vnc to continually listen for connections, include the -forever option.
  • To put x11vnc in view-only mode, include the -viewonly option.
  • To set x11vnc to only allow local connections, include the -localhost option.

ps:之前遇到了用vnc-viewer连接,键盘Caps Lock和小键盘错位的问题,加上选项

-capslock -nomodtweak就好了。
4.Create the systemd service file for the x11vnc service:【Have x11vnc start automatically via systemd in any environment (Vivid+)】
$ sudo nano /lib/systemd/system/x11vnc.service

Copy/Paste this code into the empty file:

[Unit]
Description=Start x11vnc at startup.
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -noxdamage -repeat -rfbauth /home/USERNAME/.vnc/passwd -rfbport 5900 -shared -capslock -nomodtweak

[Install]
WantedBy=multi-user.target
5.Reload the services:
$ sudo systemctl daemon-reload
6.Enable the x11vnc service at boot time:
$ sudo systemctl enable x11vnc.service
7.Start the service:

Either reboot or

$ sudo systemctl start x11vnc.service
Reference:
  1. https://help.ubuntu.com/community/VNC/Servers

  2. https://it.ismy.fun/2018/10/16/linux-mint-x11vnc/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值