You can use a floppy disk drive and an image file.
A real CD-ROM in a host machine can be used on a Windows 2000/XP host. It needs to convert a CD-ROM to image files to use it on a Windows 98/Me host.
When a program is running, you can change a floppy and a CD-ROM image by QEMU monitor. To see monitor, press left Ctrl, left Alt and 2 keys together(Ctrl-Alt-2). To go back to a guest OS, press Ctrl-Alt-1.
When the floppy or CD-ROM image file is in a space-separated path, please use MS-DOS file name path.
For example, C:\Documents and Settings\(your name)\My Documents\qemu\floppy.img is C:\DOCUME~1\(your name)\MYDOCU~1\QEMU\FLOPPY.IMG. It is not case-sensitive. You can see it by dir /x.
[DOS Prompt] dir /x
Please use slash instead of back slash in a QEMU Monitor.
C:\Documents and Settings\(your name)\My Documents ----> C:/DOCUME~1/(your name)/MYDOCU~1
C:\Program Files\Qemu ----> C:/PROGRA~1/QEMU
You can boot from a floppy disk drive (A:) as follows.
[DOS Prompt] qemu.exe -L .\pc-bios -fda \\.\a: -boot a
You can also use -fda //./a: or -fda "\\.\a:" . Slash only can be used in rxvt.
NOTE: If an access is restricted by local security policy in control panel, you can't use it.
You can make image file from floppy disk on MSYS environment.
$ dd if=//./a: of=./floppy.img
If you use Cygwin, type:
$ dd if=/dev/fd0 of=./floppy.img
There are many converters. Please choose your favorite one.
A real CD-ROM can be used on a Windows 2000/XP host. When a CD-ROM drive is D:, please use \\.\d: or //./d:.
[DOS Prompt] qemu.exe -L . -cdrom //./d:
It boots CD-ROM based OS like Morphix.
[DOS Prompt] qemu.exe -L . -hda win2k.img -cdrom //./d:
It is necessary to make iso image to use CD-ROM on a Windows 98/Me host. If you have a CD-R writing software, you can use it. If you don't have it, you can use mkisofs command in cdrtools. It is ported to Win32 and you can use it as on Linux. Download cdrtools-2.0-win32.bin.zip and put it in PATH directory. If CD-ROM drive is D: , to make cdimage.iso file:
$ mkisofs -r -l -J -o cdimage.iso D:\
Please note that it needs to make a bootable CD-ROM image if you want to boot from CD-ROM. It needs some tricks for each OS.
For Windows, please refer to Bart's site.
When you use FAT32 file system for your host OS, max file size is 4Gbyte. If there is something wrong, please use dd for windows. You can make hard disk image which is 1500 MB as follows.
$ qemu-img.exe create harddisk.img 1500M
When your host OS is Windows 98/ME, the max size of harddisk image is 1999MB. When your host OS is Windows 2000/XP and use NTFS file system, you can use a file over 4GB.
$ qemu-img.exe create harddisk.img 6G
You can set a hard disk image type qcow which file size grows when it is necessary. You can save a hard disk volume.
$ qemu-img.exe create -f qcow harddisk.qcow 3G
Another tool
dd for windows
http://uranus.it.swin.edu.au/~jn/linux/rawwrite/dd.htm
Virtual VFAT enables to access a host directory as a hard disk. When you set fat: in front of a directory name, you can use it as the hard disk. When your directory is myfolder, an example is as follows.
$ qemu.exe -L ../pc-bios -hda win2k.img -hdb fat:myfolder
Note: Directory path doesn't work well on Windows. You can set a directory name which is in a directory the program starts. ("myfolder" must be in a directory the program starts.)
It is READ-ONLY. fatrw: prefix doesn't work now.
MS-DOS (Windows 98 boot floppy) can't see files in the directory.
The easiest way to share files between Windows guest and Windows host is to use Windows file sharing.
For more information.
If you start the program with -snapshot option, you can make a temporary file for hard disk image and write changes to it. The hard disk image is protected until you commit the changes. For example,
DOS> qemu.exe -L ../pc-bios -hda redhat.img -snapshotThe temporary file is made at C:\Documents and Settings\(your name)\Local Settings\Temp.
(qemu) commit hdaIf you do not commit the changes and exit the program, the changes will be lost.
You can use a named temporary file without using -snapshot option.
At first, make the named temporary file by qemu-img.exe. For example, if you use RedHat Linux image, you make the named temporary file redhat-temp.qcow. A format is QCOW or QCOW2.
DOS> qemu-img.exe create -b redhat.img -f qcow redhat-tmp.qcowAfter that, you set the temporary file as a hard disk and start QEMU.
DOS> qemu.exe -L ../pc-bios -hda redhat-temp.qcowThen RedHat Linux will boot.
(qemu) commit hdaA good point is that if you exit QEMU, the change you made is reserved in the temporary file. You can continue to work with it and you can commit them whenever you want.
You can use VM snapshots with QCOW2 format on Linux and Windows host.
A combination of QCOW2 and savevm/loadvm enables to save multiple snapshots and restore them.
savevm and loadvm cannot be used with other format except for QCOW2 format.
At first, prepare a QCOW2 format hard disk image. For example, convert an existing image to QCOW2 format.
DOS> qemu-img.exe convert -f raw redhat.img -O qcow2 test.qcow2Then start the program.
DOS> qemu.exe -L ../pc-bios -hda test.qcow2Change to QEMU monitor by Ctrl-Alt-2 and save Virtual Machine state.
(qemu) savevm test (qemu) info snapshots ID TAG VM SIZE DATE VM CLOCK 1 test 4M 2006-09-01 12:00:00 00:00:01.000Then go back to the guest OS by Ctrl-Alt-1 and make a file.
Guest OS$ echo test >test.txt Guest OS$ ls test.txtPress Ctrl-Alt-2 and save VM state by savevm in QEMU monitor.
(qemu) savevm test2 (qemu) info snapshots ID TAG VM SIZE DATE VM CLOCK 1 test 4M 2006-09-01 12:00:00 00:00:01.000 2 test2 5M 2006-09-01 12:01:00 00:00:02.000The you can restore the state which is before you save the file or after you save it.
(qemu) loadvm test or (qemu) loadvm 1You can delete the VM state by delvm.
DOS> qemu.exe -L ../pc-bios -hda test.qcow2 -loadvm testloadvm/savevm saves a state which is the state of memory and a hard disk.
Please put the floppy, the hard disk and the CD-ROM image in the same directory which has qemu.exe.
$ qemu.exe -L ./ -m 64 -boot a -fda floppy.img -hda harddisk.img -cdrom cdimage.iso
-L : bios location
-m : memory size (Mbyte)
-boot : boot device floppy(a), hard disk(c), CD-ROM(d)
-fda : floppy image
-hda : hard disk image
-cdrom : CD-ROM image
Double hyphen "--" is no more needed.
To change a floppy and a CD-ROM image, please use QEMU Monitor. To see the Monitor, press Ctrl-Alt-2 keys together. To go back to the guest OS, press Ctrl-Alt-1 keys.
Please use slash instead of back slash in a QEMU Monitor.
For floppy,
(qemu) change fda filename.img
or
(qemu) change fda d:/tmp/yourfile.img
For CD-ROM,
(qemu) eject cdrom
(qemu) change cdrom filename.iso
or
(qemu) eject cdrom
(qemu) change cdrom d:/tmp/yourcdrom.iso
You can see a status of block device.
(qemu) info block