Cannot start persistent VNC server session

Hi, there!
I’m newbie in openSuse Tumbleweed.
I followed the instructions in https://doc.opensuse.org/documentation/leap/reference/html/book-reference/cha-vnc.html in order to get remote graphical sessions with VNC.
When I want to start a persistent VNC session using vncserver (PROCEDURE 4.2) with

vncserver -alwaysshared -geometry 1024x768 -depth 16

I get

vncserver: command not found

I have already used this procedure in openSuse Leap 15.4 and it work well.
I have installed in Tumbleweed the following related packages:

  • libXvnc1
  • libvncclient1
  • libvncserver1
  • tigervnc
  • vncmanager
  • vncmanager-controller
  • vncmanager-greeter
  • x11vnc
  • xorg-x11-Xvnc
  • xorg-x11-Xvnc-module

I don’t know which of that packges are needed or if I need any more packages.
Please, can anybody help me?
Does anyone have a procedure for setup and using VNC in Tumbleweed?

Thank you in advance.

Hello,

I Use vnctiger on a tumbleweed machine to connect to a tumbleweed server.
On the tumbleweed server I have enabled vncserver@.service
This must be enabled via the session number for example “:18”

 # systemctl status vncserver@:18.service
● vncserver@:18.service - Remote desktop service (VNC)
     Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; enabled; preset: disabled)
     Active: active (running) since Tue 2024-02-06 01:00:28 CET; 1 week 6 days ago
    Process: 1238 ExecStart=/usr/libexec/vncsession-start :18 (code=exited, status=0/SUCCESS)
   Main PID: 1247 (vncsession)
      Tasks: 0 (limit: 4472)
        CPU: 53ms
     CGroup: /system.slice/system-vncserver.slice/vncserver@:18.service
             ‣ 1247 /usr/sbin/vncsession philippe :18

Feb 06 01:00:26 rasp.samdom.pce23.net systemd[1]: Starting Remote desktop service (VNC)...
Feb 06 01:00:28 rasp.samdom.pce23.net systemd[1]: Started Remote desktop service (VNC).

for more detail see output of command : systemctl cat vncserver@.service
and also
https://forums.opensuse.org/t/vncserver-changes-with-last-snapshot/149950

Regards
Philippe

Thank you for your answer.
I tried your method, but it failed to start:

adrian@faraday:~> sudo systemctl status vncserver@:0.service
○ vncserver@:0.service - Remote desktop service (VNC)
     Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; disabled; preset: disabled)
     Active: inactive (dead)
adrian@faraday:~> sudo systemctl start vncserver@:0.service
Job for vncserver@:0.service failed because the control process exited with error code.
See "systemctl status vncserver@:0.service" and "journalctl -xeu vncserver@:0.service" for details.
adrian@faraday:~> sudo systemctl status vncserver@:0.service
× vncserver@:0.service - Remote desktop service (VNC)
     Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; disabled; preset: disabled)
     Active: failed (Result: exit-code) since Mon 2024-02-19 20:28:51 -03; 11s ago
    Process: 1838 ExecStart=/usr/libexec/vncsession-start :0 (code=exited, status=1/FAILURE)
        CPU: 31ms

Feb 19 20:28:51 faraday systemd[1]: Starting Remote desktop service (VNC)...
Feb 19 20:28:51 faraday systemd[1]: vncserver@:0.service: Control process exited, code=exited, >
Feb 19 20:28:51 faraday vncsession-start[1838]: No user configured for display :0
Feb 19 20:28:51 faraday systemd[1]: vncserver@:0.service: Failed with result 'exit-code'.
Feb 19 20:28:51 faraday systemd[1]: Failed to start Remote desktop service (VNC).
li

Thanks, again.

I think that you must use a number > 0 because AFAIK the “:0” is reserved for your running display. I had some problem whith crash that locked display “:1” therefor I used display “:18”.

There are also directoryies ~/.vnc for the users that you use, therein there is the password file ( see man vncpasswd) and settings for the session (session type,security, geometry…)

