phpvirtualbox ? [SOLVED]

This is for discussing general topics about how to use VirtualBox.
Post Reply
BeafZachland
Posts: 18
Joined: 29. May 2013, 05:17
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: ubuntu server12.04

phpvirtualbox ? [SOLVED]

Post by BeafZachland »

i kinda messed up creating my vm's. i was lazy and instead of using sudo i created them as root so it put the vm folder in my root directory. i assumed this is why i couldn't see the machines in the filesystem in phpvirtualbox. to correct this i moved the directory to my users home directory and used "chown -R username:vboxusers" to make me the owner and the group vboxusers. this still did not allow me to see the vm's. when i click on the folder in phpvirtualbox it shows the icon open but nothing gets listed same as when they were in the root folder before i moved them. the phpvirtualbox was set up to run under a different user than the owner but both are in the vbusers group. i also restarted apache2 and /etc/init.d/vboxweb-service after the changes. what am i doing wrong and how can i fix vm's so they are listed in phpvirtualbox?
also moving and changing the owner and group of the vm folder caused more damage because when i go to start them from the command line as before it now says "Invalid machine name or UUID!" . i moved them back and changed owner and group back to root:root and i can use them again from the commandline but am lost as to the best way to fix this and also get phpvirtualbox to see and manage them
Last edited by BeafZachland on 6. Jun 2013, 15:42, edited 1 time in total.
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: phpvirtualbox ?

Post by noteirak »

