I am building a small website for the office that will essentially start and stop virtual machines on a Server. I am developing in C#/ASP.net using visual studio.
I have tried two methods of starting the virtual machine (Just a little background on my problem):
The first is Vestis.VMTasks library, the code looks as follows
using (VMWareVirtualHost virtualHost = new VMWareVirtualHost())
{
virtualHost.ConnectToVMWareWorkstation();
using (VMWareVirtualMachine virtualMachine = virtualHost.Open(@SVM_Path))
{
virtualMachine.PowerOn();
}
}
the other method is to use the vmrun installed with VMWare
System.Diagnostics.ProcessStartInfo procStartInfo = new System.Diagnostics.ProcessStartInfo();
procStartInfo.FileName = "vmrun.exe";
procStartInfo.Arguments = "start \"" + path + "\"";
procStartInfo.UseShellExecute = false;
procStartInfo.ErrorDialog = false;
procStartInfo.CreateNoWindow = true;
System.Diagnostics.Process.Start(procStartInfo);
When I run the web application using Visual Studio it works perfectly, but a soon as I try to run it using IIS7 nothing happens. I have searched for a solution and the most likely cause seems to be access rights.
I have tried to fix the problem by allocating access rights for IIS_IUSR to the VMWare folder. This did not help.
What do I need to do to allow IIS7 to issue commands to VMWare?