rasp:/home/philippe/.vnc # ls -al
total 28
drwxr-xr-x  2 philippe users 4096 Jan 14  2023 .
drwxr-xr-x 22 philippe users 4096 Feb  6 01:00 ..
-rw-r--r--  1 philippe users  537 Dec  7  2022 config
-rw-r--r--  1 philippe users   38 Oct 21  2022 mycf
-rw-------  1 philippe users    8 Dec  5  2022 passwd
-rw-r--r--  1 philippe users 3941 Feb  6 01:00 rasp.samdom.pce23.net:18.log
-rw-r--r--  1 philippe users  470 Oct 21  2022 vncserver-config-mandatory
rasp:/home/philippe/.vnc # cat config
## Mandatory settings for VNC servers started by the vncserver service
#
# Any settings given here will override the builtin defaults and
# settings specified in ~/.vnc/config or vnc-config-defaults.
#
# See HOWTO.md and the following manpages for more details:
#     vncsession(8) Xvnc(1)
#
# Several common settings are shown below. Uncomment and modify to your
# liking.

# session=gnome
session=kde-plasma
# securitytypes=vncauth,tlsvnc
securitytypes=vncauth,tlsvnc
# geometry=2000x1200
geometry=1920x1080
# localhost
# alwaysshared

On the other side to start tigervnc I set the server name as “192.168.4.91:18” = server IP address + display number

Regards
Philippe

As you can see from my previous post I am using the number 0.

sudo systemctl start vncserver@:0.service

Anyway, I have tried several numbers and I always get the same result: “Job for vncserver@:0.service failed because the control process exited with error code.”

I don’t have those files in /~/.vnc. I think those files are created when you run the server for the first time. Isn’t it?

Thank you very much.

What about reading comment in vncserver@.service and doing what it says?

1 Like

I don’t know how to configure a user for display :0.
Can you show me, please?

tigervnc connect to the asked display (:xx) and then you must enter the user login/password. On connection the server open the session (KDE or Gnome) using the parameter found in the user ~/.vnc/config.

Not sure that you an use display :0.

Regards
Philippe

For more settings have a look in https://github.com/TigerVNC/tigervnc/blob/master/unix/vncserver/HOWTO.md

Regard

1 Like

But TigerVNC Viewer cannot connect (“Server refuse connection”) because vncserver doesn’t start!

do you have set the vncserver.users in /etc/tigervnc?

rasp:/etc/tigervnc # cat vncserver.users
# TigerVNC User assignment
#
# This file assigns users to specific VNC display numbers.
# The syntax is <display>=<username>. E.g.:
#
# :2=andrew
# :3=lisa
:18=philippe
#

I will read it!

Sorry it’s a bit messy but it’s been almost 2 years since I configured vncserver.
There are other info in /usr/share/doc/package/xorg-x11-Xvnc

In all examples they never user display “:0”

Regards
Philippe

Thank you, phil524!
Tonight, when I get home, I’ll try what you suggest me (https://github.com/TigerVNC/tigervnc/blob/master/unix/vncserver/HOWTO.md)

Thanks a lot!

Your first clue is that the vncserver is not running on the remote machine. You need to launch it.

The method I always used for VNC connections is as follows:

Open a terminal (I will call it terminal 1).
ssh to your User on the remote machine, then issue:

vncserver

Watch for a display # to show, and use that in the next part if you see one mentioned.
logout of the remote machine, disconnect from it.
Then, in terminal 1, issue:

ssh -t -L 590X:localhost:590X your-user@xxx.xxx.xxx.xxx 'x11vnc -nopw -display :X'

Replace the X’s with the correct values (not the x in x11vnc though).
Open a second terminal, issue:

vncviewer

Where appropriate, using the same number as X above, choose:

localhost:X

If it fails on the first number, you could close the 2nd terminal, go back to the first terminal, issue:

ssh -t -L 590X:localhost:590X your-user@xxx.xxx.xxx.xxx 'x11vnc -nopw -display :X'

but with the next display number. If you used 0 on the first time, use 2 in place of the X’s.

Thank you, Fraser_Bell!
But, as you can see from my first post:

adrian@faraday:/> vncserver
 vncserver: command not found
adrian@faraday:/> 

phil524!.. I follow the procedure on https://github.com/TigerVNC/tigervnc/blob/master/unix/vncserver/HOWTO.md
Now:

adrian@faraday:~> sudo systemctl start vncserver@:1
adrian@faraday:~> sudo systemctl status vncserver@:1
○ vncserver@:1.service - Remote desktop service (VNC)
     Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; enabled; preset: disabled)
     Active: inactive (dead) since Tue 2024-02-20 21:46:50 -03; 13s ago
   Duration: 74ms
    Process: 2008 ExecStart=/usr/libexec/vncsession-start :1 (code=exited, status=0/SUCCESS)
   Main PID: 2015 (code=exited, status=0/SUCCESS)
        CPU: 49ms

