Ubuntu 17.10运行Spotify或Discord时自动登出问题求助
Hey there! I dealt with this exact frustrating issue back when I was using Ubuntu 17.10, and you’re spot-on to suspect Wayland—those apps had major compatibility hiccups with it at the time. Let’s walk through the fixes that got things working for me and other community members:
1. Switch to Xorg for Login
Ubuntu 17.10 defaults to Wayland, but switching to Xorg (the older, more compatible display server) usually resolves the logout issue immediately:
- When you reach the login screen (before entering your password), click the small gear icon next to your username
- Select the Ubuntu on Xorg option, then log in as usual
- Launch Spotify or Discord afterward—you shouldn’t get kicked out anymore
2. Force Apps to Use XWayland (No Full Xorg Switch)
If you want to stick with Wayland, you can force these Qt-based apps to run via XWayland (a compatibility layer that bridges Wayland and Xorg apps):
For Spotify:
- Open your terminal and edit the Spotify desktop file with:
sudo nano /usr/share/applications/spotify.desktop - Find the line that starts with
Exec=spotify %U - Replace it with:
Exec=env QT_QPA_PLATFORM=xcb spotify %U - Save the file (press Ctrl+O, then Enter) and exit nano (Ctrl+X), then restart Spotify
For Discord:
- Do the same for Discord’s desktop file:
sudo nano /usr/share/applications/discord.desktop - Modify the Exec line to:
Exec=env QT_QPA_PLATFORM=xcb discord %U - Save and exit, then restart Discord
3. Update System & Apps (If Possible)
Ubuntu 17.10 is end-of-life now, but if you still have access to updates, patching might fix underlying bugs:
- Run these commands in terminal to update system packages:
sudo apt update && sudo apt upgrade - Make sure Spotify and Discord are on their latest versions—check for updates within each app’s settings menu
Bonus: Check Graphics Drivers
If you’re using an NVIDIA GPU, Wayland support in 17.10 was pretty spotty. Head to Software & Updates > Additional Drivers and switch to the proprietary NVIDIA driver (not the open-source nouveau one) — this often fixes display-related crashes and logouts.
内容的提问来源于stack exchange,提问作者Kevin Patel

