Hi Nokolay,<div><br></div><div>First of all thanks for you dedication, I really appreciate.</div><div>Thanks also for reminding me the change of the API, I also remember that there should be an xpcom-like API for java in the next version.</div>

<div>I understood that openRemoteSession is used to start a vm and I used this call to open several vms.</div><div>The problem is how to access this session once it has been opened.</div><div>Up to know I passed the same session object to every open remote session call, which is apparently wrong.</div>

<div>I tried to reused this session object to command the snapshots, and it apparently failed. I understood that a session is</div><div>linked to one machine, so it makes sense that I cannot reuse them everywhere.</div><div>

<br></div><div>I saw in some threads in the mailing list that I could create one IWebsessionManager to start all the vms and then</div><div>create one IWesessionManager per machine started to create new session objects. Is it really the right thing to do, since the IVirtualbox is a singleton.</div>

<div><br></div><div>Regards,</div><div>Lucas Charles</div><div><br></div><div><br><div class="gmail_quote">On Mon, Oct 25, 2010 at 11:14 AM, Nikolay Igotti <span dir="ltr"><<a href="mailto:nikolay.igotti@oracle.com">nikolay.igotti@oracle.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">    Hi Lucas,<br>
<br>
<br>
First of all, please keep in mind that for next major release there will be significant rework of both session API and<br>
the way it's accessed from Java. Having said that, with 3.x  approach, which is, indeed not very straightforward,<br>
openRemoteSession() API is just a way start a new VM, so it's not possible to use one remote session to start several VMs -<br>
you have to openRemoteSession() for every VM you want to start.<br>
Please refer to SDK documentation, and vboxshell.py TUI example (while in Python, patterns of API usage is the same).<br>
<br>
<br>
Hope that will help,<br>
   Nikolay<br>
<br>
<br>
Lucas Charles wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
Hello everyone,<br>
<br>
I'm stuck with a problem related to the sdk for java-ws.<br>
I want to manage several machines on a given host from my java client.<br>
<br>
I need to start vms Take snapshots of the one I started at given intervals.<br>
After a new boot I need to restore the machines to their latest snapshot.<br>
Start them and redo snapshots.<br>
<br>
The problem I'm facing is how to open sessions.<br>
<br>
Yet I'm starting the vms by calling<br>
------<br>
<br>
IWebsessionManager mgr;<br>
<br>
IVirtualBox vbox<br>
<br>
mgr = new IWebsessionManager("<a href="http://localhost:18083" target="_blank">http://localhost:18083</a>");<br>
<br>
vbox = mgr.logon("", "");<br>
<br>
ISession session = mgr.getSessionObject(vbox);<br>
<br>
IProgress prog = vbox.openRemoteSession(session, machineToStart.getId(), "gui", "");<br>
<br>
prog.waitForCompletion(-1);<br>
<br>
-----<br>
<br>
Isn't it a problem to call openRemoteSession with the session I got from IWebSessionManager::getSessiontObject() ?<br>
Because I then use only one session to start several vms.<br>
<br>
My next question is when I want to take snapshots of every machines I have in charge.<br>
<br>
Which session object should I use to get the IConsole ?<br>
Can/Must I reuse the one I used upon calling openRemoteSession() ? Reusing seems to work, if I control only one machine but fails with more than one.<br>
<br>
Best Regard,<br>
Lucas Charles<br></div></div>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
vbox-dev mailing list<br>
<a href="mailto:vbox-dev@virtualbox.org" target="_blank">vbox-dev@virtualbox.org</a><br>
<a href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target="_blank">http://vbox.innotek.de/mailman/listinfo/vbox-dev</a><br>
  <br>
</blockquote>
<br>
</blockquote></div><br></div>