dgzyk / phpvirtualbox

Automatically exported from code.google.com/p/phpvirtualbox
Other
0 stars 0 forks source link

Installing on Ubuntu 10 LAMP #525

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm pulling my hair out just trying to get a bare bones install of vbox up and 
running. I have a fresh install of Ubuntu 10.04 server LTS x32 on kern 
2.6.32-40-generic-pae and fully updated.
I've freshly installed virtualbox via the website by .deb file (4.1.12r77245) 
and also installed phpvirtualbox (not sure how to check version - latest 
available from apt repositories). and Everything seems to be setup correctly. I 
can grep ps to see vbox running and listening, but when I go to the web address 
of the server I cannot log into the admin panel. 

I got the login at first, but no matter what I entered (admin/admin, or the 
vbox user I setup during install) i got an error that the vboxwebsrv was 
unreachable. So I turned off auth in the config.php to troubleshoot and I still 
get the error:

(browsing to 192.168.0_/)

[First Box]
An error occurred communicating with your vboxwebsrv. No more requests will be 
sent by phpVirtualBox until the error is corrected and this page is refreshed. 
The details of this connection error should be displayed in a subsequent dialog 
box.

[Second Box]
Exception Object
(
[message:protected] => Error logging in to vboxwebsrv.
[string:Exception:private] => 
[code:protected] => 64
[file:protected] => /var/www/lib/vboxconnector.php
[line:protected] => 188
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => /var/www/lib/vboxconnector.php
[line] => 210
[function] => connect
[class] => vboxconnector
[type] => ->
[args] => Array
(
)

)

[1] => Array
(
[file] => /var/www/lib/ajax.php
[line] => 93
[function] => getVersion
[class] => vboxconnector
[type] => ->
[args] => Array
(
)

)

)

[previous:Exception:private] => 
)

********************************

[config.php]
// Disable authentication
var $noAuth = true;

// Host / ip to use for console connections
var $consoleHost = '192.168.0___';

/*
Allow to prompt deletion hard disk files on removal from Virtual Media Manager.
If this is not set, files are always kept. If this is set, you will be PROMPTED
to decide whether or not you would like to delete the hard disk file(s) when you
remove a hard disk from virtual media manager. You may still choose not to 
delete
the file when prompted.
*/
var $deleteOnRemove = true;

/*
* File / Folder browser settings
*/

// Restrict file types
var $browserRestrictFiles = 
array('.iso','.vdi','.vmdk','.img','.bin','.vhd','.hdd','.ovf','.ova','.xml','.v
box','.cdr','.dmg','.ima','.dsk','.vfd');

/*
* Misc
*/

/*
* Auto-refresh interval in seconds for VirtualBox host memory usage information.
* Any value below 3 will be ignored.
*/
var $hostMemInfoRefreshInterval = 5;

/* Screen resolutions for console tab */
var $consoleResolutions = 
array('640x480','800x600','1024x768','1280x720','1440x900');

/* Console tab keyboard layout. Currently Oracle's RDP client only supports EN 
and DE. */
var $consoleKeyboardLayout = 'EN';

/* Max number of network cards per VM. Do not set above VirtualBox's limit 
(typically  or below 1 */
var $nicMax = 4;

// Authentication library.
var $authLib = 'Builtin';

/*
* Cache tweaking.
*
*/
// Refresh VM cache when VM Settings window is loaded. Default is true. Set to 
false to disable.
var $vmConfigRefresh = true;

// Path
#var $cachePath = '/tmp';

/* END SETTINGS */

}

******************************

[/etc/default/virtualbox]
SHUTDOWN_USERS="virtualbox"
SHUTDOWN=savestate
SHUTDOWN=poweroff
SHUTDOWN=acpibutton

**************

Help please. I'm completely stuck here. Thanks in advance.

Original issue reported on code.google.com by zacharyj...@gmail.com on 18 Apr 2012 at 3:57

GoogleCodeExporter commented 8 years ago
Opps, the /etc/default/virtualbox has been appended with:
VBOXWEB_USER='virtualbox'
VBOXWEB_HOST=192.168.0.69

No change resulted.

Original comment by zacharyj...@gmail.com on 18 Apr 2012 at 4:20

GoogleCodeExporter commented 8 years ago
have you set the correct username and password and ip in config.php?

and the var $noAuth = true; is so you dont have to enter a username and password

could you attach your config.php but blank or * your username, pass and ip

Original comment by simonsmi...@gmail.com on 18 Apr 2012 at 6:13

GoogleCodeExporter commented 8 years ago
My config.php is included in the OP.

I noticed though when i cut and pasted two lines were missed so I'll do it 
again without omitting the commented out sections:

<?php
/**
 * phpVirtualBox example configuration.
 * @version $Id: config.php-example 366 2011-12-01 19:56:57Z imooreyahoo@gmail.c
om $
 *
 * rename to config.php and edit as needed.
 *
 */
