Virtual To Physical (V2P) using VirtualBox


Jarret W. Buse

Virtual To Physical (V2P) using VirtualBox

Some people may want to use their virtual system as a physical Operating System on a PC. Once a virtual system is configured the way it is needed and all the applications work properly, you may want to make it a real system. There may be many reasons to move an existing virtual environment to a physical one.

The process may take a little time and plenty of disk space.

Of course, VirtualBox will be installed and have a virtual machine which is running as perfectly as you may wish. Choose a Virtual Machine to use and select the virtual system. Right-click the virtual machine and select “Settings...”. A window should open which contains the settings for the machine. Select “Storage” in the left-pane. In the right pane, place the mouse cursor on the VDI file and do not move the mouse. A “Hint Window” should appear showing the location of the VDI file as shown in Figure 1.

Figure 1.jpg


The VDI file is located on the top line as shown in the figure. Note the directory location and VDI filename because the information will be used later.

The next step is to find the location of the “VBoxManage” file on your system. The best way is to open a Terminal and enter the command “whereis VBoxManage”. The standard location is at “/usr/bin”. In this case, the file resides in a path which is searched and will be executed no matter the current directory.

In a terminal, change the current directory to the location of the VDI file (this makes it all a little easier). In the example from Figure 1, I would change it to “/media/jarret/Toshiba\ Ext/VirtualBox/Lubuntu”. Once in the proper folder, run the following command: “VBoxManage internalcommands converttoraw file1.vdi file2.img”. Replace “file1” with your VDI filename and replace “file2” with the output filename. Once the image is created, you simply rename the file to an ISO extension.

NOTE: It works to give the ISO file extension on the VBoxManage command and not have to rename it after. Keep in mind that a simple ISO file viewer may not open the ISO file created. The image is a RAW image, but can be mounted and opened with a program such as “Disk Image Mounter”.

Once the ISO file is created, it is time to create the Physical portion of the Virtual Operating System (OS). One way to do this is to create a bootable USB device. Thumb drives will work if two items are properly performed:

  1. Thumb Drive space is larger than the original Virtual Drive size
  2. Original Virtual Drive properly boots directly from the VDI file

NOTE: Another major importance with an image on the thumb drive is that the original CPU type must match another system if the thumb drive is booted on another system.

Rather than using a USB drive, the image can be placed onto a hard disk. The hard disk will work in a similar fashion as a USB drive with the same two requirements.

When writing the ISO image to a drive, you need to use “GParted” or a similar program to remove the partitions from the drives. Use “GParted” to also determine the specific device name of the device to which you are writing the image. For example, let's assume that I am writing my Lubuntu image to a thumb drive which is “/dev/sdc”.

NOTE: Be sure to have the device name correct so the right drive is written on, and the wrong disk and data is not overwritten.

There are many USB Writer applications, but the best tool I have used is also the quickest. The utility comes with Linux systems and runs from a Terminal. The command to run is: “sudo dd if=file1.iso of=drive”. The option for “file1” should be replaced with the ISO filename and the “drive” is replaced by the device name of the device to which you are writing. For example, using the previous examples, the command would be: “sudo dd if=Lubuntu.iso of=/dev/sdc”. The example assumes that the current directory is the location of the ISO file, otherwise the path should be given as well.

Once the writing is complete, the system needs to be rebooted and if needed, select the USB device in the BIOS or boot list.

The time to convert the VDI to an ISO can take awhile and the larger the VDI, the longer the conversion can take. Writing the ISO to a device using the “dd” command will show no output information until the writing is completed. Again, the writing takes longer the bigger the ISO file.


  • slide.jpg
    17.9 KB · Views: 26,873

Members online