1
Vote

Running setup.exe (or any other program that requires Administrator privileges) results in error code 3304

description

Hi,
 
I am using your library on a Windows7 64 bit host operating system and 32 bit Windows guest (in VMWare Workstation 8.0.3). I can succesfully setup Office 2010 if I run the setup program through a batch file (Office2010AutoSetup.bat) that is accessible within the VM.
 
I can also run directly any other program, such as, my own C# program or notepad.exe but I cannot seem to (directly) run a program that requires administrative privileges. If I try, I am always receiving a VMWareException with error code 3304.
 
I even tried to setup the virtual machine such that Administrator privileges are elevated without prompting (via secpol.msc in guest). But my problem remains, I can either run setup indirectly or I cannot (getting error code 3304).
 
I was just wondering if you have an idea what I could try to trouble shoot this one or whether you know if there is a known restriction on running programs with administrative privileges.
 
What would be the best VMWare forum to repost this question if that is the more appropriate place?
 
Many thanks for library, it is indeed a much better API than what VMWare originally provided.

comments

dirkster wrote Jun 18, 2012 at 3:33 PM

Here is the code that I am using (the WaitNSeconds function is just a simple Timer Sleep function on the host):


string vmxPathFileName = "c:\MyVirtualMachine.vmx";

Console.WriteLn("Locating and connecting to virtual machine: {0} ...", vmxPathFileName);

VMWareVirtualHost virtualHost = new VMWareVirtualHost();
virtualHost.ConnectToVMWareWorkstation();
VMWareVirtualMachine virtualMachine = virtualHost.Open(vmxPathFileName);

Console.WriteLn("Power on virtual machine...");
virtualMachine.PowerOn();

virtualMachine.WaitForToolsInGuest();

// Interactive Login
this.WaitNSeconds(15);

Console.WriteLn("Attempting interactive virtual machine login...");
virtualMachine.LoginInGuest("AutoSetup", "MyAutoSetupPassword", VixCOM.Constants.VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT);
// Interactive Login

string sProgPathFileName = @"Z:\Install\Office2010Setup.bat"; Console.WriteLn(string.Format("Running '{0}' in guest...", sProgPathFileName));
virtualMachine.RunProgramInGuest(sProgPathFileName, string.Empty, 60 * 30); // Let's time-out setups that are longer than 30 minutes

this.WaitNSeconds(10);
Console.WriteLn(string.Format("Shut down virtual machine..."));

virtualMachine.ShutdownGuest();

if (virtualMachine.IsRunning)
{
Console.WriteLn("Powering off virtual machine since it is still running...");
virtualMachine.PowerOff();
}
else
Console.WriteLn(string.Format("Virtual machine powered off OK."));

dblock wrote Jun 18, 2012 at 4:02 PM

Please ask the new google discussions group. We've moved off CodePlex.
http://groups.google.com/group/vmwaretasks

wrote Feb 14, 2013 at 6:19 PM