# How to load a mender qemu image in virtualbox?

**URL:** https://hub.mender.io/t/how-to-load-a-mender-qemu-image-in-virtualbox/1609
**Category:** General Discussions
**Tags:** warrior, qemu
**Created:** [March 5, 2020, 12:04pm UTC](https://hub.mender.io/t/how-to-load-a-mender-qemu-image-in-virtualbox/1609 "2020-03-05T12:04:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dbensoussan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dbensoussan/32/263_2.png) [@dbensoussan](https://hub.mender.io/u/dbensoussan)
#### Post date: [March 5, 2020, 12:04pm UTC](https://hub.mender.io/t/how-to-load-a-mender-qemu-image-in-virtualbox/1609/1 "2020-03-05T12:04:26Z")

</div>

Mirza’s tutorial [QEMU, the FAST! processor emulator (Ubuntu)](https://hub.mender.io/t/qemu-the-fast-processor-emulator-ubuntu/1550) explains how to boot the generated image with qemu well and it works flawlessly. Now i’m trying to port this to Virtualbox. I hesitated posting about it on this forum as this is not directly Mender related, but since the vmdk file works on Virtualbox without Mender (I also tested), I think it can interest many people.

The qemu command I use, based on mender-qemu script:

```auto
qemu-system-x86_64 \
    -m 512M \
    -drive file=ovmf.qcow2,if=pflash,format=qcow2,unit=0,readonly=on \
    -drive file=ovmf.vars.qcow2,if=pflash,format=qcow2,unit=1 \
    -nographic \
    -drive file=file.uefiimg,if=ide,format=raw

```

QEMU image is great for development but the motive is to ship the VM to customers in a one file format on a software that is well known by customers in general, hence Virtualbox.  
Yocto can also provide a “wic.vmdk” image but in this case it is not “mender compatible” as only the uefiimg generated by Mender works (along with the bios one).

I read that it seems possible to convert a qemu image to a raw image, then to a vdi ([http://www.whitemiceconsulting.com/node/37](http://www.whitemiceconsulting.com/node/37)) but the bootloader image and data are in separate files.

Edit:  
I converted the uefiimg to a vdi and added as hard drive under a “Controller: AHCI”, the image boots as you can see here: [https://imgur.com/a/0jOednl](https://imgur.com/a/0jOednl) but then, constant black screen.  
Command I used to convert:  
`VBoxManage convertfromraw file.uefiimg --format vdi file.vdi`

Thanks

---

<div class="post-metadata">

### Author: ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)
#### Post date: [March 5, 2020, 2:34pm UTC](https://hub.mender.io/t/how-to-load-a-mender-qemu-image-in-virtualbox/1609/2 "2020-03-05T14:34:57Z")

</div>

Hi @dbensoussan one possibility is to use the HDDIMG file. It is setup with a grub entry for “install” that will write the uefiimg to a second storage device. It’s not a single step but may work for you.

Note that I have not tried this with the QEMU machine types or with Virtualbox so there may be issues but it should be doable.

---

<div class="post-metadata">

### Author: ![dbensoussan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dbensoussan/32/263_2.png) [@dbensoussan](https://hub.mender.io/u/dbensoussan)
#### Post date: [March 5, 2020, 3:11pm UTC](https://hub.mender.io/t/how-to-load-a-mender-qemu-image-in-virtualbox/1609/3 "2020-03-05T15:11:05Z")

</div>

Thanks @drewmoseley. Ironic, but I actually just had to wait, the image boots after around 15 seconds of black screen. (Great things happpen when fetching a tea 😉 )
