The machine is not mutable (state is PoweredOff) (0x80BB0002

Discussion about using the VirtualBox API, Tutorials, Samples.

The machine is not mutable (state is PoweredOff) (0x80BB0002

Postby mathieu1911 » 9. Apr 2013, 18:16

Hi, I'm trying to use the vbox php sdk, which is connecting to the vboxwebsrv.exe that is listening on the default port 18083. Connection is fine and I can get the list of machines, machines infos, etc. The problem is when I try to change a machine property (like change MemorySize, set VRDE to enabled, etc.) Each time I am trying to change a machine property, vboxwebsrv returns me a SOAP fault: VirtualBox error: The machine is not mutable (state is PoweredOff) (0x80BB0002))

The machine IS POWERED OFF, the vboxmanage and the vbox GUI can change the properties without any problem, but the vboxwebsrv can't.

This is the same problem as described here: mail-archive(dot)com/vbox-dev@virtualbox(dot)org/msg05543(dot)html

Here is my php code, which is based on the sample given on the php SDK:

Code: Select all   Expand viewCollapse view
$connection = new SoapClient("/path/to/vboxwebService.wsdl", array('location' => "public-dns-of-server:18083/"));
$websessionManager = new IWebsessionManager($connection);
$virtualbox = $websessionManager->logon("user","password");
$machines = $virtualbox->machines;
foreach ($machines as $machine){
    if ($machine->name == 'vm01'){
        $session = $websessionManager->getSessionObject($virtualbox->handle);
        $machine->lockMachine($session->handle, 'Shared');
        try{
            $machine->setMemorySize(2048);
        }
        catch (Exception $ex){
            echo $ex->getMessage();
        }
        $session->unlockMachine();
        $machine->releaseRemote();
        $session->releaseRemote();
    }
}
$websessionManager->logoff($virtualbox->handle);


I tried on vbox 4.2.10, 4.2.8, 4.2, 4.0, 3.2, windows server 2012 and windows server 2008 R2. The guy at mail-archive(dot)com/vbox-dev@virtualbox(dot)org/msg05543(dot)html tried on Linux host and it does the same thing..

Any ideas?

Thanks
mathieu1911
 
Posts: 5
Joined: 9. Apr 2013, 18:02

Re: The machine is not mutable (state is PoweredOff) (0x80BB

Postby mathieu1911 » 9. Apr 2013, 20:59

Problem solved:

you must take the mutable machine, make changes and then save the settings as mentioned in the SDK manual section 3.2
mathieu1911
 
Posts: 5
Joined: 9. Apr 2013, 18:02

Re: The machine is not mutable (state is PoweredOff) (0x80BB

Postby noteirak » 9. Apr 2013, 23:26

Moved to Virtualbox API category.
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7


Return to The VirtualBox API

Who is online

Users browsing this forum: No registered users and 1 guest