vendredi 1 juillet 2011

Installer VirtualBox et son module Webmin

Je mets ci-dessous ma procédure que j'ai mise au point pour installer VirtualBox sur un serveur physique avec comme système d'exploitation Linux Ubuntu 10.10 Maverick Meerkat.  Cette procédure a été faite pour la version 3.x d'Oracle VM Virtualbox mais fonctionne également pour les versions ultérieures (4.x).

Introduction

VirtualBox est un logiciel de virtualisation créé par InnoTek. Il est disponible en tant qu'hôte sur les systèmes d'exploitation : Windows, Linux 32 et 64 bits, FreeBSD 32 et 64 bits et Mac OS X.  Il supporte en tant qu'invité : Windows (dont Vista et 7), Linux 2.x, OS/2 Warp, OpenBSD et FreeBSD entre autres.  VirtualBox est un projet Open Source repris par Oracle sous le nom d'Oracle VM VirtualBox.

Prérequis

Créer un utilisateur sysadmin qui dans mon cas me sert à administrer mes serveurs sans utiliser root.

Procédure
Warning: This step requires the unzip utility: apt-get install unzip 
Add Darwin section in /etc/apt/sources.list
deb http://download.virtualbox.org/virtualbox/debian maverick non-free 
Update the packages index
     Update the packages repositories: apt-get update 
Install and configure the VirtualBox Web interface PHP script as sysadmin
cd ~
Prepare the logfile folder: mkdir vbox
Download phpVirtualBox (http://code.google.com/p/phpvirtualbox/downloads/list)
Unpack and configure phpVirtualBox:
unzip phpvirtualbox-0.5.zip
cd phpvirtualbox-0.5
Move the folder phpvirtualbox-0.5 to /var/wwww
Modify config.php
/* Username / Password for system user that runs VirtualBox */
var $username = 'sysadmin';
var $password = 'sysadmin_password';
var $location = 'http://server_name:18083/';
// Default host/ip to use for RDP
var $rdpHost = 'server_name';
Uncomment the following line:
var $consoleResolutions = '640x480,800x600,1024x768';
Restart Apache2 
Install the VirtualBox: apt-get install virtualbox-3.2 
Add sysadmin to vboxusers group (/etc/group) 
Launch the following command: VBoxManage setproperty websrvauthlibrary null 
Launch the VBox Web Server: /usr/bin/vboxwebsrv --background --logfile /<path_to_logs>/vboxwebsrv.log --host `hostname` --port 18083
In case of warning, try to fix using: sudo /etc/init.d/vboxdrv setup 
Check if VBox Web Server is running: ps -ef | grep vboxwebsrv 
Do the VBox Web Server running at boot time
Add the following lines to /etc/rc.local before the last line (exit 0)
# Start at boot time the VBox Web Server
/bin/su -c "/usr/bin/vboxwebsrv --background --logfile /<path_to_logs>/vboxwebsrv.log --host `hostname` --port 18083" sysadmin

Aucun commentaire:

Enregistrer un commentaire

Remarque : Seul un membre de ce blog est autorisé à enregistrer un commentaire.