Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support advanced options #2

Open
clue opened this issue Oct 16, 2014 · 1 comment
Open

Support advanced options #2

clue opened this issue Oct 16, 2014 · 1 comment

Comments

@clue
Copy link
Owner

clue commented Oct 16, 2014

For example:

var $servers = array(
    array(
        'name' => 'London',
        'username' => 'vbox',
        'password' => 'secret1',
        'location' => 'http://10.32.32.4:18083/',
                'consoleHost' => '10.32.32.4',
                'noPreview' => true,
                'browserRestrictFolders' => array('/home/vbox','/mnt/media')

    ),

http://sourceforge.net/p/phpvirtualbox/wiki/Multiple%20Server%20Configuration/

@jwalton
Copy link

jwalton commented Jul 23, 2015

I ran into this problem trying to connect from phpvirtualbox to vboxweb-service running on the docker host (since my vbox user and password were not the defaults.) Here's my (slightly hacky) fix, and my complete setup in case anyone else is interested in doing this:

Setup:

  • Start with Ubuntu v14.04.2

  • Create/edit /etc/default/docker:

    DOCKER_OPTS="--bip 172.17.42.1/24"
    

    This will set up the docker bridge to always be on 172.17.42.1, which means from inside a docker container we can connect to 172.17.42.1 to get to the docker host.

  • Install virtualbox via apt

  • Create a 'vbox' user and set a password. Create a home directory for vbox.

  • Create /etc/default/virtualbox

    VBOXWEB_USER=vbox
    VBOXWEB_HOST=172.17.42.1
    
  • sudo service vboxweb-service start to get vboxweb-service up and running.

  • Create /opt/phpvirtualbox/config-servers.php

    <?php return array (
      0 =>
      array (
        'name' => 'galactica',
        'username' => 'vbox',
        'password' => 'password_you_created_for_vbox_goes_here',
        'authMaster' => true,
        'location' => 'http://172.17.42.1:18083/',
        'consoleHost' => '172.17.42.1',
      ),
    );
    
  • Run clue/phpvirtualbox with:

    docker run -d --name phpvirtualbox --restart=always \
    -p 8080:80 \
    -v /opt/phpvirtualbox/config-servers.php:/var/www/config-servers.php:ro \
    -e LOCALHOST_PORT_18083_TCP=172.17.42.1:18083 \
    -e LOCALHOST_NAME=default \
    clue/phpvirtualbox
    

This mounts /opt/phpvirtualbox/config-servers.php into /var/www/config-servers.php, and mounts it read-only, which will make it effectively override the one generated by the docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants