VMware Communities
Veltguy
Contributor
Contributor

Starting Virtual Machine from Webinterface using IIS7

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?

    • I also used the command "vmrun -T ws list" to list the Virtual machines currently running. From Visual Studio it displays correctly but using IIS7 it always displays "Total running VMs: 0". It seems the command executes but it does not have the priveledges to retrieve the data.

Reply
0 Kudos
1 Reply
WoodyZ
Immortal
Immortal

This really isn't a VMware Workstation issue per se. In other words the issues you're facing are no different then if trying to run an .exe in the same manner on a physical machine. You might find an answer quicker looking at or asking questions in forums that are more centric to the programing language your using and IIS 7.

Reply
0 Kudos