Could it be Windows 7 + RunProgramInGuest?

Mar 1, 2010 at 12:41 PM

I'm trying to evaluate this library, and my scenario is:

Host: Windows 7, 64b

Guest: Windows Vista 32b

When I run this program the script stops when I try to run virtualMachine.RunProgramInGuest("notepad.exe", string.Empty);

What could it be?



           VMWareVirtualHost host = new VMWareVirtualHost();
            host.ConnectToVMWareVIServer("", "miguel.marques", "1234", 15);

            using (VMWareVirtualMachine virtualMachine = host.RegisteredVirtualMachines.First<VMWareVirtualMachine>())
                // power on this virtual machine
                // wait for VMWare Tools
                // login to the virtual machine
                virtualMachine.LoginInGuest("primavera", "1234");
                // run notepad
                virtualMachine.RunProgramInGuest("notepad.exe", string.Empty);
                // create a new snapshot
                string name = "New Snapshot";
                // take a snapshot at the current state
                virtualMachine.Snapshots.CreateSnapshot(name, "test snapshot");
                // power off
                // find the newly created snapshot
                using (VMWareSnapshot snapshot = virtualMachine.Snapshots.GetNamedSnapshot(name))
                    // revert to the new snapshot
                    // delete snapshot

Mar 1, 2010 at 1:17 PM

Does notepad start? I bet it just starts non-detached, try DetachProgramInGuest.

Mar 1, 2010 at 2:40 PM
Edited Mar 1, 2010 at 2:43 PM


Thanks for the quick reply.


The problem is that appeared a message from the "Interactive Services Detection" that is a service that is running on the Guest OS.  After I read some other post I changed this two lines and added the parameter to do logon interactively.


"primavera", "1234",8,20);

Console.WriteLine("Logon");// run notepad


"notepad.exe", string.Empty,2,50);


After a reset to the Guest OS the machine started to do logon and the notepad opens but stays opened and the code stops here. That can lead to your answer that I will try to do know.


p.s. When the service is stopped i get this message: "The specified guest user must be logged in interactively to perform this operation"