How to reset a vm

Discussions related to using VirtualBox on Windows hosts.
Post Reply
waltw
Posts: 4
Joined: 2. Mar 2019, 00:30

How to reset a vm

Post by waltw »

Can someone tell me if there is a way to reset a vm's state to boot cleanly from its snapshot/vmdk, or to create a new vm to use an existing snapshot as hard disk?

The documentation does not indicate that I can use a snapshot as the disk for a new vm.
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: How to reset a vm

Post by BillG »

What exactly do you mean by reset?

You cannot use a snapshot as the virtual disk to create a new vm. A snapshot file is simply the changes since the last snapshot. You could create a new vm from the base virtual disk (without all the snapshot data). This would be equivalent to deleting all the snapshots.

To get the current state of the vm on a single virtual drive you would need to merge all of the snapshots into the base drive.
Bill
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to reset a vm

Post by mpack »

I have no idea what "boot cleanly from its snapshot/vmdk" means. The style of the virtual image container makes no difference to how "cleanly" a VM boots... though "cleanly" clearly needs a definition!

If you clone a VM you'll be given the option to clone the current state only, which creates a new VM consisting of a single merged disk (no snapshots). Perhaps that is what you are looking for, though I'm still puzzled why vmdk would be mentioned.
waltw
Posts: 4
Joined: 2. Mar 2019, 00:30

Re: How to reset a vm

Post by waltw »

OK. thanks for the replies. I have used the command line tools to copy the virtual disk with snapshots to a new combined vdi, then created a new vm from that.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to reset a vm

Post by mpack »

waltw wrote:OK. thanks for the replies. I have used the command line tools to copy the virtual disk with snapshots to a new combined vdi, then created a new vm from that.
Are you aware that VirtualBox already provides a tool to do that, i.e. the tool I already described? Right click the VM and select "Clone...", if the VM uses snapshots then you'll be asked if you want to preserve the snapshot structure or keep the current state only. The latter means one merged disk.
Post Reply