Page 1 of 1

VirtualBox SDK: openremotesession

Posted: 15. Jan 2011, 15:17
by p.brantner
Hi,
a few months ago I worked the first time with the vbox sdk and tried to start virtual machine in C#. I was suprised how easy it worked.
I used the following code to start the machine:

Code: Select all

VirtualBox.VirtualBox myVB = new VirtualBox.VirtualBox();
String myMachineID="";
VirtualBox.Session mySession = new VirtualBox.Session();
myVB = new VirtualBox.VirtualBox();
myMachineID = myVB.FindMachine("Win").Id;
IProgress myProgress = myVB.OpenRemoteSession(mySession, myMachineID, "gui", "");
myProgress.WaitForCompletion(-1);
mySession.Close();
It worked fine and the machine called "Win" started like I wanted.
Now, a few months later, I tried it again. Now there appears a big problem: the class VirtualBox.VirtualBox doesnt have a method called "OpenRemoteSession()". Also the class VirtualBox.Session doesnt have a method called "Close()".
In addition i found a VBS sample that starts a virtual machine called Win (I used that sample to translate the code to c# code) and there I get an error that says that the method "OpenRemoteSession" hasnt been found.

Can anyone help me and knows what to do? Please help me! I need that code for a software project!

Re: VirtualBox SDK: openremotesession

Posted: 17. Jan 2011, 10:50
by mlr
Hi,

They changed session object in V4
The openremotesession is now a LaunchVMProcess directly on the IMachine object and the Close is an UnlockMachine (this one is still on the ISession object).

All this (+ others) is documented in the behavior change of the V4 sdk.

Marc