Trouble with VNC: don't want session management

I’m trying to get VNC going on openSUSE 15.6. So, I used the YaST Control Center to launch “Remote Administration (VNC)”. The UI shows three choices, but none of them work for me:

  1. “Allow Remote Administration With Session Management”: choose this and my remote VNC client gets stuck at a black screen. The log shows lots of messages (included below), but I can’t see anything that points to a solution.
  2. “Allow Remote Administration Without Session Management”: choose this and my remote VNC client shows a login page (not really what I want), and when I try to login I get a “Multiple logins are not supported” error message (not good). Nothing useful shown in /var/log/messages.
  3. “Do Not Allow Remote Administration”: choose this and there’s no VNC port open (not surprising)

I suspect that “Session Management” is the system which allows multiple independent graphical logins to the system. Entertaining, but I’d rather not have that unless it’s necessary; I just want to interact with the local monitor’s screen. So, debugging the above option 1 may not be the way to go; I should be using some other approach.

So, questions:

  • Is this the right way for me to enable VNC?
  • Is there a way for me to just let VNC connect to the current screen rather than starting a new session?
  • Is there more information I can collect to help figure this out?

Notes:

  • I’m rebooting the machine after each change, Just In Case
  • My VNC client is tunneling over SSH
  • I have the firewall disabled, which the “Remote Administration” tool confirms
  • I have AppArmor disabled
  • Other than the above, the system is fairly vanilla (I installed a clean copy of openSUSE 15.6 yesterday)
  • Running sudo yast2 shows me a character UI; if choose “Remote Administration” I get the same options as above
  • I haven’t tried “Enable access with a web browser”, and would rather not

Thanks,
Dan

P.S. I tried including the messages in /var/log/messages when connecting with “With Session Management” enabled, but it was too big. It’s here:

Happy for suggestions on how to better include it…

You need DM which supports XDMCP and you need to enable XDMCP.

It does not matter whether you find it good or not. That is what the modern Linux desktops do. You cannot have two concurrent (graphical) sessions for the same user.

So, rather than VNC, I should use an X11 client? Or did you mean something else?

I wasn’t being judgy; it’s just that if I can’t login via VNC then it isn’t useful to me. But, I just discovered if I ssh in and kill the /usr/lib/systemd/systemd --user process that’s the basis for the locally logged-in user, then I can login remotely. Not great, but it’s an option. (Is there a better way to remotely logout the local user?)

Edit: I don’t seem to be able to get reliable remote login by quitting the local user.

vncserver starts Xvnc which is X11 server. vncmanager does it via display manager.

loginctl kill-session ...

So, right now I’m using Xvnc (as configured by YaST); I need to switch to vncmanager, right? How?

Well, that’s much cleaner than kill, and indeed with the local user (“seat0”) logged out I can sometimes login by VNC. But only sometimes; there seems to be some other factor that blocks the login, leaving the VNC client showing a black screen.

vncmanager is what is set up by YaST “Allow Remote Administration With Session Management”.

Problem: if I choose “With Session Management”, then I can connect, but I only get a black screen.

There are a lot of log messages output during the attempt. See LogforUnsuccessfulVNCConnection.txt - Google Drive for one highly verbose case, but I just tried again and got fewer messages (below). It looks like Xvnc is still being used, and the key error seems to be:

with-vnc-key.sh[4603]: Exception in thread of client 94321921742176: received unknown encoding!

However, I don’t think the problem is with my VNC client, as I can (sometimes) successfully log in with “Without Session Management” chosen.

Any ideas?

