mirror of
https://git.theinfopunk.com/punk/thewwwdotcom-blog.git
synced 2025-07-26 12:14:44 -04:00
20 lines
668 B
Markdown
20 lines
668 B
Markdown
|
---
|
||
|
title: "Stupid Script"
|
||
|
date: "2018-01-07"
|
||
|
categories:
|
||
|
- "linux"
|
||
|
---
|
||
|
|
||
|
I just cobbled this script together to make starting up VirtualBox VM's a little easier when remote.
|
||
|
|
||
|
for a in \`vboxmanage list vms | sed 's/^"\\(.\*\\)".\*/\\1/'\`; \\
|
||
|
do echo $a && vboxmanage showvminfo $a | grep -c "running (since" ;done
|
||
|
|
||
|
This will give you a list of all of your VMs. Followed by a 1 if it is powered on or a 0 if it isn't. If your VM name contains a space, this won't work. In that case, the following will give you just the list:
|
||
|
|
||
|
vboxmanage list vms
|
||
|
|
||
|
You can then run the following to get all of the information and grep out the "since"
|
||
|
|
||
|
vboxmanage showvminfo "My VM"
|