Rabu, 31 Desember 2014

PHPVirtualbox Trik

Logging in for the first time

When you navigate to phpVirtualBox, you may be presented with a Log in form.

The default credentials are username: admin password: admin
Once logged in, you should change the default password through File -> Change Password.

Using the change password form.

Configuring Users

You may configure users in the File -> Preferences -> Users section of phpVirtualBox.

This section allows you to add, edit, and remove users. Access levels and authentication is very basic at the moment.

Access Levels

phpVirtualBox essentially has two access levels. Admin users and non-admin users. Admin users have access to the Users section of phpVirtualBox and can add / edit / remove other users. They can also perform actions that change VM group memberships and manipulate VM groups (Rename / Group / Ungroup).

Password Recovery

You may reset the admin password by renaming the file recovery.php-disabled in phpVirtualBox's folder to recovery.php and navigating to it in your web browser. E.g. http://HOST-OR-IP/phpvirtualbox/recovery.php
This page will present you with a simple form. Click on the Recover button to reset the admin user's password back to the default of admin. If you have removed the admin account, it will be recreated.
Once this is done, rename recovery.php back to recovery.php-disabled. phpVirtualBox will refuse to run while recovery.php exists. You may then log in with the default credentials of admin / admin.

Disabling Authentication

If you want to disable authentication in phpVirtualBox, add the following line to config.php:
var $noAuth = true;
Once this is done, no username / password will be required to access phpVirtualBox. Additionally, sections of phpVirtualBox pertaining to authentication (Change Password, Users, etc.) will not be visible.

Multiple Server Considerations

If you have phpVirtualBox configured to communicate with multiple !VirtualBox installations, please see the authentication notes provided in the Multiple Server Configuration wiki.

Basic Multiple server configuration of phpVirtualBox

Starting with phpVirtualBox 4-0, phpVirtualBox can be configured to interact with multiple VirtualBox installations. Provided that each is running its own vboxwebsrv instance. To do this, edit config.php in phpVirtualBox's folder and locate the following code:
/*
var $servers = array(
    array(
        'name' => 'London',
        'username' => 'user',
        'password' => 'pass',
        'location' => 'http://192.168.1.1:18083/'
    ),
    array(
        'name' => 'New York',
        'username' => 'user2',
        'password' => 'pass2',
        'location' => 'http://192.168.1.2:18083/'
    ),
);
*/
Uncomment the code (remove the /* and */) and edit the server values. An example config may look like this:
var $servers = array(
    array(
        'name' => 'London',
        'username' => 'vbox',
        'password' => 'secret1',
        'location' => 'http://10.32.32.4:18083/'
    ),
    array(
        'name' => 'New York',
        'username' => 'vboxadmin',
        'password' => 'secret2',
        'location' => 'http://10.32.45.2:18083/'
    ),
);
Note that the server names may be anything you wish. These should be descriptive to you.
Once this is done, you may change servers by clicking on the server name in the top item of the virtual machine list. The resulting menu will allow you to specify which server phpVirtualBox will communicate with.

Multiple servers and Authentication

Basic user authentication was introduced in phpVirtualBox 4.0-4. phpVirtualBox stores its usernames and passwords in the VirtualBox server. This can only use ONE VirtualBox server for authentication. By default, it will use the first server in the $servers list. If you would like to change this, you can add an 'authMaster' property set to true to one of the servers. An example my look like:
var $servers = array(
    array(
        'name' => 'London',
        'username' => 'vbox',
        'password' => 'secret1',
        'location' => 'http://10.32.32.4:18083/'
    ),
    array(
        'name' => 'New York',
        'username' => 'vboxadmin',
        'password' => 'secret2',
        'location' => 'http://10.32.45.2:18083/',
                'authMaster' => true
    ),
);
One important implication of this is that phpVirtualBox will only be accessible if the authentication server is up - either the fist one in the list, or the one with the authMaster property. In a bind, you may turn off authentication by adding the following line to config.php:
var $noAuth = true;

Advanced Multiple Server Configuration

Any settings available in phpVirtualBox's config.php can be also be added to a server configuration. E.g.
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')

    ),
    array(
        'name' => 'New York',
        'username' => 'vboxadmin',
        'password' => 'secret2',
        'location' => 'http://10.32.45.2:18083/',
                'consoleHost' => '10.32.45.2',
                'browserRestrictFolders' => array('/home/vboxadmin','/var/isos')
    ),
);

Tidak ada komentar:

Posting Komentar