2025-02-06T10:54:32.947652-05:00 voltair-new sshd[6805]: Accepted publickey for devuser from 10.3.4.31 port 51342 ssh2: ECDSA SHA256:oSNF40hzSJTCUXv5MiIpfR5x4DGGkw0SNPIRXokTPTg
2025-02-06T10:54:32.954456-05:00 voltair-new systemd-logind[987]: New session 7 of user devuser.
2025-02-06T10:54:32.975939-05:00 voltair-new systemd[1]: Started Session 7 of User devuser.
2025-02-06T10:54:32.980895-05:00 voltair-new sshd[6805]: pam_unix(sshd:session): session opened for user devuser by (uid=0)
2025-02-06T10:54:32.983809-05:00 voltair-new with-vnc-key.sh[4603]: Accepted client 94321921742176.
2025-02-06T10:54:33.054541-05:00 voltair-new Xvnc[6813]: vncext: VNC extension running!
2025-02-06T10:54:33.054584-05:00 voltair-new Xvnc[6813]: vncext: inetd wait
2025-02-06T10:54:33.054609-05:00 voltair-new Xvnc[6813]: vncext: created VNC server for screen 0
2025-02-06T10:54:33.086847-05:00 voltair-new with-vnc-key.sh[4603]: Spawned Xvnc (id: #0, pid: 6813, display: 2)
2025-02-06T10:54:33.086906-05:00 voltair-new with-vnc-key.sh[4603]: Opening connection to Xvnc #0
2025-02-06T10:54:33.086925-05:00 voltair-new Xvnc[6813]: Connections: accepted: ::0
2025-02-06T10:54:33.087018-05:00 voltair-new Xvnc[6813]: SConnection: Client needs protocol version 3.8
2025-02-06T10:54:33.087032-05:00 voltair-new Xvnc[6813]: SConnection: Client requests security type None(1)
2025-02-06T10:54:33.087683-05:00 voltair-new Xvnc[6813]: VNCSConnST: Server default pixel format depth 24 (32bpp) little-endian rgb888
2025-02-06T10:54:33.179735-05:00 voltair-new Xvnc[6813]: VNCSConnST: Client pixel format depth 15 (16bpp) little-endian rgb555
2025-02-06T10:54:33.182068-05:00 voltair-new with-vnc-key.sh[4603]: Exception in thread of client 94321921742176: received unknown encoding!
2025-02-06T10:54:33.182168-05:00 voltair-new with-vnc-key.sh[4603]: Disconnected client 94321921742176.
2025-02-06T10:54:33.182224-05:00 voltair-new with-vnc-key.sh[4603]: Closing connection to Xvnc #0
2025-02-06T10:54:33.182274-05:00 voltair-new Xvnc[6813]: VNCSConnST: closing ::0: read: Connection reset by peer (104)
2025-02-06T10:54:33.182332-05:00 voltair-new Xvnc[6813]: EncodeManager: Framebuffer updates: 1
2025-02-06T10:54:33.182371-05:00 voltair-new Xvnc[6813]: EncodeManager:   Tight:
2025-02-06T10:54:33.182408-05:00 voltair-new Xvnc[6813]: EncodeManager:     Solid: 1 rects, 786.432 kpixels
2025-02-06T10:54:33.182443-05:00 voltair-new Xvnc[6813]: EncodeManager:            15 B (1:104858 ratio)
2025-02-06T10:54:33.182477-05:00 voltair-new Xvnc[6813]: EncodeManager:   Total: 1 rects, 786.432 kpixels
2025-02-06T10:54:33.182513-05:00 voltair-new Xvnc[6813]: EncodeManager:          15 B (1:104858 ratio)
2025-02-06T10:54:33.182572-05:00 voltair-new Xvnc[6813]: Connections: closed: ::0
2025-02-06T10:54:33.182610-05:00 voltair-new Xvnc[6813]: ComparingUpdateTracker: 0 pixels in / 0 pixels out
2025-02-06T10:54:33.182644-05:00 voltair-new Xvnc[6813]: ComparingUpdateTracker: (1:-nan ratio)
2025-02-06T10:54:33.282591-05:00 voltair-new sshd[6805]: pam_unix(sshd:session): session closed for user devuser
2025-02-06T10:54:33.284477-05:00 voltair-new systemd[1]: session-7.scope: Deactivated successfully.
2025-02-06T10:54:33.312876-05:00 voltair-new systemd-logind[987]: Session 7 logged out. Waiting for processes to exit.
2025-02-06T10:54:33.314225-05:00 voltair-new systemd-logind[987]: Removed session 7.

What display manager are you using?

I’m using Gnome.

It is desktop environment. What display manager?

I briefly tested with lightdm and it just works. No manual configuration needed. And if I explicitly disable XDMCP, I get black screen after pressing “New Session”.

I’m using the default (gdm). Should I switch to lightdm and enable XDMCP?

BTW, the system needs to display web pages using chromium; does the display manager matter for that?

I expect gdm should work. I do not have Leap with GNOME, testing on Tumbleweed it also works with gdm. You may need to explicitly disable Wayland in custom.conf though (it did not work in the default configuration, I got a black screen).

It is automatically enabled by YaST in this case. You do need to restart display manager to activate this setting though. You may check with

ss -lu

if something listens on xdmcp port.

Of course, you can also try lightdm. It is more lean and does not have as many components and dependencies as gdm.

(Side note, arvidjaar: thank you for all the replies; you’ve been extremely helpful.)

I disabled Wayland (by uncommenting #WaylandEnable=false in /etc/gdm/custom.conf) and then rebooted. Now, whether I choose “With Session Management” or “Without Session Management” (rebooting between each change), I get a “Multiple logins are not supported” error message. So, I guess that’s progress.

I tried sudo loginctl kill-session 1 (where 1 was from the list printed when just running loginctl). The local user logged out, showing the user choices screen (good), but when I tried logging in via VNC on an existing connection, I got the same “not supported” error message. If I closed VNC and then reopened it, I just get the black screen.

However, if I logout the local user using the local mouse and the power menu, then I can connect and login via VNC (!). I can then logout via VNC and then log back in on the local user. But, after a few tries VNC stops working, going back to the black screen.

FYI, every time I try to connect VNC, and get the black screen, I get another entry in the loginctl output. Here is with the local user logged out, and three failed attempts to connect via VNC:

devuser@product-new:~> loginctl
SESSION  UID USER    SEAT  TTY   STATE  IDLE SINCE
     14 1000 devuser       pts/0 active no        
    c23  458 gdm     seat0 tty7  active no        
    c24  458 gdm           n/a   active no        
    c25  458 gdm           n/a   active no        
    c26  458 gdm           n/a   active no        

5 sessions listed.
devuser@product-new:~> 

I then closed the (black) VNC window and logged in the local user: those extra entries disappeared. I then tried VNC again, and got the login screen (but couldn’t login).

After much experimentation but no change of configuration, I’ve figured out the following way of connecting via VNC:

  1. Reboot the machine, and wait for the local user to automatically login
  2. Connect via VNC, but stop when I see the login screen
  3. Logout the local user (using sudo loginctl kill-session <#>)
  4. Once the local user has logged out, login on the existing VNC connection

But, I must make the initial connection while the local user is still logged in. And, once I logout on VNC, I must reboot before I can connect again.

So, I need one or more of the following:

  • Allow VNC to connect and become a second, independent user when the local user is logged in
  • Allow VNC to connect and becomes a second view into the local user (sharing the screen)
  • Not have disconnecting VNC break VNC

Thanks,
Dan

P.S. Am I one of the few remaining VNC users? It used to be easy to set up, but in recent years it’s gotten harder and harder, which doesn’t make sense if it’s a popular tool.

Did you test lightdm?

Disable automatic logon and log in as any user you want.

GNOME has native support for screen sharing. If for some reason you do not want to use it - x0vncserver, vnc module of Xorg server, x11vnc to name the few.

That’s not VNC but vncmanager. You are not forced to use it or YaST. Just start Xvnc as e.g. systemd service. That is what the current TigerVNC (upstream and Tumbleweed) does anyway. You can look at TigerVNC sources for inspiration.

And if you do use vncmanager - it has vncmanager-controller to mark the session as persistent.

Thank you for all your help. I tried your suggestions, as well as a bunch more found elsewhere, and kept hitting various brick walls. After probably three days trying to get this going, it’s time to stop; I have to get going on my actual development.

<rant>
Why the heck is this so hard? A decade or so ago this was easy; now it’s a complete bottomless pit, even when using a clean openSUSE installation. Screen sharing must be on the list of Capabilities Linux Should Have To Compete; why isn’t any attention being paid to making it possible?
</rant>

Other references:

Again, and really, thanks.

Dan

Being an optimist, I un-gave up, and tried installing xrdp on my Linux box, and using Microsoft’s XRDP client to connect. And it failed, because xrdp just redirects to the vnc server, which (as previously noted) is majorly broken.

Giving up again.

I’ve had the same experience with the openSUSE built-in VNC facilities. I tried MANY different permutations of settings and DMs. I also tried vnc and xRDP. It works for a few days or even a few weeks, but eventually I always end up with a stuck black screen. Then you have to ssh in and kill some processes or the the user session. Some times restarting the display manager or VNC is not enough. I’ve found the most surefire way to get it back is

loginctl kill-user myuser

I gave up on it though. It sucked because I was trying to sell my boss on using Linux and he kept getting the black screen. :frowning: I would suggest trying a 3rd party remote desktop tool. Maybe No Machine?

No Machine looked good for a while, but it’s only free for personal use, and commercial use requires a $44.50/year license for each machine sharing its desktop. (Ouch.)

@dtgriscom https://gitlab.gnome.org/GNOME/gnome-remote-desktop won’t work?

What is your end goal for the remote session? If just management, then look at cockpit?

I have a good VNC client; it’s the server that’s broken. And when I installed xrdp, it just redirects to the VNC server, which is broken.

I’m doing development work for an embedded product with a small (4" diagonal) LCD that will show a custom application. Much of the work is command-line, but sometimes I need to see the display. It’s a PIA to work with mouse and keyboard on such a small display, so in the past I’ve gotten VNC working to be able to see the results of my work. Guess I’ll be getting out my magnifying glasses…