Feb 20 21:46:49 faraday systemd[1]: Starting Remote desktop service (VNC)...
Feb 20 21:46:50 faraday systemd[1]: Started Remote desktop service (VNC).
Feb 20 21:46:50 faraday systemd[1]: vncserver@:1.service: Deactivated successfully.

but when I try to connect by mean TigerVNC Viewer I get a black screen.
And when I try to connect with Remmina, some certificates are required.

Oh, okay. Some changes since I last used it. I see.

Pardon me if I missed it, but what Desktop and what Display Manager are you using? Are you using KDE, are you using SDDM?

:underage: underage: ello,

On my server I have this status and from the client side I reveive the graphical login screen.

rasp:~ # systemctl status vncserver@:18
● vncserver@:18.service - Remote desktop service (VNC)
     Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; enabled; preset: disabled)
     Active: active (running) since Wed 2024-02-21 07:14:57 CET; 2s ago
    Process: 16762 ExecStart=/usr/libexec/vncsession-start :18 (code=exited, status=0/SUCCESS)
   Main PID: 16786 (vncsession)
      Tasks: 0 (limit: 4472)
        CPU: 61ms
     CGroup: /system.slice/system-vncserver.slice/vncserver@:18.service
             ‣ 16786 /usr/sbin/vncsession philippe :18

Feb 21 07:14:57 rasp.samdom.pce23.net systemd[1]: Starting Remote desktop service (VNC)...
Feb 21 07:14:57 rasp.samdom.pce23.net systemd[1]: Started Remote desktop service (VNC).

Si I think that something is missing in your setup on your server

  1. check your display manager: SDDM doesn’t work I use XDM (to change Yast → Alternatives)

  2. check /etc/tigervnc/vncserver/users it must contain a line “:1=yourlocaluser”

  3. check the /home/localuser/.vnc directory: you need the “passwd” (create via vncpasswd) and the “config” files
    in the config files I have these lines

      session=kde-plasma
      securitytypes=vncauth,tlsvnc
      geometry=1920x1080
    
  4. check the journalclt output. I have these lines

