Emulation of block devices

QEMU can emulate common block devices by adding the following parameters to the qemu-system-<arch> command line:

  • MMC

    -device sdhci-pci,sd-spec-version=3 \
    -drive if=none,file=disk.img,format=raw,id=MMC1 \
    -device sd-card,drive=MMC1
    
  • NVMe

    -drive if=none,file=disk.img,format=raw,id=NVME1 \
    -device nvme,drive=NVME1,serial=nvme-1
    
  • SATA

    -device ahci,id=ahci0 \
    -drive if=none,file=disk.img,format=raw,id=SATA1 \
    -device ide-hd,bus=ahci0.0,drive=SATA1
    
  • USB

    -device qemu-xhci \
    -drive if=none,file=disk.img,format=raw,id=USB1 \
    -device usb-storage,drive=USB1
    
  • Virtio

    -drive if=none,file=disk.img,format=raw,id=VIRTIO1 \
    -device virtio-blk,drive=VIRTIO1
    

    Note

    As of v2023.07 U-Boot does not have a driver for virtio-scsi-pci.