I am trying to list my virtual machines using php. When I am on the HOST I am able to run:
$ vmrun list
And I get back this:
Total running VMs: 1
/opt/vmware-servers/myvm/myvm.vmx
I have the following code which executes on the HOST:
<?php
$vmrun_result = shell_exec('vmrun list');
print $vmrun_result;
?>
The response I get back is:
Total running VMs: 0
Does anyone have any ideas what I need to do to get the correct response from within PHP? Could it be a permissions problem? Do I need to use sudo so that the apache user can run vmrun properly?
I would like to be able to get this command to run "vmrun suspend" on the guest, but until I get a proper response from vmrun list, I don't think it will work.
Thanks!
Sean
P.S.: My setup is this:
Fedora Core 2 (host)
Fedora Core 5 (guest)
Apache 2
PHP 4.3.10