|
Please forgive me if this is a trivial/answered/misplaced question,
if this is the case please guide me to the correct location... I started to use the virtual box API ( web service ) with java. After starting/stopping guests, I tried to add a network adapter to an exsiting guest and I fail... the code to enable the adapter: INetworkAdapter net = machine.getNetworkAdapter(1l); // the machine has adapter on 0l net.setEnabled(true); when I run this code I get the following exception: Exception in thread "main" org.virtualbox_4_2.VBoxException: VirtualBox error: The machine is not mutable (state is PoweredOff) (0x80BB0002) at org.virtualbox_4_2.INetworkAdapter.setEnabled(INetworkAdapter.java:139) at vboxWebSrvAPITester.main(vboxWebSrvAPITester.java:32) the output from the webservice : 00:00:00.000143 main Log opened 2013-01-06T12:13:37.460491000Z 00:00:00.000148 main OS Product: Linux 00:00:00.000148 main OS Release: 3.4.11-2.16-desktop 00:00:00.000149 main OS Version: #1 SMP PREEMPT Wed Sep 26 17:05:00 UTC 2012 (259fc87) 00:00:00.000168 main DMI Product Name: 4178A56 00:00:00.000174 main DMI Product Version: ThinkPad T420 00:00:00.000178 main Host RAM: 7883MB total, 3921MB available 00:00:00.000181 main Executable: /usr/lib/virtualbox/vboxwebsrv 00:00:00.000182 main Process ID: 14672 00:00:00.000182 main Package type: LINUX_64BITS_OPENSUSE_11_4 00:00:00.006371 SQPmp Socket connection successful: host = default (localhost), port = 18083, master socket = 8 01:35:37.332839 SQPmp Request 2 on socket 10 queued for processing (1 items on Q) 01:35:37.332871 SQW01 Processing connection from IP=127.0.0.1 socket=10 (0 out of 1 threads idle) 01:35:40.299766 SQW01 API return code: 0x80BB0002 (VBOX_E_INVALID_VM_STATE) 01:35:40.299778 SQW01 COM error info result code: 0x80BB0002 01:35:40.299782 SQW01 COM error info text: The machine is not mutable (state is PoweredOff) my host is opensuse 12.1 ( details above ) the guest is an opensuse guest with one network adapter ( enabled, NAT, 82540EM, connected ) and as stated it is powered off.. I use vboxjws.jar, v4.2.2 (in my system since October 18 ) When trying to enable a new adapter from the GUI, it works. Is there a proper way to define a new network connection using the API? If needed I can provide other debug information... Thanks, Gal. |
_______________________________________________ vbox-dev mailing list [email protected] https://www.virtualbox.org/mailman/listinfo/vbox-dev
