How to run command line moving VMs between groups?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

How to run command line moving VMs between groups?

Post by satimis »

Hi all,

1.9. Using VM Groups
https://www.virtualbox.org/manual/UserM ... i-vmgroups

explaining to use command line creating new group.

I expect to learn how to move VMs between groups with command lines?

Please refers to attached photo

There are 3 groups on the VM Manager. I have no idea how they were created? They were created accidentally when I used drag-n-drop moving VMs inside the group. Before I had only one group.

Now;
New group 2

Code: Select all

phgallery5
phgallery5a
wordpresspc1a00
New group 3

Code: Select all

ub2004pciessd-01
I suppose the rest VMs being in New group 1

Code: Select all

quantum01
quantum02
.....
Please advise how to run command line;

1)
Move ub2004pciessd-01 from "New group 3 to "New group 2" and delete "New Group 3" afterwards?

2)
Move VMs from "New group 1" to "New group 2"

Thanks in advance

Regards
Attachments
screenshot_VM_manager.png
screenshot_VM_manager.png (124.35 KiB) Viewed 1199 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to run command line moving VMs between groups?

Post by scottgus1 »

Your previous list on the subject viewtopic.php?f=7&t=98673&p=478431#p478431 says you were drag-n-dropping the guests, accidentally or intentionally. That is one way the groups can be created, by dragging one guest on top of another.

Your link to the manual gives the commands you want. Did you try them?
the Manual wrote:Detach a VM from the group, and delete the group if empty. For example:

VBoxManage modifyvm "vm01" --groups ""
This will move guest 'phgallery5' out of 'New Group 2' and into the main list with the 'Quantum' guests:
VBoxManage modifyvm "phgallery5" --groups ""
This will move guest 'phgallery5' into 'New Group 3'
VBoxManage modifyvm "phgallery5" --groups "/New Group 3"
'phgallery5' needs to be shut down for these moves.
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: How to run command line moving VMs between groups?

Post by satimis »

Thanks for your advice.
scottgus1 wrote: - snip -
This will move guest 'phgallery5' into 'New Group 3'
VBoxManage modifyvm "phgallery5" --groups "/New Group 3"
'phgallery5' needs to be shut down for these moves.
It is very strange. Running this command another "new group 3" will be created instead of moving 'phgallery5' to the existing "new group 3" ?

Besides after running "VBoxManage modifyvm ....." I need to retart "VM Manager" to take effect.

Regards
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to run command line moving VMs between groups?

Post by scottgus1 »

I haven't played around with creating groups via command-line, so I don't know if the main Virtualbox window needs re-opening or not. I usually just drag-n-drop them, a la viewtopic.php?f=7&t=98673&p=478456#p478456

I made a mistake in my suggested command line, it should have been:
VBoxManage modifyvm "phgallery5" --groups "/New group 3"
per your screenshot. Vboxmanage commands are case-sensitive, and 'New Group 3' != 'New group 3'.
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: How to run command line moving VMs between groups?

Post by satimis »

scottgus1 wrote:I haven't played around with creating groups via command-line, so I don't know if the main Virtualbox window needs re-opening or not. I usually just drag-n-drop them, a la viewtopic.php?f=7&t=98673&p=478456#p478456

I made a mistake in my suggested command line, it should have been:
VBoxManage modifyvm "phgallery5" --groups "/New group 3"
per your screenshot. Vboxmanage commands are case-sensitive, and 'New Group 3' != 'New group 3'.
Thanks for your advice.

You're right. It is case sensitive. Also it needs restarting VM Manage to take effect.

I have 5 groups created on VM Manager with totally about 50 VMs running. My 1TB PCIe SSD is having sufficient storage space for them. In case running short of storage space, I'll move some of them to the WD 4TB HD which is solely for storage.

Before, I ran Graphic-Interface operation "drag-n-drop" moving VMs around and creating groups as well. For unknown reasons it created 3 groups therefore I resume the idea of running command line doing the job.

I love running command lines operation on Terminal. The operation is exact without problem.

Do you have idea running command line;
1) Move VMs around in the same group?
2) Move VM to the storage WD 4TB HD ?

Thanks

Regards
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to run command line moving VMs between groups?

Post by scottgus1 »

Try searching in the PDF version of the manual: https://download.virtualbox.org/virtual ... Manual.pdf
Post Reply