[vbox-dev] Session problem when start two virtual machines together

DavidW wyx1999 at hotmail.com
Tue Sep 14 17:44:06 GMT 2010


Sounds good, maybe the email should set to make "reply all" work for this
way.

-----Original Message-----
From: Klaus Espenlaub [mailto:klaus.espenlaub at oracle.com] 
Sent: Tuesday, September 14, 2010 2:33 AM
To: DavidW
Subject: Re: [vbox-dev] Session problem when start two virtual machines
together

Please stay on the mailing list for such issues. I'm ignoring personal 
mails which would help others if they'd be discussed in public.

Klaus

On 13.09.2010 20:16, DavidW wrote:
> Does that mean ISession_close is not much useful, you could close session
> when there is activity in the session, and when you open the session
again,
> you still have what you had before you close the session, in this case the
> openremotesession progress.
>
> I thought IWebsessionManager is like a login. So it doesn't work like a OS
> login, where you can login once and do things on all objects and then
close
> it.
>
> Is the right way that I should have one IWebsessionManager for each VM,
for
> all its cycle, from create to destroy. If I get a new IWebsessionManager
and
> get the session object in it to manipulate a VM, I could have same
problem,
> right? In this case, I could have one IWebsessionManager and
> openremotesession on the VM, then I close the session even the progress is
> not done, then after 1 second for example, If I open another
> IWebsessionManager and try to access the VM, I could have conflict
problem?
>
> Should I create IWebsessionManager for each VM and store the Session
> somewhere and use it until the VM is destroyed?
>
> -----Original Message-----
> From: Klaus Espenlaub [mailto:klaus.espenlaub at oracle.com]
> Sent: Monday, September 13, 2010 4:50 AM
> To: DavidW
> Subject: Re: [vbox-dev] Session problem when start two virtual machines
> together
>
> On 13.09.2010 02:05, DavidW wrote:
>> To start two virtual machines which are in "savedstate", I want to use
>> webservice to start them together, not one after another. Since
>> openRemoteSession returns immediately with a iprogress object, I think I
>> just need call openRemoteSession on both virtual machines and then wait
>> for them. But I got "The given session is already open or being opened"
>> when I trid to openRemoteSession on the second VM. See below, any idea
>> why it gave that error? Is it reasonable the session id in step 1 and
>> step 4 are the same? What should I do to make it work? Thanks.
>
> Your code needs 2 sessions, however you use one session for two jobs.
>
> Each IWebsessionManager instance holds exactly one session object, and
> thus two calls to getSessionObject will return the same object id.
>
> So you need to logon twice to have two sessions in parallel, use the
> appropriate IWebsessionManager instance for each job and so on.
>
> The behavior you observe is exactly as expected.
>
> Klaus
>
>> 1,IWebsessionManager_getSessionObject - return session id -
>> 452ad4c9d2537d44-0000000000046209
>>
>> 2,IVirtualBox_openRemoteSession - on vm 1
>>
>> n Keep the returned iprogress
>>
>> 3,ISession_close
>>
>> 4,IWebsessionManager_getSessionObject - return session id -
>> 452ad4c9d2537d44-0000000000046209
>>
>> 5,IVirtualBox_openRemoteSession - on vm 2 - got"The given session is
>> already open or being opened"
>>
>> n Keep the returned iprogress
>>
>> 6,ISession_close
>>
>> 7,waitForCompletion on iprogress 1
>>
>> 8,waitForCompletion on iprogress 2
>>
>>
>>
>> _______________________________________________
>> vbox-dev mailing list
>> vbox-dev at virtualbox.org
>> http://vbox.innotek.de/mailman/listinfo/vbox-dev





More information about the vbox-dev mailing list