Installing x11vnc

Reviews and other little ventures that don't quite fit into the other forums
Post Reply
Daniel Wee
Site Admin
Posts: 2186
Joined: Wed 25 Feb 25 2009 8:00 pm

Installing x11vnc

Post by Daniel Wee » Fri 11 Oct 11 2019 12:13 am

Do not use tightvnc-server as those create virtual desktops rather than the actual one. For actual desktop, you will need an x11 compatible vnc.

https://tecadmin.net/setup-x11vnc-serve ... linuxmint/
https://askubuntu.com/questions/229989/ ... gin-screen

In this case, follow the instructions in the comments regarding setting up the service, rather than using /etc/init/x11vnc.conf

If the port is in use, you may run:-

lsof -i :5901

to see what is using port 5901

The program may suggest using the ncache option, but this is incompatible with several clients and produces long screens, so leave this out unless the client understands the caching.
Daniel Wee
Site Admin
Posts: 2186
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Installing x11vnc

Post by Daniel Wee » Fri 11 Oct 11 2019 12:16 am

The contents of the /etc/systemd/system/x11vnc.service is as follows:-
[Unit]
Description=x11vnc remote desktop server
Requires=display-manager.service
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5901 -shared -display :0
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
RestartSec=2

[Install]
WantedBy=multi-user.target
Daniel Wee
Site Admin
Posts: 2186
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Installing x11vnc

Post by Daniel Wee » Fri 11 Oct 11 2019 12:18 am

This presumes placing the password in the /etc/init/x11vnc.pass file with the command:-

sudo x11vnc -storepasswd xxxxxxx /etc/init/x11vnc.pass
Daniel Wee
Site Admin
Posts: 2186
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Installing x11vnc

Post by Daniel Wee » Mon 28 Oct 28 2019 7:07 pm

This might help with potential solutions. We're having difficulty installing x11vnc on Ubuntu 18.04 with Wayland. The problem is that display :0 is not accessible it seems. This is especially so when launched in headless mode.

https://askubuntu.com/questions/767752/ ... less-16-04
Daniel Wee
Site Admin
Posts: 2186
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Installing x11vnc

Post by Daniel Wee » Mon 28 Oct 28 2019 7:21 pm

This might help get display :0 on headless setups

https://fabianlee.org/2018/10/14/ubuntu ... ver-hosts/
Daniel Wee
Site Admin
Posts: 2186
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Installing x11vnc

Post by Daniel Wee » Mon 28 Oct 28 2019 10:20 pm

Another thing to do is to use lightdm as the display-manager:-

sudo dpkg-reconfigure lightdm
sudo systemctl start lightdm

Then in the start up of x11vnc use:-

-auth /var/run/lightdm/root/:0

assuming that exists in the directory
Daniel Wee
Site Admin
Posts: 2186
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Installing x11vnc

Post by Daniel Wee » Mon 28 Oct 28 2019 10:24 pm

Prior to anything working, you will need to ensure that:-

echo $DISPLAY

actually returns something like "localhost 0:0"

xhost

should also return something
Daniel Wee
Site Admin
Posts: 2186
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Installing x11vnc

Post by Daniel Wee » Mon 28 Oct 28 2019 10:42 pm

Daniel Wee
Site Admin
Posts: 2186
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Installing x11vnc

Post by Daniel Wee » Mon 28 Oct 28 2019 11:50 pm

In several cases, you may need to set up a dummy monitor with headless servers.

https://askubuntu.com/questions/453109/ ... plugged-in
https://askubuntu.com/questions/1066721 ... o-graphics
Post Reply