Windows Virtual PC and PowerShell

Windows Virtual PC and PowerShell

  • Comments 2

In the past I have lamented about how hard it is to use PowerShell to control Virtual Server.  Luckily it is much easier with Windows Virtual PC.  There is no need to load interop code – instead you can just point PowerShell at Virtual PC and go:

VPCPowerShell

All you need to get started is to connect to the Virtual PC COM object by using this command:

$vpc=new-object –com VirtualPC.Application

You can then examine properties and call methods on this COM object directly.  Very cool.

For those of you who want to know the gory details of why this is easy with Virtual PC and hard with Virtual Server: Virtual Server runs as network process by default, and then uses impersonation to run virtual machines under the current users context.  Using COM + PowerShell + impersonation is very problematic.  Virtual PC, on the other hand, just runs directly under your use context – and hence there is no need to do any impersonation and everything “just works”.  Also, the reason why Virtual Server needs to use this more complicated model is to support running virtual machines when no user is logged in to the physical computer.  Virtual PC does require a user to be logged into the physical computer in order to run a virtual machine.

Cheers,
Ben

Leave a Comment
  • Please add 5 and 5 and type the answer here:
  • Post
  • Is Virtual Server dead?, last release being 2005 R2 SP1 and with Hyper-V's arrival? Any new versions planned?

  • sevenflavor -

    We are not planning future updates to Virtual Server

    Cheers,

    Ben

Page 1 of 1 (2 items)