Creating portable .VMDK packages with QEMU?

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
Space Cadet
Posts: 6
Joined: Sun Feb 26, 2023 1:21 am

Creating portable .VMDK packages with QEMU?

Post by Kmudle »

Hello all,

I'm working on a thesis project where I'm attempting to package fully configured VMs as single files (.vmdk files along with supporting metadata) that can be ported or transferred to other computer systems. This is very simple with Virtual Box, but is this possible with QEMU as well? Are there any resources that might explain how to do this that I should be reading up on?

Thanks very much~
User avatar
Forum All-Star
Posts: 3878
Joined: Fri Nov 27, 2009 5:11 am

Re: Creating portable .VMDK packages with QEMU?

Post by adespoton »

Do you mean you're looking for a QEMU equivalent to an OVA file?

VMDK is just a disk image -- QCOW2 is the default disk image for QEMU.

If you want to create an OVA equivalent and you're staying away from Windows, a shell script with the QCOW2 image in-line would work well.
If you're only dealing with Windows, a bat or powershell script would work well. And if you're using the latest Win11, you could probably make it work with a shell script too.

Then to "install" the configuration, you run the script, and it unpacks itself into a folder with the appropriate file paths in the config script and the qcow2 file in the same folder.

You could probably even do one better, and write a combo shell/batch script with QEMU binaries and config files all embedded, so if you run it on Windows, it extracts the exe and qcow2 and writes a Windows launch script, and if you run it on anything else it extracts the macOS or Linux binary and the qcow2 and writes a sh launch script.

The tricky bit with all this is that QEMU itself is just the runtime; it's not a virtual machine/emulated machine manager like VBox is. So how your config is set up/managed depends on your manager.

For instance, I use UTM for most of my QEMU images, and it has portable packages you can move between hosts, and even has an online library of install packages you can just download and run to set up a new emulated machine from scratch.

KQEMU has its own packaging system, as does KVM. As does... VirtualBox, which also runs an old version of QEMU under the hood for hardware virtualization.
User avatar
Expert User
Posts: 5897
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Creating portable .VMDK packages with QEMU?

Post by Cat_7 »

While packaging might work for Windows with one warning about the provenance of the executable bat or exe file, you will run into some extra trouble with macOS hosts.
As you know from macOS our downloads, you need to perform some steps to get the executable to run. This is different from executables that went through the Apple approvement system. Every user would need to do this.

Virtual box can be seen as a Qemu program that is already installed, while you only provide the configuration and disks.

Post Reply