From your root session, unregister all your VMs (don't delete!), then register them again within phpVirtualBox using the "Add..."
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
BeafZachland
Posts: 18
Joined: 29. May 2013, 05:17
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: ubuntu server12.04

Re: phpvirtualbox ?

Post by BeafZachland »

ok, just so i'm clear. Once I unregister them from my root session can i then move the vm folder, and chown -R the user and group for the vm folder the same way i tried to in my original post? if the previous steps work the next step is to ADD the vm's via phpvirtualbox which will register them. will that give me the "invalid machine name or UUID!" error when starting via VBoxHeadless if i move, chown and register via phpvirtualbox?
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: phpvirtualbox ?

Post by noteirak »

Precise step order :
1. unregister the VM (remove without deleting data).
2. move the VM to the new location
3. chown the files to the user you want to run as
4. register (Add) the VM in phpVirtualbox
5. no more "cannot find machine" issue
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
BeafZachland
Posts: 18
Joined: 29. May 2013, 05:17
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: ubuntu server12.04

Re: phpvirtualbox ?

Post by BeafZachland »

thank you. i'll try it after class today and mark this solved if it works
BeafZachland
Posts: 18
Joined: 29. May 2013, 05:17
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: ubuntu server12.04

Re: phpvirtualbox ?

Post by BeafZachland »

ok it works except i get an error when i take a snapshot. i need this first snapshot so i have an un-altered copy to keep for the next batch of students so i don't have to clone all over again with each new class. i'll post the error message followed by the details. BTW deleting the snapshot gives me same error just different reference #.
ERROR:
VirtualBox error: Invalid managed object reference "65a3a511e155bf48-0000000000000a15"
DETAILS:

Code: Select all

SoapFault Object
(
    [message:protected] => VirtualBox error: Invalid managed object reference "65a3a511e155bf48-00000000000009d9"
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] => /var/www/phpvirtualbox/lib/vboxServiceWrappers.php
    [line:protected] => 9664
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /var/www/phpvirtualbox/lib/vboxServiceWrappers.php
                    [line] => 9664
                    [function] => __soapCall
                    [class] => SoapClient
                    [type] => ->
                    [args] => Array
                        (
                            [0] => ISnapshotEvent_getSnapshotId
                            [1] => Array
                                (
                                    [0] => Array
                                        (
                                            [_this] => 65a3a511e155bf48-00000000000009d9
                                        )

                                )

                        )

                )

            [1] => Array
                (
                    [file] => /var/www/phpvirtualbox/lib/vboxServiceWrappers.php
                    [line] => 54
                    [function] => getSnapshotId
                    [class] => ISnapshotEvent
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [2] => Array
                (
                    [file] => /var/www/phpvirtualbox/lib/vboxconnector.php
                    [line] => 785
                    [function] => __get
                    [class] => VBox_ManagedObject
                    [type] => ->
                    [args] => Array
                        (
                            [0] => snapshotId
                        )

                )

            [3] => Array
                (
                    [file] => /var/www/phpvirtualbox/lib/vboxconnector.php
                    [line] => 387
                    [function] => _getEventData
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => IEvent Object
                                (
                                    [connection:protected] => SoapClient Object
                                        (
                                            [location] => http://127.0.0.1:18083/
                                            [_features] => 5
                                            [_connection_timeout] => 20
                                            [_soap_version] => 1
                                            [sdl] => Resource id #10
                                            [httpurl] => Resource id #54
                                            [httpsocket] => Resource id #45
                                            [_use_proxy] => 0
                                        )

                                    [handle:protected] => 65a3a511e155bf48-00000000000009d9
                                )

                            [1] => vbox
                        )

                )

            [4] => Array
                (
                    [file] => /var/www/phpvirtualbox/lib/vboxconnector.php
                    [line] => 918
                    [function] => remote_getEvents
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [_persist] => Array
                                        (
                                            [vboxEventListeners] => Array
                                                (
                                                    [vbox] => Array
                                                        (
                                                            [listener] => 65a3a511e155bf48-0000000000000078
                                                            [source] => 65a3a511e155bf48-0000000000000077
                                                        )

                                                )

                                            [vboxHandle] => 65a3a511e155bf48-0000000000000076
                                        )

                                    [fn] => getEvents
                                )

                        )

                )

            [5] => Array
                (
                    [file] => /var/www/phpvirtualbox/lib/ajax.php
                    [line] => 306
                    [function] => __call
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => getEvents
                            [1] => Array
                                (
                                    [0] => Array
                                        (
                                            [_persist] => Array
                                                (
                                                    [vboxEventListeners] => Array
                                                        (
                                                            [vbox] => Array
                                                                (
                                                                    [listener] => 65a3a511e155bf48-0000000000000078
                                                                    [source] => 65a3a511e155bf48-0000000000000077
                                                                )

                                                        )

                                                    [vboxHandle] => 65a3a511e155bf48-0000000000000076
                                                )

                                            [fn] => getEvents
                                        )

                                    [1] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [data] => Array
                                                        (
                                                            [responseData] => Array
                                                                (
                                                                    [0] => Array
                                                                        (
                                                                            [eventType] => OnSessionStateChanged
                                                                            [sourceId] => vbox
                                                                            [dedupId] => vbox-OnSessionStateChanged-619785bb-3f57-4959-93f4-423e2282acf4
                                                                            [machineId] => 619785bb-3f57-4959-93f4-423e2282acf4
                                                                            [state] => Locked
                                                                        )

                                                                    [1] => Array
                                                                        (
                                                                            [eventType] => OnMachineDataChanged
                                                                            [sourceId] => vbox
                                                                            [dedupId] => vbox-OnMachineDataChanged-619785bb-3f57-4959-93f4-423e2282acf4
                                                                            [machineId] => 619785bb-3f57-4959-93f4-423e2282acf4
                                                                            [enrichmentData] => Array
                                                                                (
                                                                                    [id] => 619785bb-3f57-4959-93f4-423e2282acf4
                                                                                    [name] => student1
                                                                                    [OSTypeId] => Other
                                                                                    [owner] => 
                                                                                    [groups] => Array
                                                                                        (
                                                                                            [0] => /
                                                                                        )

                                                                                )

                                                                        )

                                                                    [2] => Array
                                                                        (
                                                                            [eventType] => OnMachineStateChanged
                                                                            [sourceId] => vbox
                                                                            [dedupId] => vbox-OnMachineStateChanged-619785bb-3f57-4959-93f4-423e2282acf4
                                                                            [machineId] => 619785bb-3f57-4959-93f4-423e2282acf4
                                                                            [state] => PoweredOff
                                                                            [enrichmentData] => Array
                                                                                (
                                                                                    [lastStateChange] => 1370523980.442
                                                                                    [currentStateModified] => 
                                                                                )

                                                                        )

                                                                )

                                                            [success] => 1
                                                            [key] => b4863d2664764dc00ff22c83b2d23842
                                                            [persist] => Array
                                                                (
                                                                    [vboxEventListeners] => Array
                                                                        (
                                                                            [vbox] => Array
                                                                                (
                                                                                    [listener] => 65a3a511e155bf48-0000000000000078
                                                                                    [source] => 65a3a511e155bf48-0000000000000077
                                                                                )

                                                                        )

                                                                    [vboxHandle] => 65a3a511e155bf48-0000000000000076
                                                                )

                                                        )

                                                    [errors] => Array
                                                        (
                                                        )

                                                    [persist] => Array
                                                        (
                                                        )

                                                    [messages] => Array
                                                        (
                                                        )

                                                )

                                        )

                                )

                        )

                )

            [6] => Array
                (
                    [file] => /var/www/phpvirtualbox/lib/ajax.php
                    [line] => 306
                    [function] => getEvents
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [_persist] => Array
                                        (
                                            [vboxEventListeners] => Array
                                                (
                                                    [vbox] => Array
                                                        (
                                                            [listener] => 65a3a511e155bf48-0000000000000078
                                                            [source] => 65a3a511e155bf48-0000000000000077
                                                        )

                                                )

                                            [vboxHandle] => 65a3a511e155bf48-0000000000000076
                                        )

                                    [fn] => getEvents
                                )

                            [1] => Array
                                (
                                    [0] => Array
                                        (
                                            [data] => Array
                                                (
                                                    [responseData] => Array
                                                        (
                                                            [0] => Array
                                                                (
                                                                    [eventType] => OnSessionStateChanged
                                                                    [sourceId] => vbox
                                                                    [dedupId] => vbox-OnSessionStateChanged-619785bb-3f57-4959-93f4-423e2282acf4
                                                                    [machineId] => 619785bb-3f57-4959-93f4-423e2282acf4
                                                                    [state] => Locked
                                                                )

                                                            [1] => Array
                                                                (
                                                                    [eventType] => OnMachineDataChanged
                                                                    [sourceId] => vbox
                                                                    [dedupId] => vbox-OnMachineDataChanged-619785bb-3f57-4959-93f4-423e2282acf4
                                                                    [machineId] => 619785bb-3f57-4959-93f4-423e2282acf4
                                                                    [enrichmentData] => Array
                                                                        (
                                                                            [id] => 619785bb-3f57-4959-93f4-423e2282acf4
                                                                            [name] => student1
                                                                            [OSTypeId] => Other
                                                                            [owner] => 
                                                                            [groups] => Array
                                                                                (
                                                                                    [0] => /
                                                                                )

                                                                        )

                                                                )

                                                            [2] => Array
                                                                (
                                                                    [eventType] => OnMachineStateChanged
                                                                    [sourceId] => vbox
                                                                    [dedupId] => vbox-OnMachineStateChanged-619785bb-3f57-4959-93f4-423e2282acf4
                                                                    [machineId] => 619785bb-3f57-4959-93f4-423e2282acf4
                                                                    [state] => PoweredOff
                                                                    [enrichmentData] => Array
                                                                        (
                                                                            [lastStateChange] => 1370523980.442
                                                                            [currentStateModified] => 
                                                                        )

                                                                )

                                                        )

                                                    [success] => 1
                                                    [key] => b4863d2664764dc00ff22c83b2d23842
                                                    [persist] => Array
                                                        (
                                                            [vboxEventListeners] => Array
                                                                (
                                                                    [vbox] => Array
                                                                        (
                                                                            [listener] => 65a3a511e155bf48-0000000000000078
                                                                            [source] => 65a3a511e155bf48-0000000000000077
                                                                        )

                                                                )

                                                            [vboxHandle] => 65a3a511e155bf48-0000000000000076
                                                        )

                                                )

                                            [errors] => Array
                                                (
                                                )

                                            [persist] => Array
                                                (
                                                )

                                            [messages] => Array
                                                (
                                                )

                                        )

                                )

                        )

                )

        )

    [previous:Exception:private] => 
    [faultstring] => VirtualBox error: Invalid managed object reference "65a3a511e155bf48-00000000000009d9"
    [faultcode] => SOAP-ENV:Client
    [detail] => stdClass Object
        (
            [InvalidObjectFault] => stdClass Object
                (
                    [badObjectID] => 65a3a511e155bf48-00000000000009d9
                )

        )

)
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: phpvirtualbox ?

Post by noteirak »

phpVirtualBox is not Virtualbox I am afraid, so any support question will need to be redirected to the phpVirtualBox website.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
BeafZachland
Posts: 18
Joined: 29. May 2013, 05:17
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: ubuntu server12.04

Re: phpvirtualbox ?

Post by BeafZachland »

i unserstand noteirak. you have really been invaluable in getting me to this point i appreciate it as well as the PM. i think it still works just gives error output. i read on code.google that there are 2 lines you can comment out as well instead of re-installing the new non zip version. i don't know if that has any negative effects that will arise down the road but i may just leave it for now. i'll mark this solved and thanks again.
Post Reply