Closed hh closed 13 years ago
I just figured out that you need to do some setting changes with_open_session:
newhd=VirtualBox::HardDrive.new
newhd.location="newhd.vdi"
newhd.logical_size=10*1000000
controller_name='My IDE Controller'
vbox.with_open_session do |session|
machine = session.machine
machine.add_storage_controller controller_name, :ide
machine.attach_device(controller_name, 0, 0, :hard_disk, newhd.interface)
end
vbox.storage_controllers[0].controller_type = :ich6 #:piix4
vbox.save
I think we are very close to getting addStorageController working, so I wanted to open this issue which has stopped forward motion on passionengine/ii#2
When running:
We get an InvalidVMStateException.
Looking at the vboxshell.py source:
Looks like they are using the IMachine::addStorageController xpcom interface.
If you execute these commands, you can add and remove a simple ide controller. (Assuming you don't already have one present)
They don't seem to get the box into an invalid state, but I suspect they approach saving state a bit differently than we do.