DigitalOcean上Ubuntu 22.04的Display manager无法切换问题求助
Hey there, let’s work through this issue together— I’ve dealt with similar display manager headaches on remote Ubuntu servers before, so here are some practical fixes to try:
First, confirm your desktop environments are properly installed
Run this command to list all available desktop sessions on your system:ls /usr/share/xsessions/You should see entries like
xfce.desktopandmate.desktopin the output. If they’re missing, that means the desktop environments didn’t install correctly, and you’ll need to reinstall them first withsudo apt install xfce4 mate-desktop-environment.Manually reconfigure your display manager
Ubuntu 22.04 typically uses GDM3 by default. You can force a reconfiguration to pick your preferred display manager (and ensure it recognizes your new desktop environments) with:sudo dpkg-reconfigure gdm3This will bring up a prompt where you can select your default display manager. If you prefer using LightDM (which sometimes shows the desktop switch option more reliably), install it first:
sudo apt install lightdmDuring installation, you’ll be asked to choose between GDM3 and LightDM— pick LightDM, then restart your server.
Check for the hidden desktop switch option
On GDM3’s login screen, the desktop environment selector is often a small gear icon located next to your username or the "Sign In" button. It’s easy to miss, so take a close look at the corners or edges of the login interface after restarting.Fix remote connection-related issues (if applicable)
If you’re accessing the VM via VNC or another remote tool, some remote services override the system’s default desktop environment. For example, if you’re using TightVNC, edit your~/.vnc/xstartupfile and replace any GNOME-related commands with:startxfce4 & # For XFCE # OR mate-session & # For MATESave the file and restart your VNC server for changes to take effect.
Final step: Reboot your VM
Sometimes configuration changes don’t kick in until you do a full reboot. Runsudo rebootand check the login screen again after the system comes back up.
备注:内容来源于stack exchange,提问作者pl-jay

