Quantcast
Channel: VMware Communities : Popular Discussions - VMware Server Archives
Viewing all articles
Browse latest Browse all 69891

vmrun list via PHP

$
0
0

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


Viewing all articles
Browse latest Browse all 69891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>