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 Answers
Steps:
Firstly you must Login to Guest OS on Virtual Box
create a label for filesytem and add it to /etc/fstab.
Reboot
Dont forget to check if Guest OS is ok Then Shutdown
Than go to VirtualBox Installation path on Windows Host OS and run the VBoxManage command to convert from (.vdi) to (.img)
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
- 187