Jakob Simon-Gaarde
Jakob Simon-Gaarde

Reputation: 725

qemu to emulate SD-Bus and card

I am trying to mount a drive image emulated as an SD card with qemu-system-x86_64. qemu tells me that it is not supported by the machine type, can this really be true?

My command looks like this

sudo qemu-system-x86_64 -smp cores=4 -m 1024 -sd sdcard.qcow2 boot.img
WARNING: Image format was not specified for 'boot.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
qemu-system-x86_64: -sd sdcard.qcow2: machine type does not support if=sd,bus=0,unit=0

Upvotes: 2

Views: 11150

Answers (1)

Harm Berntsen
Harm Berntsen

Reputation: 53

You need to add an SD controller:

qemu-system-x86_64 -smp cores=4 -m 1024 -device sdhci-pci -device sd-card,drive=mydrive -drive id=mydrive,if=none,format=raw,file=image.bin

Source

Upvotes: 5

Related Questions