Page 1 of 2

Installing x11vnc

Posted: Fri 11 Oct 11 2019 12:13 am
by Daniel Wee
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.

Re: Installing x11vnc

Posted: Fri 11 Oct 11 2019 12:16 am
by Daniel Wee
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/init/x11vnc.pass -rfbport 5901 -shared -display :0
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
RestartSec=2

[Install]
WantedBy=multi-user.target
This assumes that you have successfully:-
1. installed x11vnc and net-tools
2. installed lightdm and switched to it from gdm3
3. installed the passwords for vnc
4. sudo systemctl enable x11vnc (so that this starts up at boot)
5. sudo systemctl start x11vnc

Re: Installing x11vnc

Posted: Fri 11 Oct 11 2019 12:18 am
by Daniel Wee
This presumes placing the password in the /etc/init/x11vnc.pass file with the command:-

sudo x11vnc -storepasswd xxxxxxx /etc/init/x11vnc.pass

Re: Installing x11vnc

Posted: Mon 28 Oct 28 2019 7:07 pm
by Daniel Wee
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

Re: Installing x11vnc

Posted: Mon 28 Oct 28 2019 7:21 pm
by Daniel Wee
This might help get display :0 on headless setups

https://fabianlee.org/2018/10/14/ubuntu ... ver-hosts/

Re: Installing x11vnc

Posted: Mon 28 Oct 28 2019 10:20 pm
by Daniel Wee
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

Re: Installing x11vnc

Posted: Mon 28 Oct 28 2019 10:24 pm
by Daniel Wee
Prior to anything working, you will need to ensure that:-

echo $DISPLAY

actually returns something like "localhost 0:0"

xhost

should also return something

Re: Installing x11vnc

Posted: Mon 28 Oct 28 2019 10:42 pm
by Daniel Wee

Re: Installing x11vnc

Posted: Mon 28 Oct 28 2019 11:50 pm
by Daniel Wee
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

Re: Installing x11vnc

Posted: Wed 01 Jul 01 2020 10:34 pm
by Daniel Wee
This gives a working setup with lightdm:
https://www.crazy-logic.co.uk/projects/ ... en-sharing

This one is interesting in that it covers headless setups and also provides a gdm3 solution.
https://lxtreme.nl/blog/headless-x11/

Switching between lightdm and gdm3 can be done using:-

sudo dpkg-reconfigure gdm3