How to Clone/Backup a VirtualBox DomU

Posted by JD 09/02/2008 at 14:12

Steps to clone/backup a VirtualBox domain

that can be restored to the same or a different machine. Start by shutting down the VM to be backed up/cloned. Then …

$ VBoxManage clonevdi Master.vdi Clone.vdi

and the (undocumented) function

$ cp Master.vdi Clone.vdi
$ VBoxManage internalcommands setvdiuuid Clone.vdi

The 2nd command stuffs the clone with a new SID.

Warning – this doesn’t backup any SNAPSHOTs

you may have made below the {root} VDI file. Here’s a directory view

 C:.
├───Machines
│ ├───Ubuntu Upgrades
│ │ └───Logs
│ └───WinXPPro
│ ├───Logs
│ └───Snapshots
└───VDI

VDI/ contains the base installations. Machines/ contains each XML DomU description file and snapshots where they exist. You need these for your backup too. Copying the .vdi files is not enough to back them up. While it will probably work on the same PC with VirtualBox, taking those files to another machine with a slightly different configuration may not work. Use the VBoxManage command.

_* I’m not responsible if this doesn’t work for you. Always work with test data when you are doing any of this until you prove it works on your machine.

Trackbacks

Use the following link to trackback from your own site:
https://blog.jdpfu.com/trackbacks?article_id=251