Can unregistervm remove ALL VM's?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
supercrazymark
Posts: 31
Joined: 14. May 2013, 11:42
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows 7 32bit
Location: Salisbury
Contact:

Can unregistervm remove ALL VM's?

Post by supercrazymark »

Hello,

Is it possible to run a command (unregistervm?) in a bat file that will remove ALL VM's from Vortualbox?

unregistervm needs the uuid or name of the VM but I may not know that at the time the bat file is run...

Would it be possible to write a script that loops through all registered VM's and unregister them?

I hope my question makes sense :)

Thank you,

Mark
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Can unregistervm remove ALL VM's?

Post by noteirak »

use vboxmanage list vms to get the list, then vboxmanage unregistervm $vmname in the loop.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
supercrazymark
Posts: 31
Joined: 14. May 2013, 11:42
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows 7 32bit
Location: Salisbury
Contact:

Re: Can unregistervm remove ALL VM's?

Post by supercrazymark »

Sorry to rekindle such an old post but I am now trying to do this.... please could you give an example of how I would use list vms and then loop through the results and unregister each vm?

I am using Windows and writing a bat file that starts the vm.

Thank you,

mark
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Can unregistervm remove ALL VM's?

Post by noteirak »

I'm afraid I don't have a practical example : I only work with Linux for Virtualbox host, so I could give you the Linux command if you so wish, but I'm very useless in Windows batch scripting
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Can unregistervm remove ALL VM's?

Post by scottgus1 »

supercrazymark
Posts: 31
Joined: 14. May 2013, 11:42
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows 7 32bit
Location: Salisbury
Contact:

Re: Can unregistervm remove ALL VM's?

Post by supercrazymark »

Thank you scottgus1 that link looks like it points me in exactly the right direction :D

If I do manage to create working scripts I will post them here....
Post Reply