- enable ACPI shutdown in the VM, see here and here for how to do this with Win 2K3
- shutdown the the VM: VBoxManage controlvm acpipowerbutton
- copy the VM's .vdi file somewhere. To change the UUID: VBoxManage internalcommands setvdiuuid disk2.vdi
- start the VMagain
This gives a copy of the VM but you have to down it and it has to stay down for as long as the copy takes.
Using R1Soft's Hot Copy for Linux, you can take a snapshot of a Linux filesystem.
And it's free!!! But not open source :-(
Steps (assuming root user - otherwise, sudo is your friend):
- Install Hot Copy - cribbed from here.
- Download R1Soft's key for their apt repository:
- Add the key:
apt-key add r1soft.asc
- Edit /etc/apt/sources.list and add the following at the end:
# R1Soft HotCopy
deb http://repo.r1soft.com/apt stable main
- apt-get update
- apt-get install r1soft-hotcopy
- Now you need to install their binary-only kernel driver - without giving you the source! Don't know how they do this exactly but it looks like we upload kernel headers from our machine, they compile the module and send it back to us. Weird.
hcp-setup --get-module (this can take a while depending on your upload)
- Take a snapshot of a filesystem:
hcp -m /mnt/t1 -c /dev/sda1 /dev/md1
- This creates a snapshot of /dev/md1 in /mnt/t1. The snapshot uses 'copy-on-write' which, as I understand it, works like this: Whenever there is a change to the source/original block, Hot Copy makes a backup of the original and keeps it in the snapshot. By default, these block backups are created on the source/original device but you can specify a different device if you wish - here I use /dev/sda1. Useful if there is not much space or if you don't want to be writing to your precious SSD :-)
- Copy your .vdi file somewhere. I'm using rsync for no particular reason...:
- Remove the Hot Copy session:
hcp -r /dev/hcp1
How did I know it was /dev/hcp1? With hcp -l. Guess it's OK as long as there is not more than one Hot Copy at a time.....
The copied .vdi file worked fine for me but, YMMV.