15

I am trying to emulate ARM architecture using QEMU. My host OS is ubuntu 16.04 and the guest OS inside the emulated machine is also ubuntu 16.04. Following is the tutorial that I'm following:

    sudo apt-get install qemu-system-arm qemu-efi

    dd if=/dev/zero of=flash0.img bs=1M count=64
    dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
    dd if=/dev/zero of=flash1.img bs=1M count=64

    sudo qemu-system-arm -m 1024 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=xenial-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0,mac=$randmac

This is giving me the following error:

WARNING: Image format was not specified for 'flash0.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.

WARNING: Image format was not specified for 'flash1.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.

This is my first time emulating a machine in QEMU. Your help would be highly appreciated.

Thank you in advance.

1 Answer 1

14

This is no error, just a warning. As your virtual flash disks are raw devices (created by dd), qemu-system is not able guessing the disk format. Therefore writes to block 0 (which might be the MBR or some superblock of a filesystem) are restricted, as the message says.

To overcome this, you might specify the disk format as format=raw; the definition then should read

sudo qemu-system-arm -m 1024 -cpu cortex-a57 -M virt -nographic -drive file=flash0.img,format=raw,if=pflash -drive file=flash1.img,format=raw,if=pflash -drive if=none,file=xenial-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -device virtio-net-device,netdev=net0,mac=$randmac -netdev type=tap,id=net0
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .