Then detach (and remove) vmdk disk from the VM and attach the vdi image.

After you get the image, make sure it is not running and execute the
fabtest-preparevm script (pass your VM name or uid to it):

fabtest-preparevm Lenny

This command configures port forwarding (127.0.0.1:2222 to guest 22 port,
127.0.0.1:8888 to guest 80 port) and takes 'fabtest-initial' snapshot
used for test rollbacks (it is taken from booted machine in order to
speedup tests).

Writing tests

Subclass fabtest.VirtualBoxTest or fabtest.FabTest and use fabtest.fab for
fabric commands execution: