Ubuntu 18.04 (and possibly later versions) switched from LightDM to GDM3. Connecting to the login screen with VNC while using GDM3 is currently not possible. The easiest way to get this VNC functionality back is to simply switch back from GDM3 to LightDM (which is still being activity developed and used by many Linux distros).
apt install lightdm
Should you for some reason come to regret switching to LightDM you can revert back to GDM3:
dpkg-reconfigure gdm3
apt install x11vnc
# Description: Custom Service Unit file # File: /lib/systemd/system/x11vnc.service [Unit] Description="x11vnc" Requires=display-manager.service After=display-manager.service [Service] ExecStart=/usr/bin/x11vnc -loop -nopw -shared -xkb -repeat -noxrecord -noxfixes -noxdamage -forever -rfbport 5900 -display :0 -auth guess ExecStop=/usr/bin/killall x11vnc Restart=on-failure Restart-sec=2 [Install] WantedBy=multi-user.target
systemctl enable x11vnc.service
This assumes screen :0 represents your monitor and binds x11vnc to that monitor instead of a session. If you do not have a monitor (headless) it is possible to install a fake monitor driver and bind x11vnc to that.
systemctl start x11vnc.service
The user list shown at login can be disabled by setting the org.gnome.login-screen.disable-user-list
GSettings key.
When the user list is disabled, users need to type their user name and password at the prompt to log in.
Create the gdm profile (/etc/dconf/profile/gdm) which contains the following lines:
user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults
Create a gdm keyfile for machine-wide settings in /etc/dconf/db/gdm.d/00-login-screen:
[org/gnome/login-screen] # Do not show the user list disable-user-list=true
Update the system databases:
dconf update