如何在Ubuntu 18.04 gdm3/Gnome中修改默认会话?
Hey there! Switching the default session to Ubuntu on Wayland for new users in Ubuntu 18.04 GNOME is straightforward. Let’s walk through the steps:
First, confirm the exact name of the Wayland session desktop file. Open a terminal and run this command:
ls /usr/share/wayland-sessions/You should see a file named
ubuntu-wayland.desktop– this is the target session file we need.Next, edit the GDM3 configuration file (GNOME uses GDM3 as its default display manager in 18.04). Use this command to open the file with sudo privileges:
sudo nano /etc/gdm3/custom.confIn the opened file, locate the
[daemon]section. If it doesn’t exist, add it at the top of the file. Then add or modify the following line to set the default session:DefaultSession=ubuntu-wayland.desktopSave your changes by pressing
Ctrl+O, then press Enter to confirm the filename. Exit the nano editor withCtrl+X.To apply the changes, restart the GDM3 service:
sudo systemctl restart gdm3Alternatively, you can reboot your system if you prefer a full restart.
Once done, any new user you create will have "Ubuntu on Wayland" pre-selected as their default session when they log in for the first time.
A quick note: Wayland may have compatibility issues with certain older hardware or proprietary graphics drivers (like NVIDIA’s closed-source drivers). If you encounter problems after switching, you can revert back by changing the DefaultSession value to ubuntu.desktop (the Xorg-based session) and restarting GDM3 again.
内容的提问来源于stack exchange,提问作者materangai

