25.10 Start GDM/Wayland manually

Ubuntu 25.10, Gnome 49.0, LightDM

Before update to 25.10, while using 25.04 the script below worked ok.

I disabled Splash and GDM login, and was login in using cli, like a server. When needed I would start Wayland manually using the script below.

The script I was using was this:

#!/bin/bash
# Exit if not in a text console
if [ -n "$WAYLAND_DISPLAY" ] || [ -n "$DISPLAY" ]; then
    echo "Already in a graphical session"
    exit 1
fi

# Start GNOME Wayland session
export XDG_SESSION_TYPE=wayland
exec dbus-run-session gnome-session
clear

I prefer to start Ubuntu like a server, with no splash (which I have disabled in Grub) and the GDM. I can do that, but the script is failing to start Wayland. Is there a way to fix this?

Thanks

Have you installed lightdm and removed gdm3?

Your question is a bit unusual but I’ve mucked around for an hour and discovered an inelegant but functional approach.
You will need gdm3 installed for this.

Boot into your system (without GUI)
Log in username
Enter password
After you have finished your cli tasks and then require GUI
sudo systemctl restart gdm3
Log in again

I did not uninstalled. I just switched to LightDM.

I was actually doing this, but two logins are a downer. So I moved to LightDM for now.

Thanks anyway.

Dog with a bone returns :slightly_smiling_face:

Boot into your system (without GUI)
Log in username
Enter password
After you have finished your cli tasks and then require GUI
gnome-shell --wayland

Subsequently, I did notice that GUI Poweroff and User Logout were not available
You can poweroff via the terminal.
I couldn’t find the terminal command for user logout.

Of course, there may be other functions deactivated with this procedure - more investigation needed.