I have just installed FreeDOS and Windows 3.1 in qemu on Linux.
Firstly; create a new HDD image to install DOS onto.
qemu-img create -f qcow msdos.disk 85M
Then boot the FreeDOS CD image to begin the installation.
qemu -hda msdos.disk -m 64 -cdrom fdbasecd.iso -boot d
Follow the instructions here to install the FreeDOS operating system.
If you have access to a Windows 3.1 CD image; then add this and boot up DOS and begin the installation.
qemu -hda msdos.disk -m 64 -cdrom WINDOWS_3.1.ISO -boot c
This boots from the hard drive. Type D: to switch to the CD drive and type SETUP to begin the installation. The installation of Windows 3.1 takes no time at all compared to modern Windows NT variants. Once complete; re-boot the qemu system and then type “win” to start Windows. It is strange to use an operating system with no web browser, but it does have Paint and Writer as well as the venerable DOS prompt available whenever you need it. You can also install Linux distributions in qemu. I have been experimenting with Vmware trying to install the Macintosh operating system but I have had no luck using Windows as the host operating system. Something like this that involves a very old operating system is easier.