As someone who uses a lot of old hardware on a regular basis (anywhere from computers contemporary in 1999 to the Windows Vista/7 age) for nostalgia, troubleshooting, and gaming reasons, as well as earlier hardware on a less regular basis, I can say that emulation is by far a better route if you're just looking to play some old games. VirtualBox, for example, lets you add a real CD drive as your emulated CD drive, as long as the computer that you're emulating on still has a physical ODD (if not, a cheap USB one should work too).
If you're absolutely dedicated to running on real hardware, you might need something slightly older for XP. Problematically, some computers from the era of Windows 8/8.1/10 just really don't like running Windows XP and earlier, even when you turn off all the newer features in the BIOS, and I haven't been able to discern explicitly why. Does it blue screen when you attempt to install XP?