I have a computer with an attached display starting a Java application via startx.

Now I want to access the application remotely via VNC. Is it possible to open a x11vnc session for one Xorg window? (Without window manager)

# x11vnc -display :1
12/11/2019 13:31:53 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 2759
No protocol specified
12/11/2019 13:31:53 XOpenDisplay(":1") failed.
12/11/2019 13:31:53 Trying again with XAUTHLOCALHOSTNAME=localhost ...
No protocol specified

12/11/2019 13:31:53 ***************************************
12/11/2019 13:31:53 *** XOpenDisplay failed (:1)

*** x11vnc was unable to open the X DISPLAY: ":1", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.
/bin/sh /usr/bin/startx /usr/bin/java -jar my.jar -- :1
 \_ xinit /usr/bin/java -jar my.jar -- /usr/bin/X :1 -auth /tmp/serverauth.XruRNQHDLk
      \_ /usr/lib/xorg/Xorg :1 -auth /tmp/serverauth.XruRNQHDLk
     \_ /usr/bin/java -jar my.jar

Edit: I found out, that running the startx command without my systemd service works perfectly fine with x11vnc. Now I struggle to attach the x11vnc server to my systemd startx service.

  • What user is the startx running as? Also root? – Eduardo Trápani Nov 12 '19 at 12:53
  • Yes startx is running as root. – Nortol Nov 12 '19 at 12:55
  • All the processes you can see are running as root – Nortol Nov 12 '19 at 12:55

You can add x11vnc to ~/.xinitrc or, even better, to ~/.xsession.

  • Thanks you. I edited the initial post because the problem shifted. – Nortol Nov 12 '19 at 13:49

The problem was the systemd service. I changed my service to start with the runuser command. (Both x11vnc and startx)

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.