Storage devices can be added using
or with the
drive_add command in the QEMU monitor.
Several drive types can be emulated. This can be specified through the
If not specified, it defaults to
Valid types are:
qemu -drive file=install-disc-1.iso,media=cdrom ...
Virtual FAT filesystem (VVFAT)
Qemu can emulate a virtual drive with a FAT filesystem. It is an easy way to share files between the guest and host.
It works by prepending
fat: to a directory name.
By default it's read-only, if you need to make it writable append
rw: to the aforementioned prefix.
qemu -drive file=fat:rw:some/directory ...
WARNING: keep in mind that QEMU makes the virtual FAT table once, when adding the device, and then doesn't update it in response to changes to the specified directory made by the host system. If you modify the directory while the VM is running, QEMU might get confused.
QEMU can cache access to the disk image files, and it provides several methods to do so. This can be specified using the
||Data is written to disk and cache simultaneously. (default)|
||Data is written to disk when discarded from the cache.|
qemu -drive file=disk.img,cache=writeback ...
Attaching drives to controller interfaces
If the drive is not attached to a controller interface (i.e.
if=none), then it can be manually attached with: