[GH-ISSUE #2] Support advanced options #2

Open
opened 2026-02-25 21:32:22 +03:00 by kerem · 1 comment
Owner

Originally created by @clue on GitHub (Oct 16, 2014).
Original GitHub issue: https://github.com/clue/docker-phpvirtualbox/issues/2

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/

Originally created by @clue on GitHub (Oct 16, 2014). Original GitHub issue: https://github.com/clue/docker-phpvirtualbox/issues/2 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/
Author
Owner

@jwalton commented on GitHub (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.

<!-- gh-comment-id:123961156 --> @jwalton commented on GitHub (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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-phpvirtualbox#2
No description provided.