starting a vm from a php webpage

Discussions related to using VirtualBox on Windows hosts.
Post Reply
jstillwell
Posts: 1
Joined: 28. Nov 2012, 06:27

starting a vm from a php webpage

Post by jstillwell »

I am trying to start a vm from a link on a php page on my server.
I am using jquery to start an AJAX call that triggers a php script to run exec(vboxmanage.exe startvm "vm name");

For some reason it doesnt work. I have tried using popen and other php functions to open it as well but it never starts. I get no errors in my php logs either.

I can run the cmd in the console and its fine. I have tried starting it as a batch file and as a shortcut set to run as admin.

Has anyone tried this before? got any tips or tricks?
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: starting a vm from a php webpage

Post by noteirak »

try exec("vboxmanage startvm \"vmname\" --type headless");
This will work if your host is Linux, else you will need to put the full path to vboxmanage for a windows host
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply