Start all VM’s from one line in LINUX

Having more than one VM in VirtualBox is quite common. I have multiple of them running my Mail Server and other services. During backup i simply pause them, do the backup and start them again. This is done by scripts called by a cron job. Now if I would add up more and more VM’s it would be tedious to keep track of all the vms. I came up with this command that would give you a list and start of all vms registered under the current user.

$ VBoxManage list vms | grep -o '".*"' | xargs VBoxManage startvm --type headless

By the way, you can also use it for stopping VM’s.

Comments