Score:1

Stop Ubuntu from detecting when display is disconnected

cn flag

I am setting up a simple Ubuntu machine on a KVM switch. One of the monitors is on this switch and the other is not. I want the KVM switch to always be the primary display, even when it is connected to my other computer (appears as completely disconnected to Ubuntu). Ideally I would like for it to just stop detecting changes to the monitor configuration. I have found some commands with xrandr that should solve my issue but none of them seem to work with Ubuntu 20.04 (for example:gsettings set org.gnome.settings-daemon.plugins.xrandr active false and others with different schemas). Let me know if I was even close with xrandr or if there is a better solution I could learn about.

ChanganAuto avatar
us flag
xrandr commands may work with xorg but not with wayland.
Score:0
vg flag

This problem is at a lower level.

What is your GPU? I suspect it's an AMD GPU.

If that's the case you can fix it by disabling amdgpu.dc at boot time which will prevent the GPU from knowing when your "monitor" is turned off.

However this fix won't work for newer cards (e.g. RDNA2) since they need DC to be on.

The ticket tracking this bug is in https://gitlab.freedesktop.org/drm/amd/-/issues/461

Another possible workaround is to use the HDMI port, since this issue mostly pertains to DisplayPort ports (AFAIK).

Taylor Thomas avatar
cn flag
It is using integrated intel graphics. And I am not sure it is a bug, I think that my KVM switch is cheap and gives no indication that there is a connection when the source is not in use. It looks to the computer as if the cable is completely disconnected. (and this is on hdmi already)
Matias N Goldberg avatar
vg flag
Ok then, something that may work is to create a fake monitor and have both displays (real + fake) set to mirror: https://askubuntu.com/questions/453109/add-fake-display-when-no-monitor-is-plugged-in so that when your KVM switches, your fake display is still plugged keeping your desktop settings alive
Taylor Thomas avatar
cn flag
That is exactly the type of solution I am looking for, thank you! I will give that a try when I get a minute.
Taylor Thomas avatar
cn flag
The solution linked completely disabled my real displays. I had to boot into recovery mode and undo the change. People have commented under it that it completely bricked their system. Be careful
Matias N Goldberg avatar
vg flag
Ouch!!! mmm I suspect it may have been bricked because writing your own xorg.conf can be very hard (as you need to setup EVERYTHING). A better option is to add a file in `/usr/share/X11/xorg.conf.d/` to setup your extra monitors. If the system fails, check `/var/log/Xorg.0.log` to see what went wrong. But first install SSH server so you can control it comfy from a laptop or 2nd computer and use `sshfs username@192.168.1.x:/ /mnt -o default_permissions,idmap=user` to access your server files from there
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.