My favorite virtualization program is
VMWare because of its easy os installation (xp at least - it recognises it after boot and takes over, suggesting it's compatability pack be inserted/installed to interact with your main os). and easy-to-find pre-installed os hard drive images,
The standard player is free(?). Used to be anyway, tho the URL may be wrong.
In XP, you can run programs in compatability mode for previous operating systems. Most of the time it's effective. In all the other cases I've found I was able to find official or fan-made patches to force XP compatability.
Those new-fangled compatability solutions are usually the best way to go to get the games running best on new hardware. Often, they include important unofficial bug fixes never officially fixed during the support period of the game. This is because the fans care more about the old games than the developers and publishers.
The next best 100% free Virtualizer IMO is
Virtualbox. Lots of harddrive images available for it as well - dos, linux, android x86, chrome, windows 10 lite, etc.
For Windows 3.1 I found a great pre-set-up environment for dosbox here (copy files and run windows.bat)
http://www.abandonia.com/vbullet/showthread.php?t=27770First time I've been able to run the Desktop Monty Pythonizer since 1995 (well, Monty Python's Complete Waste of Time was the only one that I could find lately) - I set cpu cycles to max for video and sound performance, but otherwise all stock dosbox settings.
Feel free to PM me for resources if you can not find something - I'll point you in the right direction, or if you're totally lost I can set it up for ya through Teamviewer in no time while explaining the procedure.