class phpVBoxConfig {

/* Username / Password for system user that runs VirtualBox */
var $username = 'virtualbox';
var $password = '***';

/* SOAP URL of vboxwebsrv (not phpVirtualBox's URL) */
var $location = 'http://192.168.0.69:18083/';

/* Default language. See languages folder for more language options.
 * Can also be changed in File -> Preferences -> Language in
 * phpVirtualBox.
 */
var $language = 'en';

/*
 *
 * Not-so-common options / tweaking
 *
 */

// Multiple servers example config. Uncomment (remove /* and */) to use.
// Add ALL the servers you want to use. Even if you have the server set
// above. The default server will be the first one in the list.
/*
var $servers = array(
        array(
                'name' => 'London',
                'username' => 'user',
                'password' => 'pass',
                'location' => 'http://192.168.1.1:18083/',
                'authMaster' => true // Use this server for authentication
        ),
        array(
                'name' => 'New York',
                'username' => 'user2',
                'password' => 'pass2',
                'location' => 'http://192.168.1.2:18083/'
        ),
);
*/

// Disable authentication
var $noAuth = true;

// Host / ip to use for console connections
var $consoleHost = '192.168.0.69';

// Disable "preview" box
#var $noPreview = true;

// Default preview box update interval in seconds
#var $previewUpdateInterval = 30;

// Preview box pixel width
#var $previewWidth = 180;

// Change default preview aspect ratio to 1.
// 
http://www.wikipedia.org/wiki/Aspect_ratio_%28image%29#Previous_and_presently_us
ed_aspect_ratios
#var $previewAspectRatio = 1.6;

// Enable custom VM icons
#var $enableCustomIcons = true;

/* Enable HardDisk IgnoreFlush configuration. This controls the "ExtraData" 
setting
 * in "VBoxInternal/Devices/[controller type]/0/LUN#[x]/Config/IgnoreFlush". See
 * Responding to guest IDE/SATA flush requests at:
 * http://www.virtualbox.org/manual/ch12.html#idp12757424
 *
 */
#var $enableHDFlushConfig = true;

/*
Allow to prompt deletion hard disk files on removal from Virtual Media Manager.
If this is not set, files are always kept. If this is set, you will be PROMPTED
to decide whether or not you would like to delete the hard disk file(s) when you
remove a hard disk from virtual media manager. You may still choose not to 
delete
the file when prompted.
*/
var $deleteOnRemove = true;

/*
 * File / Folder browser settings
 */

// Restrict file types
var $browserRestrictFiles = 
array('.iso','.vdi','.vmdk','.img','.bin','.vhd','.hdd','.ovf','.ova','.xml','.v
box','.cdr','.dmg','.ima','.dsk','.vfd');

// Restrict locations / folders
#var $browserRestrictFolders = array('D:\\','C:\\Users\\Ian'); // Or something 
like array('/home/vbox','/var/ISOs')

// Force use of local, web server based file browser instead of going through 
vboxwebsrv
#var $browserLocal = true;

// Disable file / folder browser.
#var $browserDisable = true;

// Disable Windows drive detection
#var $noWindowsDriveList = true;

// Just list all drives from C:\ - Z:\ without checking if they exist or not.
// This may be required on older Windows systems with more than one drive.
#var $forceWindowsAllDriveList = true;

/*
 * Misc
 */

/*
 * Auto-refresh interval in seconds for VirtualBox host memory usage information.
 * Any value below 3 will be ignored.
 */
var $hostMemInfoRefreshInterval = 5;

/* Show % of free host memory instead of % used */
#var $hostMemInfoShowFreePct = true;

/*
 * VM Memory warnings.
 *
 * If $vmMemoryStartLimitWarn is enabled, each time a VM is started through
 * phpVirtualBox, it will check that the available host memory is greater than
 * the base and video memory of the VM + 50MB (a little bit of overhead). If it
 * is not, a confirmation dialog will be presented to confirm that you want to
 * start the VM.
 *
 * If $vmMemoryOffset is set (and $vmMemoryStartLimitWarn), $vmMemoryOffset
 * megabytes is subtracted from the available host memory before the check is
 * performed by $vmMemoryStartLimitWarn logic. For instance it may be a good
 * idea to always have VM memory requirements + 100MB free. 100 is the default.
 */
#var $vmMemoryStartLimitWarn = true;
#var $vmMemoryOffset = 100;

/*
 * Display guest additions version of a running VM on its Details tab
 */
#var $enableGuestAdditionsVersionDisplay = true;

/*
 * Display a "minimal" VM list. This will shrink the size of VMs in the VM list
 * and exclude some information so that they take up less space.
 */
#var $vmListMinimal = true;

/* Enable Firefox's "App Tab" notification support by changing the browser's 
title
 * when something in phpVirtualBox's VM list changes or an alert is triggered.
 */
#var $enableAppTabSupport = true;

/* Disable any of phpVirtualBox's main tabs */
#var $disableTabVMSnapshots = true; // Snapshots tab
#var $disableTabVMConsole = true; // Console tab

/* Screen resolutions for console tab */
var $consoleResolutions = 
array('640x480','800x600','1024x768','1280x720','1440x900');

/* Console tab keyboard layout. Currently Oracle's RDP client only supports EN 
and DE. */
var $consoleKeyboardLayout = 'EN';

/* Max number of network cards per VM. Do not set above VirtualBox's limit 
(typically 8) or below 1 */
var $nicMax = 4;

/* Enable advanced configuration items (normally hidden in the VirtualBox GUI)
 * Note that some of these items may not be translated to languages other than English.
 */
#var $enableAdvancedConfig = true;

/* Enable startup / shutdown configuration.
 * This only works in linux and you must add the vboxinit file to
 * your startup scripts list.
 */
#var $startStopConfig = true;

/*
        Sorting VM List options

        var $vmListSort = 'name'; // Default. Sort VM list by VM name
        var $vmListSort = 'running'; // Place running VMs at the top of the list
        var $vmListSort = 'gui'; // Use drag-and-drop / manual vm ordering
        var $vmListSort = 'stateChange'; // Order by VMs' last state change
        var $vmListSort = 'os'; // Sort by OS type
        var $vmListSort = 'function(..){...}' // uses custom javascript function. Example follows:

        // This places running VMs at the top of the list, then orders by
        // the last VM state change, then by name.
        var $vmListSort = 'function(a,b) {
                if(a.state == "Running" && b.state != "Running") return -1;
                if(b.state == "Running" && a.state != "Running") return 1;
                if(a.lastStateChange < b.lastStateChange) return 1;
                if(b.lastStateChange < a.lastStateChange) return -1;
                return strnatcasecmp(a.name,b.name);
        }';

        NOTE: In a multi-user situation, 'gui' is probably a bad idea.

*/
#var $vmListSort = 'name';

// Authentication library.
var $authLib = 'Builtin';

// VM ownership
#var $enforceVMOwnership = true;

// Per-user VM quota
#var $vmQuotaPerUser = 2;

// Allow VDE network configuration. This must be supported by the underlying 
VirtualBox installation!
// If you do not know what VDE networking is - you do not need it, it is 
probably not supported by your
// VirtualBox installation and will cause errors if enabled.
#var $enableVDE = true;

// Disable setting SATA controllers port count to the max port number found 
when saving VMs.
#var $disableSataPortCount = true;

/* Enable Parallel Port configuration - EXPERIMENTAL
LPT support may or may not work for you.
!!! VirtualBox LPT support only works in Linux. !!!
*/
#var $enableLPTConfig = true;

/* Enable HardDisk IgnoreFlush configuration. This controls the "ExtraData" 
setting
 * in "VBoxInternal/Devices/[controller type]/0/LUN#[x]/Config/IgnoreFlush". See
 * Responding to guest IDE/SATA flush requests at:
 * http://www.virtualbox.org/manual/ch12.html#idp12757424
*/
#var $enableHDFlushConfig = true;

/*
 * Cache tweaking.
 *
 */
// Refresh VM cache when VM Settings window is loaded. Default is true. Set to 
false to disable.
var $vmConfigRefresh = true;

// Path
#var $cachePath = '/tmp';

/* END SETTINGS  */

}

Original comment by zacharyj...@gmail.com on 19 Apr 2012 at 4:26

GoogleCodeExporter commented 8 years ago
Did you restart vboxweb-service after changing /etc/default/virtualbox? What do 
you see when you type:

ps aux | grep vboxwebsrv

?

Original comment by imooreya...@gmail.com on 19 Apr 2012 at 4:33

GoogleCodeExporter commented 8 years ago
yes, I've rebooted each time after the changes. 

grep gave me nothing.

#service vboxweb-service status
Checking for VBox Web Service ...not running

???

Original comment by zacharyj...@gmail.com on 19 Apr 2012 at 4:39

GoogleCodeExporter commented 8 years ago
Run:

/etc/init.d/vboxweb-service start

as root, then try again please.

Original comment by imooreya...@gmail.com on 19 Apr 2012 at 4:50

GoogleCodeExporter commented 8 years ago
ok, I did some sleuthing. The user set in the config wizard was "virtualbox" 
but that user was never actually created, instead per another set of 
instructions a user "vbox" was created.  So I went through and changed all 
references to "virtualbox" in config.php and /etc/default/virtualbox to "vbox" 
as well as added "vbox" to vboxusers group and touched a log file in 
/var/log/vbox.log with chown vbox:vbox.

A "service vboxweb-service start" and "status" shows vboxweb-service is now 
running.

A quick test to login produced the same error as above however.

Original comment by zacharyj...@gmail.com on 19 Apr 2012 at 4:51

GoogleCodeExporter commented 8 years ago
update:  It is now able to connect with noAuth on.  I forgot to set the vbox 
users password after its original creation.  Once it matched the config.php 
password I got in.

I wish these steps were a little more clearly illustrated in the install docs.

I'll try again with noAuth off and see if I can still get in.

Original comment by zacharyj...@gmail.com on 19 Apr 2012 at 4:55

GoogleCodeExporter commented 8 years ago
Verified working with admin/admin login. Thank you for your help.

Original comment by zacharyj...@gmail.com on 19 Apr 2012 at 5:12

GoogleCodeExporter commented 8 years ago

Original comment by simonsmi...@gmail.com on 19 Apr 2012 at 8:20