blob: dc83a0052685f10e2d9ab1046e3fdaaa0866a76f [file] [log] [blame]
Heinrich Schuchardt2ac53a52023-07-24 12:04:18 +02001.. SPDX-License-Identifier: GPL-2.0+
2
3Emulation of block devices
4--------------------------
5
6QEMU can emulate common block devices by adding the following parameters to
7the qemu-system-<arch> command line:
8
9* MMC
10
11 .. code-block:: bash
12
13 -device sdhci-pci,sd-spec-version=3 \
14 -device sd-card,drive=MMC1 \
15 -drive if=none,file=disk.img,format=raw,id=MMC1
16
17* NVMe
18
19 .. code-block:: bash
20
21 -drive if=none,file=disk.img,format=raw,id=NVME1 \
22 -device nvme,drive=NVME1,serial=nvme-1
23
24* SATA
25
26 .. code-block:: bash
27
28 -device ahci,id=ahci0 \
29 -drive if=none,file=disk.img,format=raw,id=SATA1 \
30 -device ide-hd,bus=ahci0.0,drive=SATA1
31
32* USB
33
34 .. code-block:: bash
35
36 -device qemu-xhci \
37 -drive if=none,file=disk.img,format=raw,id=USB1 \
38 -device usb-storage,drive=USB1