VirtualBox SDK: openremotesession

This is for discussing general topics about how to use VirtualBox.
Post Reply
p.brantner
Posts: 6
Joined: 4. Oct 2010, 11:54
Primary OS: MS Windows XP
VBox Version: OSE Debian
Guest OSses: Linux

VirtualBox SDK: openremotesession

Post 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!
mlr
Posts: 4
Joined: 5. Jan 2011, 13:13
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP

Re: VirtualBox SDK: openremotesession

Post 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
Post Reply