clear, easy instructions to move VM with snapshot

This is for discussing general topics about how to use VirtualBox.
Post Reply
odoyle81
Posts: 24
Joined: 18. Nov 2010, 07:55
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: Ubuntu

clear, easy instructions to move VM with snapshot

Post by odoyle81 »

Hi,
I'm having trouble finding clear, easy, step by step instructions on how to move a VM with snapshots to another location. Moving a VM is simple.. I just move the folder with the .vdi file.. but the snapshots seem to be stored in a different location.. Specifically, I already have the vdi on an external hard drive, but the snapshots are on the local drive, and I want everything to be portable on the external. I found various instructions in topics with many pages and various step by step instructions that seem out of date. Can anyone point me in the right direction?

btw, I'm using 4.3.8 and the VM I want to move was created with this version.

Also, if it is easier, how do I just merge the snapshots back into the VM? Then I wouldn't have to move anything. Right?

Thanks!!
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: clear, easy instructions to move VM with snapshot

Post by mpack »

The snapshots are not stored in a different location, they are stored in a subfolder of the same location. So provided you always move the entire VM folder with contents - and don't pick and choose files - then whether a VM has snapshots or not makes no difference to the procedure.

Howto: Move a VM.

The easiest way to get rid of snapshots is to clone the VM: full clone, current state only, don't reset MAC address. Note that while simple, this method does cause all UUIDs to change, which can cause problems sometimes, e.g. Win7 will want to be reactivated (fix: reactivate), Linux grub scripts sometimes can't find the boot disk (fix: identify boot disk by device name, not UUID).
odoyle81
Posts: 24
Joined: 18. Nov 2010, 07:55
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: Ubuntu

Re: clear, easy instructions to move VM with snapshot

Post by odoyle81 »

Ok, maybe I'm confused. When I created this VM, I created a new virtual hard drive on the external drive. So in my case, I think the vdi & snapshots are in two different locations? So all I need to do is move the "virtual machines" subdirectory to the external as well, and then I will have everything I need?
My snapshots are here:
C:\Users\paul\virtual machines\JoinMapWinXP
My .vdi file is here:
H:\JoinMap VirtualBox\

Thanks!
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: clear, easy instructions to move VM with snapshot

Post by mpack »

That means you put the base VDI in the wrong place, meaning you overrode the default - which was your own decision.

If you intended to create the VM on a volume with more space then the correct method was to set File|Preferences|General|Default Machine Folder prior to creating the VM, not locate the VDI outside the VM folder.

The quickest fix for what you have now is to follow the instructions linked above to move the VM folder. Then shut down VirtualBox, move the base VDI into the VM folder, then edit the <vmname>.vbox file, <HardDisks> section, removing the path part of the base VDI filename.
odoyle81
Posts: 24
Joined: 18. Nov 2010, 07:55
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: Ubuntu

Re: clear, easy instructions to move VM with snapshot

Post by odoyle81 »

Thanks so much! That was an easy fix. I didn't realize I was always creating VMs the wrong way, so thanks for educating me.
Post Reply