[vbox-dev] VM state change

Achim Hasenmueller achim at sun.com
Fri Mar 5 05:37:19 PST 2010


If you want to do something on an already running VM, you have to do OpenExistingSession. Check the VBoxManage source code.

PowerShell integration is a good idea, best would be to auto-generate the integration based on our XIDL, the way we do it for all the other APIs.

Achim.

On Mar 5, 2010, at 11:19 , ravikanth at ravichaganti.com wrote:

> Hi,
> 
> I am new to VirtualBox and exploring the COM interfaces to see how I can
> manage vBox VM from PowerShell cmdline. So far, I am able to CreateVM,
> RegisterVM, UnregisterVM and List virtual machines. Also, I could open a
> remote session using OpenRemoteSession. However, I would like to be able
> to change the state of VM without opening a remote session. Using
> openRemoteSession brings up the console window and I do not want to do that.
> 
> Here is a set of commands I am currently running
> #Initialize COM
> $vBox = New-Object -ComObject VirtualBox.VirtualBox
> $vBoxSession = New-Object -ComObject VirtualBox.Session
> 
> #Get VM1 in to $vm
> $vm = $vBox.Machines[0]
> 
> #Open a remote session
> $vBox.OpenRemoteSession($vBoxSession,$vm.Id,"gui",$null)
> 
> I can use now use the "$vBoxSession.Console" (PowerDown, etc) to change
> the PowerState. Is there a way I can just Power on/off, Pause and resume a
> virtual machine in the remote session (GUI) without opening the console?
> 
> Thanks for your time,
> Ravi
> 
> PS: I am aware of vBoxManage.exe but my idea of creating a PowerShell
> library is to make it easy to manage VB guests over PowerShell remoting
> channel.
> 
> 
> _______________________________________________
> 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