Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I usually take the upgrade path in ubuntu, rather than fresh install, but I'd like to try the latter route for 12.04.

However, one of the most thoroughly configured and critical tools on my system is the virtualbox windows virtual machine that I run for some key tasks I have not yet been able to move entirely to Linux.

How can I ensure that I completely back this up when I wipe and install for 12.04? Will it be in exactly the current state? Which files will I need to back up to guarantee all settings and content transfer correctly?

Also, a major part of my motivation in doing a fresh install is that I intend to go from a 32-bit 11.10 to a 64-bit 12.04 setup. Will this affect/break my virtual machine?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

You can use the "Appliance Export Wizard" in VirtualBox to export your VM and then import it again on your reinstalled system. I'm using VirtualBox 4.1.8, but this feature has been around for at least a couple of versions.

Exporting a VM

  1. Open VirtualBox

  2. Go to the File menu and select Export Appliance

  3. Select the virtual machine (VM) you want to export and click Next

  4. Choose where you will save the exported VM and click Next

  5. Review settings and click Export

Copy the exported VM to an external hardrive (or put it on a partition that will survive the reinstall). Once you've reinstalled, you can import the VM.

Importing a VM

  1. Open Virtualbox

  2. Go to the File menu and select Import Appliance

  3. Choose the file to import and follow the rest of the prompts.

share|improve this answer

Before wiping your drive it is always a good idea to backup your personal data in your home directory.

Therefore I am sure you already have plans to do so. In case your virtual disk images are stored there (usually in the hidden ~/.VirtualBox directory) your virtual disks will also be included in your backup of your HOME directory and they will be restored fully functional and untouched with your backup later.

However performing an upgrade from 32-bit Ubuntu to 64-bit Ubuntu can be done without deleting your data in your HOME. In case you keep your HOME you will just reinstall the virtual box application in your fresh Ubuntu installation to keep all your virtual machines (including snapshots) untouched.

Having said so, there may of course be cases where a backup of a virtual machine may be necessary (e.g. in case you want to build up a new home directory, you need to change your user name, or the virtual machines are not stored in HOME).

You then have the choice to export and import your machines in the Open Virtualization Format (OVF) either from the virtual box manager GUI or from the command line

VBoxManage export <nameofvm> -o <nameofmachine>.ovf
VBoxManage import <nameofvm>.ovf  # use --dry-run first to check configurations

Due to limitations from the OVF format this will not save the current state or snapshots of a given machine. You may clone a virtual machine and register it in a new installation but this may be more work than performing a conventional backup of ~/.Virtualbox and possible other locations you may have defined for storing the virtual hard disks.

I recommend reading the Virtual Box online manual to get an idea on options, procedures and limitations.

share|improve this answer
    
I like how thorough this is, but I also like how AMC's is very step-by-step. Both great answers. –  Mittenchops Mar 13 '12 at 18:41
1  
I also upvoted amc's answer ;) My intention was to add the missing bits especially that if you keep your HOME during the upgrade your VM's will just keep on running without anything else you need to do (zero-step-guide if you like). –  Takkat Mar 13 '12 at 20:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.