Vnc server does not work

Hello

I just updated to the latest version from dietpi 7.x, and since then I don’t get a VNC connection.

I am using realvnc. From the viewer, connection times out.

Tried IP variations (:1, :0), shared desktop settings, reinstalling, other vnc server, all did not work.

root@DietPi:~# systemctl status vncserver
● vncserver.service - VNC Server (DietPi)
     Loaded: loaded (/etc/systemd/system/vncserver.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2023-01-23 19:27:15 GMT; 14min ago
   Main PID: 486 (vncserver)
      Tasks: 0 (limit: 4915)
        CPU: 24ms
     CGroup: /system.slice/vncserver.service
             ‣ 486 /bin/dash /usr/local/bin/vncserver start

Jan 23 19:27:15 DietPi systemd[1]: Started VNC Server (DietPi).
Jan 23 19:27:15 DietPi systemd[486]: pam_unix(login:session): session opened for user root(uid=0) by (uid=0)
Jan 23 19:27:16 DietPi vncserver[486]: [  OK  ] RealVNC detected
Jan 23 19:27:16 DietPi vncserver[486]: [ INFO ] Waiting for X server...

Any idea what I can do?
(in v7.5.2, vnc server worked normally - no changes on viewer side since)

hmm looks like the Xserver is not going to start. Are you able to start a local desktop manually?

startx

Here is the output.
Its only a raspberry pi, only remote access (no screen, keyboard, etc.)

X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
Build Operating System: linux Raspbian
Current Operating System: Linux DietPi 5.15.84-v7l+ #1613 SMP Thu Jan 5 12:01:26 GMT 2023 armv7l
Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=0 bcm2708_fb.fbheight=0 bcm2708_fb.fbswap=1 smsc95xx.macaddr=E4:5F:01:50:9D:7C vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  root=PARTUUID=0e2887fb-02 rootfstype=ext4 rootwait fsck.repair=yes net.ifnames=0 logo.nologo quiet console=tty1
Build Date: 20 December 2022  11:29:25PM
xorg-server 2:1.20.11-1+rpt1+deb11u4 (htt   ps://www.debian.    org/support)
Current version of pixman: 0.40.0
        Before reporting problems, check htt   p://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Tue Jan 24 19:12:26 2023
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) no screens found(EE)

did you checked the log file if there are some more details?

Here is the full output after the startx command

[332110.895]
X.   Org X Server 1.20.11
X Protocol Version 11, Revision 0
[332110.896] Build Operating System: linux Raspbian
[332110.897] Current Operating System: Linux DietPi 5.15.84-v7l+ #1613 SMP Thu >
[332110.897] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.>
[332110.899] Build Date: 20 December 2022  11:29:25PM
[332110.900] xorg-server 2:1.20.11-1+rpt1+deb11u4 (htt  ps://www.debian   .org/suppo>
[332110.900] Current version of pixman: 0.40.0
[332110.902]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[332110.902] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[332110.907] (==) Log file: "/var/log/Xorg.0.log", Time: Fri Jan 27 15:42:24 20>
[332110.924] (==) Using config directory: "/etc/X11/xorg.conf.d"
[332110.924] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[332110.928] (==) No Layout section.  Using the first Screen section.
[332110.929] (==) No screen section available. Using defaults.
[332110.929] (**) |-->Screen "Default Screen Section" (0)
[332110.929] (**) |   |-->Monitor "<default monitor>"
[332110.934] (==) No monitor specified for screen "Default Screen Section".
        Using a default monitor configuration.
[332110.934] (**) Option "BlankTime" "0"
[332110.934] (==) Automatically adding devices
[332110.934] (==) Automatically enabling devices
[332110.934] (==) Automatically adding GPU devices
[332110.935] (==) Max clients allowed: 256, resource mask: 0x1fffff
[332110.949] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[332110.949]    Entry deleted from font path.
[332110.949] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[332110.949]    Entry deleted from font path.
[332110.949] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[332110.949]    Entry deleted from font path.
[332110.949] (WW) The directory "/usr/share/fonts/X11/Type1" does not exist.
[332110.949]    Entry deleted from font path.
[332110.949] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[332110.949]    Entry deleted from font path.
[332110.950] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[332110.950]    Entry deleted from font path.
[332110.950] (==) FontPath set to:
        /usr/share/fonts/X11/misc,
        built-ins
[332110.950] (==) ModulePath set to "/usr/lib/xorg/modules"
[332110.950] (**) Extension "DPMS" is disabled
[332110.950] (II) The server relies on udev to provide the list of input device>
        If no devices become available, reconfigure udev or disable AutoAddDevi>
[332110.950] (II) Loader magic: 0x20cf40
[332110.950] (II) Module ABI versions:
[332110.950]    X.   Org ANSI C Emulation: 0.4
[332110.950]    X.   Org Video Driver: 24.1
[332110.950]    X.   Org XInput driver : 24.1
[332110.950]    X.   Org Server Extension : 10.0
[332110.953] (--) using VT number 2

[332110.953] (II) systemd-logind: logind integration requires -keeptty and -kee>
[332110.955] (II) no primary bus or device found
[332110.955] (II) LoadModule: "glx"
[332110.959] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[332111.001] (II) Module glx: vendor="X.   Org Foundation"
[332111.001]    compiled for 1.20.11, module version = 1.0.0
[332111.001]    ABI class: X.   Org Server Extension, version 10.0
[332111.001] (==) Matched modesetting as autoconfigured driver 0
[332111.001] (==) Matched fbdev as autoconfigured driver 1
[332111.001] (==) Assigned the driver to the xf86ConfigLayout
[332111.001] (II) LoadModule: "modesetting"
[332111.001] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[332111.006] (II) Module modesetting: vendor="X.   Org Foundation"
[332111.006]    compiled for 1.20.11, module version = 1.20.11
[332111.006]    Module class: X.   Org Video Driver

hmm no real error message. Looks like it simply stopped :thinking:

@MichaIng maybe you have some clever ideas.

Any idea to get vcn running is welcome (except reinstalling dietpi from scratch), other vnc server (tried tigervnc, same result), …

basically, you need to get the plain desktop up and running using startx. As long as this is not working, VNC will not work as well.

You seem to use SOFTWARE_VNCSERVER_SHARE_DESKTOP=1 in /boot/dietpi.txt, which requires a local desktop session, not possible without any screen attached, at least not if you enable headless mode etc.

What you need is a virtual desktop, by setting SOFTWARE_VNCSERVER_SHARE_DESKTOP=0 (which is also the default).

Does this work?

G_CONFIG_INJECT 'SOFTWARE_VNCSERVER_SHARE_DESKTOP=' 'SOFTWARE_VNCSERVER_SHARE_DESKTOP=0' /boot/dietpi.txt
systemctl restart vncserver

That works!
Thank you very much!