Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i Extract Files From VDI

I was using VirtualBox on my PC(WIN 7)

I managed to View some files in my .VDI file..

How can I open or view the contents of my .vdi file and retrieve the files from there?

like image 638
Rai Micheal Avatar asked Jun 03 '13 09:06

Rai Micheal


People also ask

How do I view the contents of a VDI file?

To open VDI file, please follow the steps, Run PowerISO. Click the "Open" button on toolbar or choose "File > Open" menu to open vdi file. If there are more than one partition in the vdi file, PowerISO will list all partitions, you need select a partition from the list to continue.

Can I copy VDI file?

There are two simple methods that you can use to export a VirtualBox virtual machine. The first method is to use the built-in Export function to generate an exportable VDI file. The other method is to copy and paste the entire VM folder you want to move.

How do I open a VDI file without VirtualBox?

follow the below steps to open Source VDI file in Windows: Download and Install the tool VDI recovery on your system. Choose the disk type and hit the Browse button to select a location of VDI file, you wish to recover. After file selection, you can now view the VDI file contents.


1 Answers

You can mount partitions from .vdi images using qemu-nbd:

sudo apt install qemu-utils
sudo modprobe nbd

vdi="/path/to/your.vdi"  # <<== Edit this

sudo qemu-nbd -c /dev/nbd0 "$vdi"

# view partitions and select the one you want to mount.
# Using parted here, but you can also use cfdisk, fdisk, etc.

sudo parted /dev/nbd0 print
part=nbd0p2 # <<== partition you want to mount

sudo mkdir /mnt/vdi
sudo mount /dev/$part /mnt/vdi

Some users seem to need to add a parameter to the modprobe command. I didn't with Ubuntu 16.04, but if it doesn't work for you, try adding max_part=16 :

sudo modprobe nbd max_part=16

When done:

sudo umount /dev/$part
sudo qemu-nbd --disconnect /dev/nbd0
like image 55
mivk Avatar answered Sep 21 '22 05:09

mivk