I have installed Tiger VNC server on Fedora. From the remote machine (Ubuntu), with any VNC client (Tiger, Remmina, Real), I can see display 2 but not display 1, the one used by Gnome desktop (believing the value of DISPLAY in Gnome terminal).
Display 2 is initially black but I can fill it remotely with ssh and (DISPLAY=:2 xeyes &) or (DISPLAY=:2 gnome-terminal &) . (DISPLAY=:1 xeyes &) will also write on Gnome desktop.
(I do not use Wayland.)
The Gnome desktop belongs to user alba and the remote user who wants to see the desktop is also alba.
I managed to share Fedora desktop with Real VNC, which is commercial software (and it still took me a few hours to configure). Remembering that even Raspbian has moved to Real VNC, it must be for some reason, possibly that Tiger VNC and other old simple VNC servers do not work any longer for desktop sharing, because VNC is basically uncrypted (though it can be tunneled) and does not comply with the most recent and paranoid security rules.
VNC server does not work anymore in Gnome 42, it is replaced by the Remote Desktop Protocol. Hence the change in Gnome settings from “Screen Sharing” to “Remote Desktop”. In order to use RDP with Gnome, nothing needs to be installed and all server configuration can be done in Settings > Sharing > Remote Desktop (no config file to edit). Also installed is Remmina, which is both a VNC and RDP client.
Fedora 36 uses Gnome 42.3, the settings of which do not mention VNC.
Ubuntu 22.04 uses Gnome 42.2, the settings of which includes “Enable Legacy VNC Protocol”. Yet VNC does not work for Ubuntu Gnome desktop.
In conclusion, VNC server seems to be dead in Gnome. Most information on the web for configuring VNC server on Linux is obsolete, if the aim is to share Gnome desktop. Yet VNC server can still be used to share a screen other than Gnome desktop, as I have noticed in my question.