3.6.5 Using host drives
In addition to disk image files, QEMU can directly access host
devices. We describe here the usage for QEMU version >= 0.8.3.
3.6.5.1 Linux
On Linux, you can directly use the host device filename instead of a
disk image filename provided you have enough privileges to access
it. For example, use /dev/cdrom to access to the CDROM or
/dev/fd0 for the floppy.
CD
- You can specify a CDROM device even if no CDROM is loaded. QEMU has
specific code to detect CDROM insertion or removal. CDROM ejection by
the guest OS is supported. Currently only data CDs are supported.
Floppy
- You can specify a floppy device even if no floppy is loaded. Floppy
removal is currently not detected accurately (if you change floppy
without doing floppy access while the floppy is not loaded, the guest
OS will think that the same floppy is loaded).
Hard disks
- Hard disks can be used. Normally you must specify the whole disk
(/dev/hdb instead of /dev/hdb1) so that the guest OS can
see it as a partitioned disk. WARNING: unless you know what you do, it
is better to only make READ-ONLY accesses to the hard disk otherwise
you may corrupt your host data (use the -snapshot command
line option or modify the device permissions accordingly).
3.6.5.2 Windows
CD
- The preferred syntax is the drive letter (e.g. d:). The
alternate syntax \\.\d: is supported. /dev/cdrom is
supported as an alias to the first CDROM drive.
Currently there is no specific code to handle removable media, so it
is better to use the change
or eject
monitor commands to
change or eject media.
Hard disks
- Hard disks can be used with the syntax: \\.\PhysicalDriveN
where N is the drive number (0 is the first hard disk).
WARNING: unless you know what you do, it is better to only make
READ-ONLY accesses to the hard disk otherwise you may corrupt your
host data (use the -snapshot command line so that the
modifications are written in a temporary file).
3.6.5.3 Mac OS X
/dev/cdrom is an alias to the first CDROM.
Currently there is no specific code to handle removable media, so it
is better to use the change
or eject
monitor commands to
change or eject media.