I have run a Pi 3B successfully using a KVM switch sharing keyboard, mouse and VGA monitor (with a HDMI-VGA adapter on the Pi) with a desktop PC. Now that I have moved on to a Pi 4B, I find that with the same KVM switch pointing at the Pi, the Pi fails to start until I point the switch to the desktop PC and back to the Pi. While this is hardly an onerous task, it is annoying. Is there any way to fix things so that the Pi 4B will start without this switching to and fro?
Not knowing the capabilities of the monitor, the hdmi_mode below is probably wrong (82 is 1920x1080 resolution)
However, this should get you working
config.txt file in the boot partition, add the following settings
hdmi_force_hotplug=1 hdmi_group=2 hdmi_mode=82
other values for mode can be found at https://www.raspberrypi.org/documentation/configuration/config-txt/video.md under the part where it says
These values are valid if hdmi_group=2 (DMT):
The hdmi_group command defines the HDMI output group to be either CEA (Consumer Electronics Association, the standard typically used by TVs) or DMT (Display Monitor Timings, the standard typically used by monitors). This setting should be used in conjunction with hdmi_mode.
hdmi_group=0 for Autodetect hdmi_group=1 for CEA hdmi_group=2 for DMT
Setting hdmi_force_hotplug to 1 pretends that the HDMI hotplug signal is asserted, so it appears that a HDMI display is attached. In other words, HDMI output mode will be used, even if no HDMI monitor is detected.
You may also add
Setting to 1 will remove all other modes except the ones specified by hdmi_mode and hdmi_group from the internal list, meaning they will not appear in any enumerated lists of modes. This option may help if a display seems to be ignoring the hdmi_mode and hdmi_group settings.
You may also need to play with overscan settings (as per linked page), again, this depends on your monitor
I had the same problem with an old KVM switch. One of the two raspberries connected was not accessible after both had been rebooted, probably because only one of them does see a monitor. The solution above did not solve the problem however. But I found out that commenting out all monitor configurations together with the solution above does work. So I commented out:
Not sure which of them is actually relevant.