Skip to content

@geemus /fog_virtualbox.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
simple example of using virtualbox
require 'fog'
compute = Fog::Compute.new(:provider => 'VirtualBox')
server = compute.servers.create(:name => 'lucid', :os => 'Ubuntu')
medium = compute.mediums.create(:device_type => :hard_disk, :location => '/Users/geemus/geemus/virtualbox_poc/lucid.vmdk', :read_only => false)
storage_controller = server.storage_controllers.create(:bus => :sata, :name => 'sata')
storage_controller.attach(medium, 0)
network_adapter = server.network_adapters.first
network_adapter.mac_address = '080027D8E375'
network_adapter.save
nat_driver = network_adapter.nat_driver
nat_driver.redirects.create(:guest_port => 22, :host_port => 2222)
server.start
Formatador.display('Press return to shutdown/cleanup...')
STDIN.getc
server.destroy
medium.destroy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.