VMware Communities
Levest28
Contributor
Contributor

Issue with vmrun with php

Hello,

First off I'll just mention that I am using VMware Workstation 11 (licence provided by my college).

I'm trying to execute the "vmrun list" command from php to return onto my little status page, but it always returns "Total Running VMs: 0" even when there are 2 VM's running. Running the command directly via terminal (the host OS is Ubuntu 14.04 LTS) correctly displays that there are 2 virtual machines running.

I've tried multiple variations in attempts to get it to work, but have had no luck.

What I've tried running:

$vmStatus = shell_exec( 'vmrun list' );

$vmStatus = shell_exec( '/usr/bin/vmrun list' );

$vmStatus = shell_exec( 'sudo -u www-data /usr/bin/vmrun list' );

$vmStatus = shell_exec( '/usr/bin/vmrun -T ws list' );

The main thing is, it's not that it's returning an error, or not returning at all, but it's literally returning that there are 0 VM's running. If it makes any difference, I'll add that the VM's are started using the nogui argument, but i wouldn't expect that to matter as it still returns 2 VM's running from local terminal.

0 Kudos
0 Replies