Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

Steps:

  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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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