What is ruby-libvirt?

ruby-libvirt provides Ruby bindings for libvirt. With them you can use libvirt directly from your Ruby programs:

require 'libvirt'

conn = Libvirt::open("qemu:///system")
puts conn.capabilities

conn.create_domain_linux(File.read("domain.xml"))

dom = conn.lookup_domain_by_name("mydomain")
dom.suspend
dom.resume
puts dom.xml_desc
        

Please see the documentation page for more complete examples.

Developers

The sources are available from git. To clone, run

git clone git://libvirt.org/ruby-libvirt.git

Please use the libvirt mailing list for questions, comments and patches.