======================================= FreeBSD ZFS Snapshots & VirtualBox VM ======================================= A zfs snapshot of a running vm will result in a vm captured in a crash-consistent state. To make vms recoverable with zfs snapshots you should make a VirtualBox snapshot of the running vm first. This essentially makes the .vdi read-only which is exactly all we need. We do not need the snapshots. I also keep things simple and just use zfs snapshots and never use VirtualBox snapshots other than for this purpose. ======================================= Backup --------------------------------------- # list running vms oeng@guido:~ $ vboxmanage list runningvms # take a virtualbox snapshot oeng@guido:~ $ vboxmanage snapshot take --live # take a zfs snapshot oeng@guido:~ $ zfs snapshot -r tank/vm/@01 # list virtualbox snapshots oeng@guido:~ $ vboxmanage snapshot list # delete the virtualbox snapshot oeng@guido:~ $ vboxmanage snapshot delete ======================================= Recovery --------------------------------------- # list running vms oeng@guido:~ $ vboxmanage list runningvms # power off the vm oeng@guido:~ $ vboxmanage controlvm poweroff # restore from zfs snapshot oeng@guido:~ $ zfs restore tank/vm/@01 # list virtualbox snapshots oeng@guido:~ $ vboxmanage snapshot list # delete the virtualbox snapshot oeng@guido:~ $ vboxmanage snapshot delete # start the vm oeng@guido: ~$ vboxmanage startvm --type headless ======================================= Done =======================================