1

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?

Dan
  • 14,180

2 Answers2

8

If you are using VirtualBox, then it is not too difficult to take a VDI and use it anywhere. Here's how:

  • copy your .vdi file 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 .vdi file 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.

matigo
  • 24,752
  • 7
  • 50
  • 79
4

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: https://askubuntu.com/a/1333112/43926

C.S.Cameron
  • 20,530
  • 12
  • 78
  • 125