Page 1 of 1

Can I extract files from VDI file???

Posted: 6. Sep 2008, 11:20
by taekr
HI,

Can I extract files from VDI file? Is it possible? I need to get some files before reinstalling XP.

I got userinit.exe error on start-up .. and I desperately need to get some data from the file..

If can, could you tell me what program to use in Ubuntu?

I have been doing search for three hours and can not seem to find any.

Posted: 6. Sep 2008, 11:38
by stefan.becker
You can install XP in a new VM. After installation add old VDI as second Hard Drive and you can copy files.

Posted: 6. Sep 2008, 12:03
by aquarius
you can also make a new VM with some modern linux live CD. Just boot from the live CD having the XP VDI attached. Save your files using USB Media, shared folders or some network share on the host.

Posted: 6. Sep 2008, 14:24
by Sasquatch
aquarius wrote:you can also make a new VM with some modern linux live CD. Just boot from the live CD having the XP VDI attached. Save your files using USB Media, shared folders or some network share on the host.
Not needed to create a new VM, just mount the CD to the current VM and boot it from there ;).

Not sure..

Posted: 6. Sep 2008, 15:05
by taekr
Sasquatch wrote:
aquarius wrote:you can also make a new VM with some modern linux live CD. Just boot from the live CD having the XP VDI attached. Save your files using USB Media, shared folders or some network share on the host.
Not needed to create a new VM, just mount the CD to the current VM and boot it from there ;).
Thank you for the reply..

However, I'm not sure I'm following what you are saying.

How to attach the xp VDI to the live CD??? My Linux is fine.. It's just that WinXp won't boot. I'm running XP in Linux..

Could you please explain it more clearly? Sorry for the trouble.. ^ ^

Posted: 6. Sep 2008, 15:34
by TerryE
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

Code: Select all

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 ...

Posted: 6. Sep 2008, 16:06
by Sasquatch
What I meant is you do what Aquarius said, but you don't need a separate VM for that. Since you already have an XP VM, which doesn't boot XP properly anymore, boot from a Linux CD instead of a Windows install cd. You can try a system repair from an XP install cd though.

Same thing as if you would do with a bare hardware install. Instead of taking the hard drive out and put it in a different computer, boot the PC with a Linux Live CD and put he important files on a USB drive.

one more question??

Posted: 6. Sep 2008, 17:30
by taekr
TerryE wrote: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

Code: Select all

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 ...
Thanks again for your reply..

Got one more question (sorry..)

I did some research.. and did the followings: (there is a folder called 'a' under media)

1. I moved to where vdi file is stored.

2. sudo losetup /dev/loop0 Winxp.vdi <-- passed (because there was no error message)

3. sudo mount -t ntfs3g /dev/loop0 /media/a
mount: unknown filesystem type 'ntfs3g'

4. sudo mount -t ntfs /dev/loop0 /media/a
NTFS signature is missing.
Failed to mount '/dev/loop0': Invalid argument
The device '/dev/loop0' doesn't have a valid NTFS.
Maybe you selected the wrong device? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?

5. so I even tried
sudo losetup /dev/hda1 Winxp.vdi
/dev/hda1: No such file or directory


still not working. What went wrong???

Here is the information about my harddisk justi n case you need it.

sudo fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000344bc

Device Boot Start End Blocks Id System
/dev/sda1 * 1 12 96358+ 83 Linux
/dev/sda2 13 1288 10249470 83 Linux
/dev/sda3 1289 10212 71682030 83 Linux
/dev/sda4 10213 30401 162168142+ 5 Extended
/dev/sda5 10213 26704 132471958+ 7 HPFS/NTFS
/dev/sda6 26705 30401 29696121 7 HPFS/NTFS

Disk /dev/sdb: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000bb49e

Device Boot Start End Blocks Id System
/dev/sdb1 1 91201 732572001 83 Linux

Posted: 6. Sep 2008, 17:33
by Sasquatch
NTFS-3g mounts with the exact same name, ntfs-3g, so use that dash too ;). I don't have experience with raw disk mounting, can't help you with anything else.

Posted: 6. Sep 2008, 18:12
by TerryE
Sorry typo: ntfs-3g.

Also you should have googled losetup site:forums.virtualbox.org as I keep telling people to do. Not sure why I bother. If you'd done so, then you would see that you need to specify an offset into the VDI. See for example http://forums.virtualbox.org/viewtopic.php?t=8455.

You can mount devices anywhere, but the thing about /media is that nautilus automatically enumerates any mount points listed here. Don't use a (that's for the floppy). Why do sudo mkdir /media/loopVDI and its obvious what it is? Then use that.

Also remember that you should only mount this device when you are not running the VM.

Thank you very much

Posted: 8. Sep 2008, 13:57
by taekr
Thank you very much, TerryE and Sasquatch.

I was able to search for the answer through your help..

I did some search again.. and.. . found the following sites:

http://norman.hooper.name/blog/posts/Co ... _on_Linux/

http://muralipiyer.blogspot.com/2008/02 ... entic.html

By looking at the both site, now I can mount VDI file ...

Thanks for your help..!!!!

Posted: 15. Sep 2008, 07:01
by caminero
what about a vdi with a sav file ?

if i use only the vdi, i get old data, i need the newest one.


Regards.

Pablo

Posted: 15. Sep 2008, 13:31
by TerryE
For that you need a proper VDI loop mount and this doesn't exist. Sorry.

If you want to share stuff with your host using this technique then the best way is to add an extra HDD specifically for this purpose, that is static writethough drive. This will allow you to continue to use snapshots for your main work, but still have a shareable (and not snapshotted) area.