QEMU/FreeDOS

From Wikibooks, open books for an open world
Jump to: navigation, search
FreeDOS running on QEMU under Linux

FreeDOS is a great way to bring all of those old, much-loved and hard to replace programs from the DOS world back to life under a modern operating system. Using FreeDOS, graphical programs that won't run under Microsoft Windows, Wine or DOSBox might just run flawlessly under QEMU.

Download one of the bootable CD images from the FreeDOS website. The base CD is fine for running most old DOS software, but the full CD has lots of other goodies on it if you want to experiment further with FreeDOS.

Creating an image[edit]

To make it possible to exchange files with FreeDOS by copying files to and from the image, don't create the image as qcow. Instead, just create raw images. This will allow the FreeDOS image to be mounted under Linux and other Unix-like hosts just like a regular hard drive. Create a 100 MiB hard disk image named freedos.img:

qemu-img create -f raw freedos.img 100M

Now boot up FreeDOS from the CD image (fdbasecd.iso) and follow the menus to partition, format and install onto the hard drive.

qemu -localtime freedos.img -cdrom fdbasecd.iso -boot d

Once the install is complete, you can boot FreeDOS from the image file without the CD.

qemu -localtime freedos.img

To transfer files between FreeDOS and the host, stop QEMU and mount the FreeDOS image under the filesystem.

mkdir -p /mnt/freedos
mount -t msdos -o loop,offset=32256 freedos.img /mnt/freedos
cp oldgames /mnt/freedos
umount /mnt/freedos

NB: never mount the image while QEMU is using it and remember to unmount it before starting QEMU again!