Recently I lost everything on my PC and reinstalled Windows. But I have my old Ubuntu virtual machine's .vdi file.
Can I make a virtual machine with that .vdi file? If so, how?
2 Answers
If you are using VirtualBox, then it is not too difficult to take a VDI and use it anywhere. Here's how:
- copy your
.vdifile to a directory where VirtualBox will be able to access it - run VirtualBox and create a new virtual machine
- choose Ubuntu Linux as the operating system and click "Next"
- under the "Virtual Hard Disk" option, choose "Use existing hard disk". This will open the "Virtual Media Manager".
- in the Virtual Media Manager, click the "Add" button and select the
.vdifile that you copied, then click "Next" - configure the rest of the virtual machine as you would like it to be
- start the virtual machine
So long as the .vdi file has not been corrupted, it will work just fine.
Convert VDI File to Full Install
You also have the option to convert a .vdi file to an .img file and flash that to HDD or USB.
Log into Ubuntu.
Open VirtualBox
cd to folder that contains ubuntu.vdi and run:
VBoxManage clonemedium --format RAW ubuntu.vdi ubuntu.img
This will create the Ubuntu image file
Install Image File to target drive
Caution: The target drive will be overwritten.
- Use Gnome-Disks, Etcher, Rufus, dd or mkusb when you want to restore or clone the image to another HDD or USB drive.
For using Etcher or Rufus to flash an image to HDD see:
4