6

I have set up a virtual machine with Xubuntu Linux in VirtualBox.

The disk is 4.5 GB a .vdi file.

How can I make an IMG or ISO file from this, such that I can then write it into a bootable USB flash drive,

  • either with Rufus disk imager software (on Windows)

  • or with dd if=myvm.img of=/dev/sdc

?

TL;DR: I'm searching for a convert-vmdisk myvm.vdi myvm-bootable.img tool.


I've already tried answers from Is it possible to convert virtual machines to physical environments? and especially

VBoxManage internalcommands converttoraw file.vdi output.img

but then after writing this .img to a USB flash drive (with Rufus), the PC won't boot on this USB flash drive.

Linked topic: https://forums.virtualbox.org/viewtopic.php?t=40124

Basj
  • 2,143

1 Answers1

6

After a few number of attempts, finally this works:

VBoxManage internalcommands converttoraw file.vdi output.img

Then Rufus to write it to a USB flash drive or external USB HDD.

Initially, I couldn't boot this device on computer startup.

Reason: my BIOS was set up on "UEFI only". I switched this parameter to "Both (UEFI and Legacy)", and "Legacy first". Then it works!

Basj
  • 2,143