Workaround for problems cloning a VirtualBox disk
By drapeau on Jan 06, 2009
One of the great things about these virtual machines is that your whole environment is just a single file on disk. Want to do play around with your operating system? No problem; just make a backup copy of the .vdi file (or in VMware land, your .vmdk file), which is your OS disk. I like to create a VM, install my standard Windows XP OS and applications, then make a copy of that image so that later, when the OS gets corrupted by viruses and what not, I can go back to a nice, safe working state.
There's an easy way to make copies of your virtual machine in VirtualBox. If your virtual machine's hard disk is called something like "WindowsXP.vdi", just type "VBoxManage clonevdi WindowsXP.vdi copyOfWinXP.vdi" and VirtualBox will create a nice copy of your Windows image, saving it in a file called "copyOfWinXP.vdi".
Except that it doesn't work with VirtualBox 2.1.0. There's a bug, bug #2813, that prevents the cloning from working exactly right. The result is that you'll have problems booting up your virtual machine. The bug is known and a fix is already checked into the source tree for a future version, but until then, here's the workaround:
- copy your original VDI file using normal file copy mechanisms (e.g., "cp WindowsXP.vdi copyOfWinXP.vdi")
- type "VBoxManage internalcommands sethduuid copyOfWinXP.vdi"
Powered by ScribeFire.