Partner links

How to import a virtual machine image into VirtualBox

bridge networking for VirtualBox

This post shows how to import a virtual machine image into VirtualBox. Or more correctly, how to create a VirtualBox guest operating system from an existing .vdi image file.

About a month ago, one of my hard drives gave up suddenly. Well, it wasn’t all that sudden, because for weeks prior, it had been sending signals that were not good.

I just didn’t pay it the attention it deserved.

So one evening, while I was finishing up a post, it sent the last signal and just died. And with that, I lost access to data that was on it. Luckily, I was able to recover all the data, including the VirtualBox folder that contained the virtual machine images of the guest operating systems that I had installed.

Those VirtualBox guest operating systems were used for the latest articles I wrote for DigitalOcean, so I needed to recreate them. Details of how I went about the task follows.

First a quick introduction to the contents of the VirtualBox folder on a Linux distribution.

When you create a guest operating system in VirtualBox, the machine image is created in a subfolder bearing its name under the VirtualBox VMs folder in your home directory. Within all the subfolders in that directory, is a file with a .vdi extension. That file is like an ISO image used to install a Linux or BSD distribution.

With that file, you can recreate the guest operating system on any other machine.

So after recovering my files from the dead, now partially resuscitated, hard drive, I saved the VirtualBox folder as oldVirtualBoxVMs, installed and launched VirtualBox on the new hard drive (same computer, but sporting a new hard drive).

Creating a new guest operating system from the existing .vdi images is really simple. Start by clicking the New button. Give the new guest OS a name and be sure to select the appropriate distribution, which should be the same version as the one whose .vdi image you’ll be importing. Next.

Create VirtualBox gest operating system

Figure 1: Creating a new VirtualBox guest operating system

Assign RAM to it. Next.

Assign RAM to VirtualBox guest OS

Figure 2: Assign RAM to VirtualBox guest operating system

At the step shown in Figure 3, select the Use an existing virtual hard disk file option, then click on the folder icon to the right of the combo box under it.

VirtualBox virtual hard drive

Figure 3: Create virtual hard drive for VirtualBox guest operating system

Navigate to the folder where you saved the virtual machine image. Select it, then click Open.

import virtual machine image into VirtualBox

Figure 4: Selecting existing .vdi image for VirtualBox guest operating system

Back to this step, click Create. You’ve just created a new VirtualBox guest operating system from an existing virtual hard disk file.

import virtual machine image into VirtualBox

Figure 5: Importing virtual machine image into VirtualBox

Before starting the new guest operating system, configure it to use bridge networking to get its IP address. To do that, click the Settings button, then click on the Network tab. From Assign to, select Bridged Adapter. OK.

bridge networking for VirtualBox

Figure 6: Set up bridge networking for VirtualBox guest operating system

After that, you may start the new guest operating system. Repeat the procedure using other existing virtual machine image that you have to import.

Share:

Facebook
Twitter
Pinterest
LinkedIn

Partner links

Newsletter: Subscribe for updates

Subscribe
Notify of
guest
2 Comments
Inline Feedbacks
View all comments
Christo
Christo
4 years ago

Just a note for users running Mageia. Mageia was not included in the Version selection list on my first set up attempt as seen in the Name and Operating System dialog above. (VBox comes with Mageia.) Checking my facts in writing this post, I found it very much there. The difference is that I installed the VBox Extensions Pack two day ago. I do daily shut downs, so the list must have been updated on cold start ups. I left things VBox as they were when I picked up the issue.

Ian
Ian
7 years ago

Thanks, this helped me greatly

Get the latest

On social media

Security distros

Hacker
Linux distros for hacking and pentesting

Crypto mining OS

Bitcoin
Distros for mining bitcoin and other cryptocurrencies

Crypto hardware

MSI GeForce GTX 1070
Installing Nvidia GTX 1070 GPU drivers on Ubuntu

Disk guide

LVM
Beginner's guide to disks & disk partitions in Linux

Bash guide

Bash shell terminal
How to set the PATH variable in Bash
Categories
Archives
2
0
Hya, what do you think? Please comment.x
()
x