Working via admin privileges

This is for discussing general topics about how to use VirtualBox.
Post Reply
mcgregor
Posts: 2
Joined: 25. Mar 2017, 23:15

Working via admin privileges

Post by mcgregor »

Hi. I trying to work with the VBoxManage.exe from php execution (like exec). Since my apache (xampp) working as service it starting vboxmanage.exe with admin privileges. So, it can found no one machine:
VBOX_E_OBJECT_NOT_FOUND (0x80bb0001). I have googled that vbox looses path to VirtualBox.xml because it have config for nothing but default user. How I can fix it on my 4.3.4? Maybe I can set a global var or send as cmd argument to vboxmanage.exe? Thx.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Working via admin privileges

Post by noteirak »

Moving to "Using VirtualBox"
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Working via admin privileges

Post by noteirak »

VirtualBox config, and therefore list of registered machines, is saved on a per-user basis.
If you registered your VMs with another user, it's normal you won't see them, and you'll need to register them under the user actually using vboxmanage.

Section 10.1 of the User manual gives a detailed explanation of files location and the environment variables to change those.
Beware: it is usually a bad idea to use another user config, especially when running as admin or equivalent, as this will most likely cause permissions issues later on.

I would strongly recommend doing this the right way:
  • Do not use an administrator account. This can solve itself easily with the following point
  • Calling vboxmanage from PHP is also the wrong approach usually since you can use the PHP Bindings of the Java API. phpVirtualBox is a well-known community project which leverage that API.
  • Use VirtualBox 5.1 or 5.0 - 4.x are no longer supported, which means no help from here either.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
mcgregor
Posts: 2
Joined: 25. Mar 2017, 23:15

Re: Working via admin privileges

Post by mcgregor »

noteirak wrote:[*]Use VirtualBox 5.1 or 5.0 - 4.x are no longer supported, which means no help from here either.[/list]
I'd glad to use it, but VBox 5.x sometimes corrupting my screenshots and I can't return it back then.

Now I fixed the problem by changing account for launching my apache service.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Working via admin privileges

Post by noteirak »

noteirak wrote:Section 10.1 of the User manual gives a detailed explanation of files location and the environment variables to change those.
Thx. Now I can change the "VirtualBox VMs" directory but how do it with VirtualBox.xml? I wanna do common VBox folders for all users.
I never talked about the VM directory, and that value is stored within VirtualBox.xml
Read the full section as it tells how which environment variables to use to change the location of user config (including VirtualBox.xml).
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply