0

I am trying to build linux from scratch. I ll install it into virtualbox. Later I want to extract ext2 filesystem in it. Is it possible?

EDIT: I want to extract root.ext2 filesystem in vdi, to mount it in Ubuntu desktop environment and chroot into it.

EDIT2: moderators marked my topic as duplicate but it's not duplicate of above mentioned topic at all.

I found complete answer of my question. I post the link as a reference to people who seek the same answer: http://www.turnkeylinux.org/blog/convert-vm-iso

kenn
  • 5,232

2 Answers2

0

I have not tried it, but these could be the steps:

  1. map a host folder as shared folder in virtual box machine.
  2. use dd command from within the vm to raw copy the vm disk to a file in the shared folder.
  3. use the raw file and dd to write it to a real hardisk.
  4. use something like gparted to strech the partition to the harddisk length, if not same size.
  5. boot for that partition and see it if works.
ppp
  • 16
0

If your VDI is of type static then you can use a loop mount to mount the VDI in your host using ntfs-3g and just accesses it like any other file system.

If it is a dynamic VDI then you can create a temporary VM using a liveCD. Then temporarily release your VDI from your XP VM and assign it to this VM. When you boot the live CD you can then open a command shell and do

    sudo -i
mkidir /xp
mount -t ntfs3g /dev/hda1 /xp
cd /xp
#You can now access and edit the XP VDI

If you want to move files to and from the host, there are various ways: e.g. a second static VDI which you can then loop mount on your host; good old ftp ...

Simplew
  • 906