Thanks. I first wondered what I did wrong since I did the same as you listed, it turned out it did work but I didn't find out due to something else.
It seems without locking, I can still do mountMedium, and that caused vbox unstable. But with locking, it works fine. Thanks. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Ian Moore Sent: Tuesday, January 18, 2011 9:22 AM To: [email protected] Subject: Re: [vbox-dev] Problem to attach DVD image by webservice 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 <[email protected]> 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 > [email protected] > http://vbox.innotek.de/mailman/listinfo/vbox-dev > _______________________________________________ vbox-dev mailing list [email protected] http://vbox.innotek.de/mailman/listinfo/vbox-dev _______________________________________________ vbox-dev mailing list [email protected] http://vbox.innotek.de/mailman/listinfo/vbox-dev
