[Solved] Problems moving a .vdi file

Discussions related to using VirtualBox on Windows hosts.
Post Reply
BCosell
Posts: 73
Joined: 12. Jul 2017, 20:27

[Solved] Problems moving a .vdi file

Post by BCosell »

Dumb newbie here, so apologies:

I'm running VB 5.1.22 on win7/pro. I've read several articles about moving a .vdi file for a VM and I needed to do that [since the .vdi was filling my C: drive]

I located the .vdi file C:\Users\Bernie\VirtualBox VMs\... I disconnected the .vdi from my VM, then I moved the entire folder to the place where I had plenty of disk space. And then I went to register the now-moved .vdi file. And I get

Cannot register the hard disk 'G:\Virtualbox\VirtualBox VMs\Win 7\Win 7.vdi' {55206f52-47b0-4eaf-b695-e8b5ffdcc757} because a hard disk 'C:\Users\Bernie\VirtualBox VMs\Win 7\Win 7.vdi' with UUID {55206f52-47b0-4eaf-b695-e8b5ffdcc757} already exists.

What's bizarre is that the 'other' .vdi [in C:\users] does NOT exist: the entire directory was gone. Clearly *something* in VB is remembering both the existence of, and location of, the .vdi file, even when it doesn't exist anymore.

Can someone run me through the actual procedure for cleanly moving a .vdi file? THANKS!! /Bernie\
Last edited by socratis on 12. Jul 2017, 23:38, edited 1 time in total.
Reason: Marked as [Solved].
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Problems moving a .vdi file

Post by scottgus1 »

The correct way to move a guest is: Moving a VM. It does involve moving the entire guest folder to the new location, but does not involve removing the drive file from the guest. Things can get really complicated if you have snapshots and didn't follow the tutorial's steps exactly.

How did you disconnect the .vdi from your guest? Do you have snapshots?
BCosell
Posts: 73
Joined: 12. Jul 2017, 20:27

Re: Problems moving a .vdi file

Post by BCosell »

No snapshots. Just a plain VM. I disconnected the virtual drive by going into Settings>Storage, clicked on the .vdi entry and clicked on the 'disk-minus' icon at the bottom.

But it appears that I don't know what tre "VM folder" is. I have a directory "in \users\bernie\ for "VirtualBox VMs" . It has a single entry in it corresponding to my one VM.
I moved *that*entire*directory to the target place. I have now reread that topic for the fourth or fifth time and I'm still a little unclear.m But I think I see it now [maybe..:o)]

I can copy the entire VirtualBox VMs directory to the new place. Then I should *remove* the original VM [so I don't get a .vdi serial confilct] and then "add" a new VM from the new location.

Will this tell VB that the new home for VMs is the new place so if I create another it'll be in the new directory, or will it go back into the \users\bernie directory and I'd have to move it again.

Thanks.. I thought i could just move the disk file but didn't understand that the entire VM was a single unit to be moved. I'll give it a try and see if it works... [in particular, when I look at the newly-registered, moved-VM if it says that the .vdi file is right there rather than still in the \users\bernie directory...
BCosell
Posts: 73
Joined: 12. Jul 2017, 20:27

Re: Problems moving a .vdi file

Post by BCosell »

OK, all is well. Two things made it all happen: I did copy the entire VirtualBox VMs directory to my new drive. BUT: then I discovered in "preferences" that there's a setting for the default VM location. I pointed it at my new VMs directory. Then I selected my old VM and *deleted* it . Then I did an 'add' and it listed that same VM but now in my new directory, just as I wanted
I have the old VMs directory on C: but my "moved' VM is working fine. So all problems solved. THANKS for the help....
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: [Solved] Problems moving a .vdi file

Post by scottgus1 »

Good! Looks like you figured out the default location setting too. Hope everything continues to work well!

If you ever plan anything unusual in the future, don't hesitate to pass it by us here on the forum to see if there's an official tutorial for it.

BTW, "Moving a VM" can be interpreted as "Backing Up a VM", too. (Folder-copy of the guest folder and all therein, to a couple backup medias, then simple folder-copy back over the top of the active guest to restore if needed.)
Vicluy
Posts: 1
Joined: 21. Jul 2017, 04:48

Re: [Solved] Problems moving a .vdi file

Post by Vicluy »

Hello Everyone
I have a problem with moving VMs to another server on windows 2007. I do not know how to move them :cry:

anyone help me to solve this problem
Thank all
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: [Solved] Problems moving a .vdi file

Post by socratis »

@Vicluy
You have got to read the whole thread before posting. The 2nd post in this thread (the first from 'scottgus1') contains a link. Read it.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply