Replies: 7 comments 3 replies
-
One silly but simple question is, can we just un-install Wayland and set Xorg as default? Then no need to deal with Wayland fun stuff? |
Beta Was this translation helpful? Give feedback.
-
Actually, Xorg does not really support headless systems either: it partly crashes when there's no display. That's what
.. and I just found why: with If there's a monitor then Xorg does not crash. One of the things that confused me is that
So another possibility is to turn off the GUI entirely (BOTH wayland and Xorg) with |
Beta Was this translation helpful? Give feedback.
-
To check whether the kernel driver has detected a display or not:
EDIT, another one that does NOT require root.
It also shows when $ sudo systemctl isolate multi-user
DISPLAY=:0 xrandr --listmonitors
Can't open display :0
$ sudo systemctl isolate default
|
Beta Was this translation helpful? Give feedback.
-
I borrowed and tried a couple "HDMI dummy plugs" and they make all these problems just go away. |
Beta Was this translation helpful? Give feedback.
-
This does not work any more with Ubuntu 22 over ssh: EDIT: it works again as of October 2023?!
This leaves:
|
Beta Was this translation helpful? Give feedback.
-
gdm fails in an even more spectacular way when there's no GPU: #998 |
Beta Was this translation helpful? Give feedback.
-
Shared privately by Jason:
|
Beta Was this translation helpful? Give feedback.
-
Key discovery:
=> Wayland does NOT run without a monitor attached! Half of our test devices don't have a monitor...
Wayland is the default in Ubuntu 22 (not available in Ubuntu 20).
Wayland (or rather: the specific Wayland implementation shipped in Ubuntu 22) does not support monitor hotplug either! Wayland stops when you unplug the monitor and does NOT restart when you plug it back. A manual
sudo systemctl restart gdm3
does restart wayland after a monitor hotplug.An aborted Wayland never shows up in
systemctl --user --failed
orsystemctl --anything-I-tried
; you have to runps faux
to see whether Wayland failed to start or not.When no display is attached, some devices automatically fallback on Xorg at boot time while other devices give up and don't start gdm3 at all. I don't know why yet; I don't know what makes this difference. For the Xorg fallback you must have
apt install xserver-xorg-core
of course but that's the default, it's part ofapt install ubuntu-desktop
. Again: havingxserver-xorg-core
is not always enough to trigger a fallback to Xorg and I don't know why.Whether it's by choice or because of a fallback, Xorg processes run
fineeven without a display, just like in the older Ubuntu 20.04 days. (EDIT: not actually that simple and good, see comment below.) Xorg still supports hotplug too, no change either. Sometimes Xorg without a display shows up and complains insystemctl --user --failed
(which is what was caught in our validation in the first place) and other times not. I don't know why (EDIT: mystery solved, see comment below) Example: https://sof-ci.01.org/sofpr/PR6342/build1659/devicetest/?model=TGLU_UP_HDA_ZEPHYR&testcase=verify-kernel-boot-log3 times, then:
So how do you switch between Wayland and Xorg? (for instance because you want monitor hotplug back?)
First, you must understand that this is a per-user preference. You can choose when you enter your password at login time, see this screenshot: https://askubuntu.com/questions/968827/no-option-to-switch-between-x11-and-wayland-on-ubuntu-17-10
Your choice is persisted in the file
/var/lib/AccountsService/users/<username>
like this:Not having this file is OK and it defaults to Wayland[*].
But wait: what runs started before you even enter your password? Wayland or Xorg? There's no user yet so no preference yet. By default it's Wayland but you can override it in
/etc/gdm3/custom.conf
(for instance: because you want hotplug back?)But wait again: once someone has switched from Wayland to Xorg, there is no way back! Wayland can start Xorg but Xorg never switches back to Wayland. The choice is removed for future users after you logged off, everyone must use Xorg until the next reboot! This can lead to very funny situations like monitor hotplug never works before anyone logged in but then hotplug mysteriously works after some (Xorg) user logged in at least once. But hotplug still does not work if only Wayland users have logged in before.
For even more fun, note we use "autologin" in /etc/gdm3/custom.conf on our all DUTs. I'll spare you the extra fun this can cause :-)
[*] when there is no
/var/lib/AccountsService/users/<username>
file, some devices automatically recreate a template/empty file at some point, other devices not. I don't what makes this difference. As expected, this template does not seem to have any effect, still defaults to Wayland.Just for reference:
https://docs.fedoraproject.org/en-US/quick-docs/configuring-xorg-as-default-gnome-session/
Beta Was this translation helpful? Give feedback.
All reactions