VBoxManage converts the whole disk to .img. But I want to write only one partition in the vdi image to a partition on my physical disk.

1 Answer 1



  1. Firstly you must Login to Guest OS on Virtual Box

  2. create a label for filesytem and add it to /etc/fstab.

  3. Reboot

  4. Dont forget to check if Guest OS is ok Then Shutdown

  5. Than go to VirtualBox Installation path on Windows Host OS and run the VBoxManage command to convert from (.vdi) to (.img)

  6. Create label on Guest OS for filesystems

This is step 1.

Logged in to Guest OS (Ubuntu) to create a label for my filesystem. So the file-system is know by label and not by any defined partition. Check filesystem type And type

• root@niaf-VirtualBox:/home/niaf# df -T

• Create Label:

root@niaf-VirtualBox:/home/niaf# niaflabel /dev/sda1 niaf1

• mount command

root@niaf-VirtualBox:/home/niaf# mount -l

• than your /etc/fstab file must edited:#UUID=f6fb2bc7-d0f9-4a91-ab2d-1d7be4cb2055 / ext4 errors=remount-ro 0 1

LABEL=niaf1 / ext4 errors=remount-ro 0 1

• Reboot and check if you are good with the guest os (for me things were good)

• now shut down the Guest OS

This is Step 2:

Go to Virtualbox installed path on Windows (Host OS) and run below command:

to convert .vdi to .img file :

C:\Program Files\Oracle\VirtualBox>

C:\Program Files\Oracle\VirtualBox>VBoxManage cloned

D:\Softwares\ubuntu10.vdi ovm.img -format raw

C:\Program Files\Oracle\VirtualBox>dir

05/06/2012 06:36 PM 6,477,053,952 ovm.img

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.