RPiVNCHowTo icon indicating copy to clipboard operation
RPiVNCHowTo copied to clipboard

Connection has been gracefully closed

Open davthomaspilot opened this issue 3 years ago • 50 comments

I get this message when I tried to connect to either 5901 or 5902 using a tightvnc client.

Connection has been gracefully closed

The services are running ok

● xvnc1.socket - XVNC Server 1
     Loaded: loaded (/etc/systemd/system/xvnc1.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Fri 2023-01-20 17:07:44 EST; 5min ago
     Listen: [::]:5901 (Stream)
   Accepted: 2; Connected: 0;
      Tasks: 0 (limit: 779)
        CPU: 12ms
     CGroup: /system.slice/xvnc1.socket

Jan 20 17:07:44 raspberrypi systemd[1]: Listening on XVNC Server 1.

● xvnc2.socket - XVNC Server 2
     Loaded: loaded (/etc/systemd/system/xvnc2.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Fri 2023-01-20 17:07:44 EST; 5min ago
     Listen: [::]:5902 (Stream)
   Accepted: 0; Connected: 0;
      Tasks: 0 (limit: 779)
        CPU: 3ms
     CGroup: /system.slice/xvnc2.socket

Jan 20 17:07:44 raspberrypi systemd[1]: Listening on XVNC Server 2
```.

I got this running on a 32 bit Bullseye rpi just last week.   I recall I initially had this same issue, but I just can't recall what I did to fix it.  Maybe played around with /boot/config.txt for display resolution.

Does the display resolution specified with -geometry need to be less than what's specified by the mode in /boot/config.txt.  If so, what do I use for a mode that is just 1080p (no horizontal resolution indicated).

davthomaspilot avatar Jan 20 '23 22:01 davthomaspilot

Easy question first: The resolutions using these virtual desktops have literally nothing to do with the resolution of the console display. These are virtual desktops, so can have any resolution you want. However, they will not enjoy the hardware acceleration that VNC on the console gets. This may or may not be an issue for you, depending on what you're trying to run.

As far as the problem you're having...can you please provide some additional information:

  • system log showing the connection and disconnection
  • What display manager are you using? (lightdm, xdm, etc)
  • For that display manager, did you do the configuration as noted in the README?

I've probably forgotten something, but that should be enough to get started in chasing down this issue for you.

gitbls avatar Jan 20 '23 23:01 gitbls

  • Journal begins at Wed 2022-09-21 23:17:24 EDT, ends at Fri 2023-01-20 19:19:52 EST. -- Jan 20 19:13:24 raspberrypi kernel: Booting Linux on physical CPU 0x0000000000 [0x410fd034] Jan 20 19:13:24 raspberrypi kernel: Linux version 5.15.84-v8+ (dom@buildbot) (aarch64-linux-gnu-gcc-8 (Ubuntu/Linaro 8.> Jan 20 19:13:24 raspberrypi kernel: random: crng init done Jan 20 19:13:24 raspberrypi kernel: Machine model: Raspberry Pi 3 Model B Plus Rev 1.3 Jan 20 19:13:24 raspberrypi kernel: efi: UEFI not found. Jan 20 19:13:24 raspberrypi kernel: Reserved memory: created CMA memory pool at 0x000000001ec00000, size 256 MiB Jan 20 19:13:24 raspberrypi kernel: OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool Jan 20 19:13:24 raspberrypi kernel: Zone ranges: Jan 20 19:13:24 raspberrypi kernel: DMA [mem 0x0000000000000000-0x000000003b3fffff] Jan 20 19:13:24 raspberrypi kernel: DMA32 empty Jan 20 19:13:24 raspberrypi kernel: Normal empty Jan 20 19:13:24 raspberrypi kernel: Movable zone start for each node Jan 20 19:13:24 raspberrypi kernel: Early memory node ranges Jan 20 19:13:24 raspberrypi kernel: node 0: [mem 0x0000000000000000-0x000000003b3fffff] Jan 20 19:13:24 raspberrypi kernel: Initmem setup node 0 [mem 0x0000000000000000-0x000000003b3fffff] Jan 20 19:13:24 raspberrypi kernel: On node 0, zone DMA: 19456 pages in unavailable ranges Jan 20 19:13:24 raspberrypi kernel: percpu: Embedded 28 pages/cpu s77336 r8192 d29160 u114688 Jan 20 19:13:24 raspberrypi kernel: pcpu-alloc: s77336 r8192 d29160 u114688 alloc=28*4096 Jan 20 19:13:24 raspberrypi kernel: pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 Jan 20 19:13:24 raspberrypi kernel: Detected VIPT I-cache on CPU0 Jan 20 19:13:24 raspberrypi kernel: CPU features: kernel page table isolation forced ON by KASLR Jan 20 19:13:24 raspberrypi kernel: CPU features: detected: Kernel page table isolation (KPTI) Jan 20 19:13:24 raspberrypi kernel: CPU features: detected: ARM erratum 843419 Jan 20 19:13:24 raspberrypi kernel: CPU features: detected: ARM erratum 845719 Jan 20 19:13:24 raspberrypi kernel: Built 1 zonelists, mobility grouping on. Total pages: 238896 Jan 20 19:13:24 raspberrypi kernel: Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_als> Jan 20 19:13:24 raspberrypi kernel: Unknown kernel command line parameters "splash", will be passed to user space. Jan 20 19:13:24 raspberrypi kernel: Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear) Jan 20 19:13:24 raspberrypi kernel: Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear) Jan 20 19:13:24 raspberrypi kernel: mem auto-init: stack:off, heap alloc:off, heap free:off Jan 20 19:13:24 raspberrypi kernel: Memory: 665532K/970752K available (11520K kernel code, 1956K rwdata, 4136K rodata, > Jan 20 19:13:24 raspberrypi kernel: SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 Jan 20 19:13:24 raspberrypi kernel: ftrace: allocating 38065 entries in 149 pages Jan 20 19:13:24 raspberrypi kernel: ftrace: allocated 149 pages with 4 groups Jan 20 19:13:24 raspberrypi kernel: trace event string verifier disabled Jan 20 19:13:24 raspberrypi kernel: rcu: Preemptible hierarchical RCU implementation. Jan 20 19:13:24 raspberrypi kernel: rcu: RCU event tracing is enabled.

lightdm

I connect fine to 5900 if I start x11vnc server

I do see this in /var/log/syslog after trying to connect and getting the "gracefully closed" message on the client. Note, there's a message in there saying the connection was succcessful

Jan 20 19:17:01 raspberrypi CRON[1442]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) Jan 20 19:19:03 raspberrypi systemd[1]: Started Session 5 of user pi. Jan 20 19:22:32 raspberrypi systemd[1]: Created slice system-xvnc2.slice. Jan 20 19:22:32 raspberrypi systemd[1]: Started XVNC Per-Connection Daemon 2 (192.168.0.113:56405). Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: Unrecognized option: -noreset Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: use: X [:] [option] Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -a # mouse acceleration (pixels) Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -ac disable access control restrictions Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -audit int set audit trail level Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -auth file select authorization file Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: bc enable bug compatibility Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -bs disable any backing store support Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -c turns off key-click Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: c # key-click volume (0-100) Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -cc int default color visual class Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -co file color database file Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -core generate core dump on fatal error Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -dpi int screen resolution in dots per inch Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -f # bell base (0-100) Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -fc string cursor font Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -fn string default font name Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -fp string default font path Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -help prints message with these options Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -I ignore all remaining arguments Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -ld int limit data space to N Kb Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -lf int limit number of open files to N Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -ls int limit stack space to N Kb Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -nolock disable the locking mechanism Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -logo enable logo in screen saver Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: nologo disable logo in screen saver Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -nolisten string don't listen on protocol Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -p # screen-saver pattern duration (minutes) Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -pn accept failure to listen on all ports Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -nopn reject failure to listen on all ports Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -r turns off auto-repeat Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: r turns on auto-repeat Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -s # screen-saver timeout (minutes) Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -su disable any save under support Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -t # mouse threshold (pixels) Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -terminate terminate at server reset Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -to # connection time out Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -tst disable testing extensions Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: ttyxx server started from init on /dev/ttyxx Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: v video blanking for screen-saver Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -v screen-saver without video blanking Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -wm WhenMapped default backing-store Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -x string loads named extension at init time Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -query host-name contact named host for XDMCP Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -broadcast broadcast for XDMCP Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -indirect host-name contact named host for indirect XDMCP Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -port port-num UDP port number to send messages to Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -once Terminate server after one session Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -class display-class specify display class to send in manage Jan 20 19:22:32 raspberrypi systemd[1]: [email protected]:5902-192.168.0.113:56405.service: Succeeded. Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -cookie xdm-auth-bits specify the magic cookie for XDMCP Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -displayID display-id manufacturer display ID for request Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -geometry WxH set framebuffer width & height Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -depth D set framebuffer depth Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -pixelformat format set pixel format (BGRnnn or RGBnnn) Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -udpinputport port UDP port for keyboard/pointer data Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -rfbport port TCP port for RFB protocol Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -rfbwait time max time in ms to wait for RFB client Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -nocursor don't put up a cursor Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -rfbauth passwd-file use authentication on RFB protocol Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -httpd dir serve files via HTTP from here Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -httpport port port for HTTP Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -deferupdate time time in ms to defer updates (default 40) Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -economictranslate less memory-hungry translation Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -lazytight disable "gradient" filter in tight encoding Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -desktop name VNC desktop name (default x11) Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -alwaysshared always treat new clients as shared Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -nevershared never treat new clients as shared Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -dontdisconnect don't disconnect existing clients when a new non-shared Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: connection comes in (refuse new connection instead) Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -viewonly let clients only to view the desktop Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -localhost only allow connections from localhost Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -interface ipaddr only bind to specified interface address Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -inetd Xvnc is launched by inetd Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -compatiblekbd set META key = ALT key as in the original VNC Jan 20 19:22:32 raspberrypi Xtightvnc[1481]: -version report Xvnc version on stderr

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

For that display manager, did you do the configuration as noted in the README?

Yes, triple checked.

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

Something appears to be wrong in the file /etc/systemd/system/xvnc2.service. Please post the contents of that file. Port 5900 and x11vnc are completely different animals from these virtual VNC sessions, btw.

Also, did you install tightvnc server or tigervnc server?

And what distro/version is this on?

gitbls avatar Jan 21 '23 00:01 gitbls

Understand about them being different--just mentioned because that says it's not an issue with the client or specifying the wrong host.

[Unit] Description=XVNC Per-Connection Daemon 2

[Service] ExecStart=-/usr/bin/Xtightvnc -noreset -SecurityTypes None -inetd -query 127.0.0.1 -geometry 1880x920 -pn -once StandardInput=socket StandardOutput=socket StandardError=journal

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

Just noticed it's Xtightvnc, not Tiger. I just used your script to generate those files.

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

And yes, I installed Tigervnc. Changing the files to use it and trying over.

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

sudo apt-get install tigervnc-standalone-server xfonts-scalable xfonts-100dpi xfonts-75dpi Reading package lists... Done Building dependency tree... Done Reading state information... Done tigervnc-standalone-server is already the newest version (1.11.0+dfsg-2+deb11u1). xfonts-100dpi is already the newest version (1:1.0.4+nmu1.1). xfonts-75dpi is already the newest version (1:1.0.4+nmu1.1). xfonts-scalable is already the newest version (1:1.0.3-1.2). The following package was automatically installed and is no longer required: libfuse2 Use 'sudo apt autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 18 not upgraded. p

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

You can fix this by sudo editing /etc/systemd/system/xvnc*.service and either

  • Changing Xtightvnc to XtigerVNC
  • OR leave it as Xtightvnc and remove the '-noreset'

Was just going to write that I don't understand how you got to this state, but I see that the script will do this if BOTH tightvnc and tigervnc happen to be installed when you run the script.

I'll think about how to fix it. in the meantime, make one of the 2 changes I suggested above.

gitbls avatar Jan 21 '23 00:01 gitbls

Ah--looks like whatever is installed LAST is what gets set up in the files your script copies

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

Yeah, quite familiar with using systemctl, systemd, etc.

Rebooting now--pretty sure it will work. I

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

Not quite. If both are installed it will use tightvnc but have the wrong switches enabled. The fix is twofold:

  • Clear the extra switch settings if tightvnc
  • If both tigervnc and tightvnc are installed, figure out which one to use by asking user.

gitbls avatar Jan 21 '23 00:01 gitbls

Yeah, I redid the script, rebooted, same problem, but it still had Xtightvnc in the /etc/systemd/system stuff.

Trying removing the -noreset now. Tiger versus tight--just the fonts thing to worry about?

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

Removing the -norest didn't fix. Switching to tigervncserver

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

Yeah, I redid the script, rebooted, same problem, but it still had Xtightvnc in the /etc/systemd/system stuff.

Trying removing the -noreset now. Tiger versus tight--just the fonts thing to worry about?

I actually don't have the font problem any more. I use a different font for my xterms, and tbh I haven't tested tightvnc in quite some time.

FYI, here's the font I use now for my xterms: -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso10646-1

gitbls avatar Jan 21 '23 00:01 gitbls

Removing the -norest didn't fix. Switching to tigervncserver

That should fix it. Check the system log. The problem should be obvious there. If it's not, heave it here and I'll have a look at it.

gitbls avatar Jan 21 '23 00:01 gitbls

Ok, thanks for the super fast attention! Quite impressed!

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

Tiger works fine. I'll check out tight tomorrow and post what happens.

Thanks!

davthomaspilot avatar Jan 21 '23 00:01 davthomaspilot

Ok, thanks for the super fast attention! Quite impressed!

That's what happens if you catch me at my desk 🤣

gitbls avatar Jan 21 '23 00:01 gitbls

Tiger works fine. I'll check out tight tomorrow and post what happens.

Thanks!

Great...got you unstuck, and you understand the issue. I'll get back to fixing the script soon....

gitbls avatar Jan 21 '23 00:01 gitbls

Verified it works with Xtightvnc also.

Do you see a difference in performance between Xtightvnc and Xtigervnc? Also, is significant system resource used if there are xnvc socket/service pairs created and enabled, but nothing is connected to them?

davthomaspilot avatar Jan 28 '23 14:01 davthomaspilot

Also, this package seems to target users who may not be comfortable with editing systemd files.

I was expecting the xnvc sessions to be started at user level, not root. I think that's the more typical usage case. If you don't want to add User= and Group= to the created systemd files, you might want to mention how to manually change them to have the sessions run under a specified user.

I'm now trying to figure out why the Qt widgets that normally display on :0 aren't showing up on 5900--I can connect to it with no problem and see a desktop, but not my GUI application widgets.

davthomaspilot avatar Jan 28 '23 15:01 davthomaspilot

Ah, great to hear. I think tightvnc and tigervnc are fairly comparable performance-wise, but I've not seen any performance data to confirm/deny this.

The really cool thing about this method is that the cost of them when they are not being used is literally a systemd open socket. systemd listens on the socket specified in the .socket file, and fires up the corresponding service when a connection is received.

Contrast that with other methods of starting virtual VNC servers that leave the vncserver running all the time, consuming system resources, or require that you start it manually, which is a pain.

gitbls avatar Jan 28 '23 15:01 gitbls

Also, this package seems to target users who may not be comfortable with editing systemd files.

I was expecting the xnvc sessions to be started at user level, not root. I think that's the more typical usage case. If you don't want to add User= and Group= to the created systemd files, you might want to mention how to manually change them to have the sessions run under a specified user.

I'm now trying to figure out why the Qt widgets that normally display on :0 aren't showing up on 5900--I can connect to it with no problem and see a desktop, but not my GUI application widgets.

What is the reason you'd want these to start as a user other than root? Have you tried it to verify that it works?

gitbls avatar Jan 28 '23 15:01 gitbls

When I do

echo $DISPLAY

I get

ip_addr:1.0

and

ipaddr:2.0

With .socket files that look like this:

[Unit]
Description=XVNC Server 0

[Socket]
ListenStream=5900
Accept=yes

[Install]
WantedBy=sockets.target

Maybe I can get my GUI to ouput on 1:0 and 2:0, but now it outputs to 0:0.

Can I change what displays the vnc servers are using?

davthomaspilot avatar Jan 28 '23 15:01 davthomaspilot

When I do

echo $DISPLAY

I get

ip_addr:1.0

and

ipaddr:2.0

With .socket files that look like this:

[Unit]
Description=XVNC Server 0

[Socket]
ListenStream=5900
Accept=yes

[Install]
WantedBy=sockets.target

Maybe I can get my GUI to ouput on 1:0 and 2:0, but now it outputs to 0:0.

Can I change what displays the vnc servers are using?

Your code should be independent of the setting for $DISPLAY. It should use whatever DISPLAY is set to, not try to jam it to a specific setting. The value of DISPLAY for vnc sessions corresponds to the port number (:1 would be 5901, :2 would be 5902, etc). So, the only way to change the setting of DISPLAY is to change the port number. 5900 is used by RealVNC for the console (which also happens to be :0). If you aren't using RealVNC on your system, you can rejigger the xvnc port number for one of the sessions (a bit messy, but doable), but you will have created a very brittle, likely to break solution IMHO.

gitbls avatar Jan 28 '23 15:01 gitbls

Port number isn't the issue--it's the server number (not sure if that's the right terminology).

There are two parts of the $DISPLAY, eg. 0.0 or 1.0.

The number to the right of the decimal point is the port. The one to the left is the XServer number.

It's really not my code, but rather the Qt framework. It will attempt to connect to whatever DISPLAY is specified by the DISPLAY environment variable. Normally, 0:0 (or 0:1), etc.

The servers that get created using systemd are like 1:0, 1:1, etc.

For whatever reason, I get a message from the app saying it cannot connect to server when I try DISPLAY=1:0. I'm researching how to change that, but it seems there should be a way to start as server 0:0 or 0:1 instead of 1:0 or 1:1.

davthomaspilot avatar Jan 28 '23 16:01 davthomaspilot

Also, this package seems to target users who may not be comfortable with editing systemd files. I was expecting the xnvc sessions to be started at user level, not root. I think that's the more typical usage case. If you don't want to add User= and Group= to the created systemd files, you might want to mention how to manually change them to have the sessions run under a specified user. I'm now trying to figure out why the Qt widgets that normally display on :0 aren't showing up on 5900--I can connect to it with no problem and see a desktop, but not my GUI application widgets.

What is the reason you'd want these to start as a user other than root? Have you tried it to verify that it works?

The usual reasons one should avoid running code as root. For example, opening a terminal window from the desktop would allow deletion of ANY files.

Or, am I missing something?

davthomaspilot avatar Jan 28 '23 16:01 davthomaspilot

When I use x11vnc, I can always see the output of my Qt application. Which port I use doesn't matter--it just determines what the client uses for connection.

I can start an x11vnc session while two Xtightvnc sessions are running that were started by the system service. When I connect to the port associated with the x11vnc, I see a desktop with my application output, but client connections to either of the two Xtightvnc servers shows only the desktop.

davthomaspilot avatar Jan 28 '23 16:01 davthomaspilot

Expanding on the last post---

Two Xtightvnc servers get started via the systemd mechanism, ports 5900 and 5901.

I can connect to either of them and see a desktop, but not the output from my Qt app.

I can then start an x11vnc session on the host and connect with vnc client to 5902. The expected graphical output is shown.

davthomaspilot avatar Jan 28 '23 17:01 davthomaspilot