[vbox-dev] Problem to attach DVD image by webservice

Ian Moore imooreyahoo at gmail.com
Tue Jan 18 17:22:18 GMT 2011


David,

In pseudo-code the entire process should go something like:

machine = IVirtualBox_findMachine(...)
medium = IVirtualBox_openMedium(...)
session = IWebsessionManager_getSessionObject()

machine->lockMachine(session,'Shared')

session->machine->mountMedium(..., ..., ..., medium)

/* If you wish to save this across reboots */
session->machine->saveSettings()

session->unlockMachine()

I can attest that this works fine via vboxwebsrv.

On Tue, Jan 18, 2011 at 10:49 AM, Klaus Espenlaub
<klaus.espenlaub at oracle.com> wrote:
> On 18.01.2011 00:22, DavidW wrote:
>>
>> I am runing 4.0.0 r69151. I have problem to attach dvd image to a
>> running vm by webservice.
>>
>> I did by the following steps
>>
>> 1, IVirtualBox_findMachine
>>
>> 2, IVirtualBox_openMedium
>>
>> 3, IVirtualBox_findMedium (tried with or without this step, same result)
>>
>> 4, IMachine_mountMedium
>>
>> It seems the medium is mounted, I can see the image under “IDE Primary
>> Master (CD/DVD):” on vbox gui, but
>>
>> The driver in the vm shows empty.
>>
>> Another issue is it seems the image is deleted when I delete the vm.
>
> The 4 steps can't be all what you're doing - you need to lock the machine to
> get an IMachine instance which can be modified.
>
> How do you trigger VM deletion? The GUI definitely deletes only hard disk
> images (if you select the appropriate button in the dialog), and the same
> applies to VBoxManage. Sure that you didn't just register something
> accidentally as a hard disk instead of a DVD image?
>
> The SDK has sample code, and as VirtualBox as a whole is open source it also
> counts as a BIG sample.
>
> Klaus
>
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev
>




More information about the vbox-dev mailing list