Project "Sdcard HowTo" describes a number of ways to add "sdcard" (1).
It is fine with QEMU and showod work with VirtualBox. Unfortunately on each start I must edit boot line and to add SDCARD parameter.
Is there a way to store boot command permanently?
Another try was to use QEMU argument -sd FILE (2).
This fail with error message: "machine type does not support if=sd,bus=0,unit=0".
I wonder what could be reason for failure - QEMU limitation or is not supported by AOSP?
Third way is most technical - to start QEMU with arguments like following long argument sequence (3):
...
-device qemu-xhci,id=xhci \
-device usb-storage,bus=xhci.0,drive=sdcard \
-drive if=none,id=sdcard,format=raw,file=$SDCARD \
...
It work but I prefer to avoid very long command line. The main reason is that between releases qemu changes some options so simple command is preferred.
Is there another simple way to start with emulated SDCARD?
For instance vendor emulator has option command option -sdcard
Regards,
Roumen Petrov
Remark: tested with installed Android X86 8.1rc2 32-bit on Linux with QEMU 3.1.0.