Created
June 28, 2011 10:35
-
-
Save yitsushi/1050877 to your computer and use it in GitHub Desktop.
Get VirtualBox info with ruby...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "virtualbox" | |
vms = VirtualBox::VM.all | |
vms.each do |vm| | |
puts <<EOI | |
#{vm.name} | |
#{"="*vm.name.length} | |
Memory: #{vm.memory_size} MB | |
CPU count: #{vm.cpu_count} | |
OS Type: #{vm.os_type_id} | |
Status: #{vm.state} | |
EOI | |
puts "" | |
end | |
=begin | |
OUTPUT: | |
Ubuntu Test Machine | |
=================== | |
Memory: 512 MB | |
CPU count: 1 | |
OS Type: Ubuntu | |
Status: running | |
=end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment