3

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.

1 Answers1

1

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).

  • 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) – Taylor Thomas Jan 04 '22 at 15:37
  • 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 – Matias N Goldberg Jan 04 '22 at 18:34
  • 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 Jan 04 '22 at 20:19
  • 1
    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 – Taylor Thomas Jan 05 '22 at 15:36
  • 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 – Matias N Goldberg Jan 06 '22 at 01:10