Skip to content

Instantly share code, notes, and snippets.

@lancechentw
Created August 13, 2026 17:51
Show Gist options
  • Select an option

  • Save lancechentw/f8e8a607928390cefb734bc53eacd37b to your computer and use it in GitHub Desktop.

Select an option

Save lancechentw/f8e8a607928390cefb734bc53eacd37b to your computer and use it in GitHub Desktop.
Fix HDMI Output Through a KVM on Ubuntu Server

Fix HDMI Output Through a KVM on Ubuntu Server

If Ubuntu sees the HDMI connector as disconnected when using a KVM, force-enable the HDMI output with a fixed resolution.

1. Identify the HDMI connector

Check the available DRM connectors:

ls /sys/class/drm/

Typical HDMI connectors are:

card0-HDMI-A-1
card0-HDMI-A-2

If possible, connect the monitor directly first to determine which HDMI connector corresponds to the physical port being used.

Check:

cat /sys/class/drm/card0-HDMI-A-1/status
cat /sys/class/drm/card0-HDMI-A-1/modes

With the problematic KVM, it may show:

disconnected

and no modes.

2. Add a forced video mode to GRUB

Edit:

sudo nano /etc/default/grub

Find:

GRUB_CMDLINE_LINUX_DEFAULT=""

and change it to:

GRUB_CMDLINE_LINUX_DEFAULT="video=HDMI-A-1:1920x1080@60e"

Replace HDMI-A-1 with HDMI-A-2 if that is the connector actually in use.

The trailing e is important: it forces Linux to enable the connector even when the KVM causes it to be detected as disconnected.

3. Regenerate the GRUB configuration

sudo update-grub

4. Reboot

sudo reboot

Ubuntu should now output:

1920x1080 @ 60 Hz

through the KVM even if HDMI hot-plug detection is broken.

5. Verify after reboot

cat /sys/class/drm/card0-HDMI-A-1/status
cat /proc/cmdline

The kernel command line should contain:

video=HDMI-A-1:1920x1080@60e

Note about BIOS/UEFI

This workaround only takes effect once the Linux kernel starts.

If the MSI BIOS/UEFI still produces an unsupported video mode through the KVM, the Linux setting cannot fix that. For BIOS access, connect the monitor directly or use a KVM with working EDID/HPD emulation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment