How do you copy a virtual machine/hard drive?

This is for discussing general topics about how to use VirtualBox.
Post Reply
jhsu
Posts: 7
Joined: 21. Oct 2010, 00:52
Primary OS: Mepis
VBox Version: OSE Debian
Guest OSses: antiX Linux

How do you copy a virtual machine/hard drive?

Post by jhsu »

VirtualBox doesn't allow me to copy a virtual hard drive installation of a Linux distro. I'm experimenting with minimal Debian installations. What I'd like to do is start of with a bare-bones Debian installation and start adding packages. Unlike other distros (like antiX Linux and Puppy Linux), Debian does NOT install in a hurry, so I don't want to have to redo the installation every time just to try something different. I just want to go back to the original bare bones installation. Is that too much to ask? How do you get around this restriction?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: How do you copy a virtual machine/hard drive?

Post by mpack »

You should choose a better forum for questions like this (e.g. Linux hosts), as the optimal answer and potential issues may vary depending on the particular host or guest.

In the case of your Linux host, use the facilities of your host OS to copy the VDI file. Then use "VBoxManage internalcommands sethduuid <vdi filename>" to change the UUID inside the VDI. The latter step is necessary to allow it to be registered on the same host as the original. Once the VDI copy is registered you create a new VM around it, similar to the first VM.

I have skipped some important caveats related to this procedure in Linux since "Using VirtualBox" is not an appropriate forum for that discussion.
Post Reply