From: bzamfir on
Hi,

I'm using Windows Virtual PC on Win7, and I need to start a virtual
machine at pc startup, before any other user is logging. I would like
to start also the VM headless.

I found a reference to start the VPC headless here

http://blogs.technet.com/windows_vpc/archive/2009/11/09/auto-start-and-close-options-for-windows-virtual-pc.aspx

But it doesn't works, when I try to run the script I get error that
VirtualPC.Application class cannot be found

Also, how can I make the VM start before users login?

Thank you
From: David Wilkinson on
bzamfir(a)gmail.com wrote:
> Hi,
>
> I'm using Windows Virtual PC on Win7, and I need to start a virtual
> machine at pc startup, before any other user is logging. I would like
> to start also the VM headless.
>
> I found a reference to start the VPC headless here
>
> http://blogs.technet.com/windows_vpc/archive/2009/11/09/auto-start-and-close-options-for-windows-virtual-pc.aspx
>
> But it doesn't works, when I try to run the script I get error that
> VirtualPC.Application class cannot be found
>
> Also, how can I make the VM start before users login?

This blog article is about Windows Virtual PC, not Virtual PC 2007.

If your machine has hardware virtualization, you should be using Windows Virtual
PC on Windows 7. Virtual PC 2007 is not supported (though it seems to work fine).

On earlier host client OS's (XP, Vista), you could have used Virtual Server
2005, but it will not install on Windows 7 (at least not without a lot of effort).

VMWare Server is free, and will run on Windows 7.

--
David Wilkinson
Visual C++ MVP
From: bzamfir on
Hi,

Thanks, but I already mentioned I'm using Windows Virtual PC
The issue is, I upgraded the host pc from XP to Win7, and I have a VM
which I run previously under VServer2005R2, under XP which I need to
run now under Win7 unattended.
VMWare server unfortunately does not recognize VHD from VPC / VServer,
and I don't want to reinstall the VM (it is complex, properly setup)
I was installed even VServer 2005 on Win7 with some hacks. The issue
is it seems to have some problems, precisely, it from time to time
simple "loose" the virtual network, so my VM cannot get network
connectivity, which is what I need.

I saw the VM works very well under Windows VPC, so I was trying to use
it.

Lately I was trying to create a native windows service in C#, which
will start my VM when service starts, and save its state when service
close.
For tests, I create also a small winforms app which does exactly what
service does (for testing purpose). It works (I can start the VM
headless, stop it, query its status.
But when I install the service and try to start it, it does not start
the VM.
I log the errors and this is what I get:

Source: DistributedCOM
The application-specific permission settings do not grant Local
Activation permission for the COM Server application with CLSID
{9A1774B7-8251-4468-A214-61DCAED9AC2F}
and APPID
{F375390D-5D01-4106-AE15-674BE971C676}
to the user MyPC\MyUser SID (.....) from address LocalHost (Using
LRPC). This security permission can be modified using the Component
Services administrative tool.

Then
Source: My service

Error when trying to start virtual machine ZBC Server

System.TypeInitializationException: The type initializer for
'VPCLib.VPCHelper' threw an exception. --->
System.UnauthorizedAccessException: Retrieving the COM class factory
for component with CLSID {9A1774B7-8251-4468-A214-61DCAED9AC2F} failed
due to the following error: 80070005.
at VPCLib.VPCHelper..cctor()
--- End of inner exception stack trace ---
at VPCLib.VPCHelper.GetState(String machineName)
at VPCService.VPCService.OnStart(String[] args)

I was trying to look into Component Services administrative tool,
thinking I could change some settings there to allow Local
Activation, but for Virtual PC, all settings in properties page are
disabled.

Any thought? Should I post this to another group? Which group?

Thanks
From: David Wilkinson on
bzamfir(a)gmail.com wrote:
> Hi,
>
> Thanks, but I already mentioned I'm using Windows Virtual PC

I'm sorry. I misread your post. (I don't know why, because it was clear enough.)
Maybe I saw the 7 in Win7 and thought 2007.

I can't help you with Windows Virtual PC, because my machine does not have
hardware virtualization.

--
David Wilkinson
Visual C++ MVP
From: Steve Jain [MVP] on
On Tue, 16 Feb 2010 12:20:21 -0800 (PST), "bzamfir(a)gmail.com"
<bzamfir(a)gmail.com> wrote:

>Hi,
>
>Thanks, but I already mentioned I'm using Windows Virtual PC
>The issue is, I upgraded the host pc from XP to Win7, and I have a VM
>which I run previously under VServer2005R2, under XP which I need to
>run now under Win7 unattended.
>VMWare server unfortunately does not recognize VHD from VPC / VServer,
>and I don't want to reinstall the VM (it is complex, properly setup)
>I was installed even VServer 2005 on Win7 with some hacks. The issue
>is it seems to have some problems, precisely, it from time to time
>simple "loose" the virtual network, so my VM cannot get network
>connectivity, which is what I need.
>
>I saw the VM works very well under Windows VPC, so I was trying to use
>it.
>
>Lately I was trying to create a native windows service in C#, which
>will start my VM when service starts, and save its state when service
>close.
>For tests, I create also a small winforms app which does exactly what
>service does (for testing purpose). It works (I can start the VM
>headless, stop it, query its status.
>But when I install the service and try to start it, it does not start
>the VM.
>I log the errors and this is what I get:
>
>Source: DistributedCOM
>The application-specific permission settings do not grant Local
>Activation permission for the COM Server application with CLSID
>{9A1774B7-8251-4468-A214-61DCAED9AC2F}
> and APPID
>{F375390D-5D01-4106-AE15-674BE971C676}
> to the user MyPC\MyUser SID (.....) from address LocalHost (Using
>LRPC). This security permission can be modified using the Component
>Services administrative tool.
>
>Then
>Source: My service
>
>Error when trying to start virtual machine ZBC Server
>
>System.TypeInitializationException: The type initializer for
>'VPCLib.VPCHelper' threw an exception. --->
>System.UnauthorizedAccessException: Retrieving the COM class factory
>for component with CLSID {9A1774B7-8251-4468-A214-61DCAED9AC2F} failed
>due to the following error: 80070005.
> at VPCLib.VPCHelper..cctor()
> --- End of inner exception stack trace ---
> at VPCLib.VPCHelper.GetState(String machineName)
> at VPCService.VPCService.OnStart(String[] args)
>
>I was trying to look into Component Services administrative tool,
>thinking I could change some settings there to allow Local
>Activation, but for Virtual PC, all settings in properties page are
>disabled.
>
>Any thought? Should I post this to another group? Which group?
>
>Thanks

Check out this forum for win7 virtualization:
http://social.technet.microsoft.com/Forums/en-US/w7itprovirt/threads

there are a couple threads on running WinVPC headless and the issues
you have.

I do not think you will be able to get a VM to start before a user
logs in, the app is not written to work like that.

--
Cheers,
Steve Jain, Virtual Machine MVP
http://vpc.essjae.com/
http://smudj.wordpress.com/