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