0

I am able to start x11vnc with the following command line as my user, but if I start it as sudo or a startup service I get an error message "XOpenDisplay("") failed."

/usr/bin/x11vnc -auth guess -forever -bg -rfbport 5900 -xkb -noxrecord -noxfixes -noxdamage -shared -norc -auth /home/lorensimon/.Xauthority -display :0 -rfbauth /etc/x11vnc.pass

0

It is currently not possible to use x11vnc on Ubuntu 17.10 if you use the Wayland DM. Various issues about security and exposing interfaces for frame grabbing.

References: [https://lists.freedesktop.org/archives/wayland-devel/2017-July/034551.html][1]

You can disable Wayland and implicitly enable x11 and it will work fine. I have tested this on a fresh installation of Ubuntu Desktop 17.10

#Bash
#UD17.10ARTFUL
MYFILE=/etc/gdm3/custom.conf
sed --in-place --expression "s/^#WaylandEnable=false/WaylandEnable=false/g" ${MYFILE}
grep 'WaylandEnable' ${MYFILE}

#Logout/Login the Ubuntu Desktop session

# A quick test (you must add the security yourself)
x11vnc -display :0 -auth /var/run/lightdm/root/:0 -shared

@note It is also possible to login with X11, instead of Wayland, on the login screen (click the cog button) but that button is not always visible on various hardware.

I would also recommend to install & make the latest DEVelopment version x11vnc-0.9.14-dev instead of the package from the standard Ubuntu repository.

My general advice is actually to stay with Ubuntu 16 LTS or Ubuntu 17.04 because Wayland has lots of compat issues.

Let me know how it goes.

  • Hi Rolf, I wish I had stayed on Ubuntu 16, as it would have saved me quite some troubleshooting. Anyway, I was able to solve the problem by switching to xorg at login (as you suggested), and specifing my user in the x11vnc service script. Thanks for pointing me in the right direction. – larrysimon Dec 4 '17 at 3:55
  • Great. Would you accept my answer? – Rolf Dec 4 '17 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.