I have a small server hooked up to a projector and recently upgraded from Ubuntu 18 to Ubuntu 22. There were some issues at first with screensharing via x11vnc but after some tinkering and disabling wayland I was able to get it working.
The issue I'm having is that when the projector is turned off, the screen sharing no longer works. I seem to connect and I can see application windows, but the desktop background flashes between an image and a black screen and none of my input works. There is no lock screen configured and I have an active logged-in user session with a graphical desktop. On the old system this worked and I could still control the screen whether or not the projector/monitor was turned on. I suspect it might have something to do with changing from lightdm to gdm.
The command and options I'm running specifically are:
x11vnc -xkb -noxrecord -noxdamage -avahi -allinput -rfbauth /etc/x11vnc.pass -forever -rfbport 5900 -display :0
I don't see any error in the journal logs Example::
Dec 22 19:02:24 hm80 x11vnc[4969]: 22/12/2022 19:02:24 Got connection from client 192.168.0.17
Dec 22 19:02:24 hm80 x11vnc[4969]: 22/12/2022 19:02:24 0 other clients
Dec 22 19:02:25 hm80 x11vnc[4969]: 22/12/2022 19:02:25 Normal socket connection
Dec 22 19:02:25 hm80 x11vnc[4969]: 22/12/2022 19:02:25 Disabled X server key autorepeat.
Dec 22 19:02:25 hm80 x11vnc[4969]: 22/12/2022 19:02:25 to force back on run: 'xset r on' (3 times)
Dec 22 19:02:25 hm80 x11vnc[4969]: 22/12/2022 19:02:25 incr accepted_client=9 for 192.168.0.17:58992 sock=8
Dec 22 19:02:25 hm80 x11vnc[4969]: 22/12/2022 19:02:25 Client Protocol Version 3.3
Dec 22 19:02:25 hm80 x11vnc[4969]: 22/12/2022 19:02:25 Protocol version sent 3.3, using 3.3
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 Got connection from client 192.168.0.17
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 1 other clients
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 Normal socket connection
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 incr accepted_client=10 for 192.168.0.17:58993 sock=10
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 client_count: 1
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 Client 192.168.0.17 gone
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 Statistics events Transmit/ RawEquiv ( saved)
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 TOTALS : 0 | 0/ 0 ( 0.0%)
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 Statistics events Received/ RawEquiv ( saved)
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 TOTALS : 0 | 0/ 0 ( 0.0%)
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 Client Protocol Version 3.3
Dec 22 19:02:27 hm80 x11vnc[4969]: 22/12/2022 19:02:27 Protocol version sent 3.3, using 3.3
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 Enabling full-color cursor updates for client 192.168.0.17
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000450)
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000044C)
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 Enabling NewFBSize protocol extension for client 192.168.0.17
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000044D)
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000451)
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000044E)
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 Using zlib encoding for client 192.168.0.17
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 Pixel format for client 192.168.0.17:
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 32 bpp, depth 32, little endian
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 Enabling full-color cursor updates for client 192.168.0.17
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000450)
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000044C)
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 Enabling NewFBSize protocol extension for client 192.168.0.17
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000044D)
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000451)
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x0000044E)
Dec 22 19:02:28 hm80 x11vnc[4969]: 22/12/2022 19:02:28 Switching from zlib to zlib Encoding for client 192.168.0.17
Dec 22 19:02:29 hm80 x11vnc[4969]: 22/12/2022 19:02:29 client_set_net: 192.168.0.17 0.0031
Dec 22 19:02:34 hm80 x11vnc[4969]: 22/12/2022 19:02:34 client 10 network rate 112.6 KB/sec (6333.6 eff KB/sec)
Dec 22 19:02:34 hm80 x11vnc[4969]: 22/12/2022 19:02:34 client 10 latency: 1136.2 ms
Dec 22 19:02:34 hm80 x11vnc[4969]: 22/12/2022 19:02:34 dt1: 1.3067, dt2: 0.0046 dt3: 1.1362 bytes: 147693
Dec 22 19:02:34 hm80 x11vnc[4969]: 22/12/2022 19:02:34 link_rate: LR_DIALUP - 1136 ms, 112 KB/s
What I can do to get this working again?