Can I extract files from VDI file???

Discussions related to using VirtualBox on Linux hosts.
Post Reply
taekr
Posts: 6
Joined: 18. Jun 2008, 05:36

Can I extract files from VDI file???

Post 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.
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Post 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.
aquarius
Posts: 69
Joined: 3. Jun 2008, 22:35
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: MS Windows XP

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post 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 ;).
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
taekr
Posts: 6
Joined: 18. Jun 2008, 05:36

Not sure..

Post 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.. ^ ^
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post 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 ...
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
taekr
Posts: 6
Joined: 18. Jun 2008, 05:36

one more question??

Post 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
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post 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.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
taekr
Posts: 6
Joined: 18. Jun 2008, 05:36

Thank you very much

Post 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..!!!!
caminero
Posts: 10
Joined: 21. Dec 2007, 16:45

Post 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
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post 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.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Post Reply