The problem with a headless box in the cupboard is the day it won't boot. SSH is no help when you need to see the BIOS, and a proper IP-KVM costs more than the machine it would be babysitting. So I built one from a Pi, and it has earned its keep already.
The recipe is PiKVM. A Raspberry Pi, a cheap USB HDMI capture dongle for the video, and an OTG cable so the Pi can pretend to be a keyboard and mouse over USB. The capture dongle is the only fussy part: the no-name ones work, but check it shows up as a UVC device before you commit, because some of them lie about resolutions and give you a green smear instead of a console.
Flash the image, plug the HDMI from the target into the dongle, plug the OTG cable into the target's USB, and you get a browser window with the machine's actual screen and a working keyboard. Including, crucially, the BIOS, the bootloader, and that grub menu you can't reach any other way. You can even mount an ISO over the network and reinstall the thing remotely.
Total cost was under thirty quid because I had the Pi already. The first time I used it in anger was to fix a boot order someone (me) had changed and forgotten, from a different room, in my socks. A commercial unit doing the same job would have been ten times the price and no more useful. Sometimes the homebrew answer is just better.