rasp:/home/philippe/.vnc # journalctl -b  --grep vnc
Feb 06 01:00:11 rasp.samdom.pce23.net systemd[1]: Created slice Slice /system/vncserver.
Feb 06 01:00:17 rasp.samdom.pce23.net systemd[1]: /usr/lib/systemd/system/xvnc@.service:9: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether.
Feb 06 01:00:17 rasp.samdom.pce23.net systemd[1]: Listening on Xvnc Server.
Feb 06 01:00:17 rasp.samdom.pce23.net systemd[1]: Reached target System VNC service.
Feb 06 01:00:26 rasp.samdom.pce23.net systemd[1]: Starting Remote desktop service (VNC)...
Feb 06 01:00:28 rasp.samdom.pce23.net vncsession[1247]: pam_unix(tigervnc:session): session opened for user philippe(uid=1000) by philippe(uid=0)
Feb 06 01:00:28 rasp.samdom.pce23.net systemd[1]: Started Remote desktop service (VNC).
Feb 06 01:00:50 rasp.samdom.pce23.net systemd[1267]: Starting VNC Configuration...
Feb 06 01:00:51 rasp.samdom.pce23.net systemd[1267]: Started VNC Configuration.
Feb 06 01:00:52 rasp.samdom.pce23.net vncmanager-controller[1765]: VNC not managed by vncmanager, quitting.
Feb 06 01:00:52 rasp.samdom.pce23.net systemd[1267]: app-vncmanager\x2dcontroller@autostart.service: Main process exited, code=exited, status=1/FAILURE
Feb 06 01:00:52 rasp.samdom.pce23.net systemd[1267]: app-vncmanager\x2dcontroller@autostart.service: Failed with result 'exit-code'.
Feb 21 07:14:57 rasp.samdom.pce23.net systemd[1]: Stopping Remote desktop service (VNC)...
Feb 21 07:14:57 rasp.samdom.pce23.net vncsession[1247]: vncsession: vncserver exited with status=1
Feb 21 07:14:57 rasp.samdom.pce23.net vncsession[1247]: pam_unix(tigervnc:session): session closed for user philippe
Feb 21 07:14:57 rasp.samdom.pce23.net systemd[1]: vncserver@:18.service: Deactivated successfully.
Feb 21 07:14:57 rasp.samdom.pce23.net systemd[1]: Stopped Remote desktop service (VNC).
Feb 21 07:14:57 rasp.samdom.pce23.net systemd[1]: Starting Remote desktop service (VNC)...
Feb 21 07:14:57 rasp.samdom.pce23.net vncsession[16786]: pam_unix(tigervnc:session): session opened for user philippe(uid=1000) by philippe(uid=0)
Feb 21 07:14:57 rasp.samdom.pce23.net systemd[1]: Started Remote desktop service (VNC).
Feb 21 07:15:07 rasp.samdom.pce23.net systemd[1267]: Starting VNC Configuration...
Feb 21 07:15:07 rasp.samdom.pce23.net systemd[1267]: Started VNC Configuration.
Feb 21 07:15:08 rasp.samdom.pce23.net vncmanager-controller[17205]: VNC not managed by vncmanager, quitting.
Feb 21 07:15:08 rasp.samdom.pce23.net systemd[1267]: app-vncmanager\x2dcontroller@autostart.service: Main process exited, code=exited, status=1/FAILURE
Feb 21 07:15:08 rasp.samdom.pce23.net systemd[1267]: app-vncmanager\x2dcontroller@autostart.service: Failed with result 'exit-code'.
Feb 21 07:35:08 rasp.samdom.pce23.net vncsession[16786]: pam_unix(tigervnc:session): session closed for user philippe
Feb 21 07:35:08 rasp.samdom.pce23.net systemd[1]: vncserver@:18.service: Deactivated successfully.
rasp:/home/philippe/.vnc # systemctl status vncserver@:18
○ vncserver@:18.service - Remote desktop service (VNC)
     Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; enabled; preset: disabled)
     Active: inactive (dead) since Wed 2024-02-21 07:35:08 CET; 30s ago
   Duration: 20min 10.276s
    Process: 16762 ExecStart=/usr/libexec/vncsession-start :18 (code=exited, status=0/SUCCESS)
   Main PID: 16786 (code=exited, status=0/SUCCESS)
        CPU: 61ms

Feb 21 07:14:57 rasp.samdom.pce23.net systemd[1]: Starting Remote desktop service (VNC)...
Feb 21 07:14:57 rasp.samdom.pce23.net systemd[1]: Started Remote desktop service (VNC).
Feb 21 07:35:08 rasp.samdom.pce23.net systemd[1]: vncserver@:18.service: Deactivated successfully.

Details :
0n 6 FeB → reboot system
on 21 Feb 07.14.57 → systemctl restart vncserver@:18
on 21 Feb 07.15.08 → connection via vncviewer-tigervnc from remote client
on 21 Feb 07.35.08 → logoff from tigervnc session

Did you enable vncserver@:1.service?

Regards
Philippe

Hello aecordoba1,

then vncserver is either not in yout $PATH or isn’t installer. Here (Leap 15.5) it is in fact /usr/lib/vncserver and therefor not in my $PATH.

But:

$ /usr/lib/vncserver

usage: vncserver