Projekt

Allgemein

Profil

VirtualBox40 » Historie » Revision 2

Revision 1 (Jeremias Keihsler, 12.01.2017 14:33) → Revision 2/3 (Jeremias Keihsler, 12.01.2017 14:35)

h1. VirtualBox 4.0 VM disaster recovery 

 h1. Backup (export VMs) 

 

 h2. Requirements 

 To backup the VMs you will need the following: 
 * @root@ access to the virtualbox-host (SSH or local) 
 * @vbox_control.sh@ script, which is not part of VirtualBox 

 

 h2. Preliminary Note 

 While a virtual machine could be imaged and restored like a phyisical machine using this method has the advantage that all meta-data like memory size, number of processors or MAC-adr of each NIC are saved as well. By restoring the virtual machine to another host you could do a perfect clone of the original machine. 
 *The virtual machines must be powered off during the backup.* 

 h2. Start Export 

 The VM-Export process is a three stage process: 
 * show the VMs currently running 
 * read in the VM-names to be saved from config file @/etc/virtualbox/machines_enabled_export@ 
 * stop the machines if they are running in the sequence given in the config file 
 * export each VM with current date in the filename into the current workingdirectory 
 * read in the VM-names to be started at boottime from config file @/etc/virtualbox/machines_enabled_start@ 
 * start the machines in the sequence given in the config file 
 <pre><code class="bash"> 
 cd ~ 
 /usr/local/bin/backup_vm.sh 
 </code></pre> 

 the @backup_vm.sh@ is a very simple shell-script doing: 
 <pre> 
 /etc/init.d/vboxcontrol status 
 /etc/init.d/vboxcontrol export 
 /etc/init.d/vboxcontrol start 

 exit 0 
 </pre> 

 h1. Restore (Import) 

 If the virtual machine already exists, we have to delete it first. 
 <pre><code class="bash"> 
 VBoxManage unregistervm example_VM --delete 
 </code></pre> 
 The VM-Import process is fairly simple 
 * goto the folder where your @.ova@ resides (@/mnt/extUSBdrive/VM_Backup@ needs to be replaced with your source-directory, @example_VM_110509.ova@ needs to be replaced with the actual backup of your VM) 
 * import with @VBoxManage@ 
 <pre><code class="bash"> 
 cd /mnt/extUSBdrive/VM_Backup 
 VBoxManage import example_VM_110509.ova 
 </code></pre> 

 h1. alternative ways of export/import 

 give the VirtualBox manual a chance. It can be found at http://download.virtualbox.org/virtualbox/UserManual.pdf