Removing a VM does not delete it's folder.

Discussions related to using VirtualBox on Mac OS X hosts.
Locked
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Removing a VM does not delete it's folder.

Post by loukingjr »

Never noticed this before but whenever one deletes a VM along with its files, VirtualBox does not delete the machine's folder. I wouldn't have noticed except I tried to create a machine with the same name as a previous deleted one.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Removing a VM does not delete it's folder.

Post by noteirak »

It actually give you the choice on what to do : keep or delete the VM files.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Removing a VM does not delete it's folder.

Post by loukingjr »

noteirak wrote:It actually give you the choice on what to do : keep or delete the VM files.
not what I meant. if you delete the VM files it empties the folder but leaves the folder itself. which means if you don't go in and delete the now empty folder you can't create a new machine with the same name.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Removing a VM does not delete it's folder.

Post by noteirak »

There was such an issue with older versions of Virtualbox in the 4.1.x & 4.2.x branch if I remember correctly.
Do you have the latest version of Virtualbox? If not you should update it.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Removing a VM does not delete it's folder.

Post by loukingjr »

noteirak wrote:There was such an issue with older versions of Virtualbox in the 4.1.x & 4.2.x branch if I remember correctly.
Do you have the latest version of Virtualbox? If not you should update it.
I'm using 4.2.12 but the VMs were most likely created in an earlier version although I'm not sure how early. maybe as far back as 4.1* not sure. I also don't create the VM's in the default location. I have it set to a folder in my Mac applications folder.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Removing a VM does not delete it's folder.

Post by noteirak »

What happens if you set the default folder somewhere else (where you know you or any account has full access) and try to create than delete a VM, does it still happen?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Removing a VM does not delete it's folder.

Post by loukingjr »

noteirak wrote:What happens if you set the default folder somewhere else (where you know you or any account has full access) and try to create than delete a VM, does it still happen?
give me a sec :)
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Removing a VM does not delete it's folder.

Post by loukingjr »

I created a VM in the same folder I had already set up and deleted all files. this time the folder was erased as well. Not sure why creating a VM in an older version caused the folder to not be deleted but there you have it. I suspect if I delete any older VMs I will run into the same issue but it's easy enough to delete a folder.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Removing a VM does not delete it's folder.

Post by noteirak »

Most likely a permission issue and/or related to the bug I was talking about.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: just about all that run

Re: Removing a VM does not delete it's folder.

Post by loukingjr »

noteirak wrote:Most likely a permission issue and/or related to the bug I was talking about.
well must be the bug because the permissions are all "read/write". I suppose it's still a bug because 4.1.12 won't delete the folders created in earlier versions.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Removing a VM does not delete it's folder.

Post by mpack »

Hmm. Nice example of debugging in this thread. Impressive.
kitzun387
Posts: 1
Joined: 24. Sep 2021, 00:54

Re: Removing a VM does not delete it's folder.

Post by kitzun387 »

loukingjr wrote:Never noticed this before but whenever one deletes a VM along with its files, VirtualBox does not delete the machine's folder. I wouldn't have noticed except I tried to create a machine with the same name as a previous deleted one.
If working on a Mac, the best way to solve this is:
- go to the apple icon
- select the "about this mac option"
- select "storage" then "manage"
- find the file called "VirtualBox VMs" and delete the files from there.

It's a lot more straightforward on PC and I just thought I would shed some insights from a Mac perspective since this personally drove me mad for a bit lol
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Removing a VM does not delete it's folder.

Post by scottgus1 »

Thanks for the thoughts, kitzun387! Virtualbox does keep track of the VMs it has loaded, so the VM should be deleted from Virtualbox first before checking that the VM folder still existed.
Locked