Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert flat raw disk image to vmdk for virtualbox or vmplayer?

I have some old images of old Linux filesystems in flat file format. they can be used by Bochs, but I need to run them with Virtual Box. Virtual Box cannot use images in this format, so I need to convert these images from flat file to .vmdk file format. Is there any way to do this?

like image 385
okutane Avatar asked Jan 18 '09 10:01

okutane


People also ask

What is VMDK file in VirtualBox?

VMDK (short for Virtual Machine Disk) is a file format that describes containers for virtual hard disk drives to be used in virtual machines like VMware Workstation or VirtualBox.


2 Answers

First, install QEMU. On Debian-based distributions like Ubuntu, run:

$ apt-get install qemu 

Then run the following command:

$ qemu-img convert -O vmdk imagefile.dd vmdkname.vmdk 

I’m assuming a flat disk image is a dd-style image. The convert operation also handles numerous other formats.

For more information about the qemu-img command, see the output of

$ qemu-img -h 
like image 74
krosenvold Avatar answered Sep 27 '22 00:09

krosenvold


Since the question mentions VirtualBox, this one works currently:

VBoxManage convertfromraw imagefile.dd vmdkname.vmdk --format VMDK 

Run it without arguments for a few interesting details (notably the --variant flag):

VBoxManage convertfromraw 
like image 21
Lloeki Avatar answered Sep 23 '22 00:09

Lloeki