Why do both x11vnc and x0vncserver fail in similar ways in Gnome Ubuntu 22.04?

I’d like to be able to login to my remote Ubuntu 22.04 and see the Desktop as shown on that machine. (I know how to create a vncserver with a separate desktop instance). I have separate problems with the built-in Remote Desktop, so this is specifically about x11vnc and x0vncserver.

They have worked fine for me for years on 18.04 under Xfce.

Now on 22.04, they fail in similar ways, so I suspect this is really a Gnome or Xorg (or – is Compiz even a thing any more?) problem. This suspicion is made stronger by the fact that it works fine using gnome-session-flashback.

I have fiddled with many options for both x11vnc and x0vncserver, but my problem remains.

Short version: When I move a window, I see both the original window in its original position and the window in the new position. And perhaps a window or two in the path that the window was moved. E.g. here I started with a single terminal:

original single window

Then I moved the window:

Moved window

Only the bottom-right one is interactive…

Now the trick… If I stop both the client and the vnc server, and start different client and vncservers, the move artifacts remain. Here is a reproduction recipe (here, "client" is the Debian machine running the vnc client, "server" is the Ubuntu 22.04 machine running a vnc server):

  • Start with a freshly rebooted server.
  • Connect the first time
    • Start x11vnc -usepw -display :0 -forever -rfbport 5901 on the server
    • Connect with Remmina from the client
    • In the vnc client:
      • See one window (first screenshot above)
      • Move the window
      • See two or more windows (second screenshot above)
    • Kill the Remmina client
    • Kill the x11vnc server process
  • Connect a second time
    • Start x0vncserver -rfbport=5901 -PasswordFile=/home/peter/.vnc/passwd -display=:0 -fg on the server
    • Connect with xtigervncviewer to the client
    • See two or more windows!!! The original already-moved window is still there. The "old position artifact" remains (but looks a little different notice that top-right is actually two overlapping windows):

second vnc connection

So somehow the history of the original window position is stored on the server and survives an x11vnc/x0vncserver restart. Which leads me to believe that this really is a Gnome/Xorg/Compiz problem.

Edit: Additional data points

  • I tried installing gnome-session-flashback and when using a flashback session x11vnc works as I expect. But I don’t actually want to run gnome-session-flashback forever. I expect (but haven’t tested) that e.g. XFCE will work fine too.

  • I’m using the open source amdgpu driver for my Advanced Micro Devices, Inc. [AMD/ATI] Baffin [Radeon RX 550 640SP / RX 560/560X] [1002:67ff] (rev ff) graphcis card. I tried installing and using the AMD proprietary drivers, and it made no difference.

  • It also works fine in a VirtualBox virtual machine, that obviously doesn’t use the AMD graphics drivers.

Has anybody seen something like this before? And knows how to fix it?

Asked By: Peter V. Mørch


It turns out this was because I am using a KVM switch. I have one desktop running x11vnc and another (a laptop) with the VNC client. Every time I used the laptop I did so by switching the KVM switch to show the laptop, which disconnects the monitor from the machine running x11vnc.

If I leave the KVM switch on the x11vnc1 machine and use the laptop’s screen to run the VNC client, all is well. As soon as I switch the KVM switch away from the x11vnc server, the problem appears.

I’ve filed: LibVNC/x11vnc#234: "x11vnc has display artifacts and works slowly if monitor is disconnected or used with a KVM switch." for this.

And I plan on working around this problem with an EDID Emulator. I’ve ordered this one. It hopefully lets the computer think the display is still attached. And then next time I update the KVM switch, get one with a built-in EDID emulator. I’ll try to remember to update this thread when the EDID emulator arrives and I’ve tried it out.

Answered By: Peter V. Mørch
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.