Quantcast
Channel: SUSE Family – Vavai's Personal Notes
Viewing all articles
Browse latest Browse all 25

Installing VirtualBox VBoxHeadless & PHPVirtualBox on openSUSE 12.1 Minimalis

$
0
0

VirtualBox is one of the tools that are used for Desktop Virtualization : running an OS within the OS. VirtualBox usually installed on the operating system that already has the VirtualBox GUI to manage it. But, how to manage VirtualBox without VirtualBox GUI? VBoxHeadless is the answer if we want to install VirtualBox on minimal Linux server and manage it via Browser.

I’m using openSUSE 12.1 64 bit on this tutorial but the steps can also be applied to earlier versions (11.x) as well as on SLES 11 SP1. I also use VirtualBox for All distributions binary package, although for openSUSE we can also use an RPM-binary package.


Lets get started :

  1. Install openSUSE 12.1 Minimal Server (Text Mode)
  2. Installing package for VirtualBox Kernel Modul
    zypper in kernel-source make gcc gcc-c++ pam-devel kernel-syms SDL
  3. Download VirtualBox binary package with the Extension Pack from www.virtualbox.org
    cd /opt/
    wget -c http://download.virtualbox.org/virtualbox/4.1.6/VirtualBox-4.1.6-74727-Linux_amd64.run
    wget -c http://download.virtualbox.org/virtualbox/4.1.6/Oracle_VM_VirtualBox_Extension_Pack-4.1.6-74713.vbox-extpack
    
  4. Install Virtualbox
    chmod +x VirtualBox-4.1.6-74727-Linux_amd64.run
    ./VirtualBox-4.1.6-74727-Linux_amd64.run
    
  5. Install the Extension Pack
    chmod +x Oracle_VM_VirtualBox_Extension_Pack-4.1.6-74713.vbox-extpack
    VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.6-74713.vbox-extpack
    
  6. Create a user for VirtualBox web access
    useradd vbox
    passwd vbox
    New Password : vbox
    Reenter New Password : vbox
    
  7. Create a VirtualBox web configuration on /etc/default/
    vi /etc/default/virtualbox
    

    with the following contents :

    VBOXWEB_USER=vbox
    
  8. Install LAMPP server and php5-soap package by using zypper
    zypper in -t pattern 'lamp_server'
    zypper in php5-soap
    
  9. Edit /etc/apache2/default-server.conf and replace Options None to Options ALL so Apache will display the contents of the directory index
    vi /etc/apache2/default-server.conf
    
  10. Download latest phpvirtualbox package
    cd /opt
    wget http://phpvirtualbox.googlecode.com/files/phpvirtualbox-4.1-5.zip
    unzip phpvirtualbox-4.1-5.zip -d /srv/www/htdocs
    cd /srv/www/htdocs
    mv phpvirtualbox-4.1-5 phpvirtualbox
    cd phpvirtualbox
    
  11. Rename config.php-example to config.php and modify the contents to an appropriate configuration
    mv config.php-example config.php
    vi config.php
    
    var $username = 'vbox';
    var $password = 'vbox';
    var $location = 'http://192.168.1.111:18083/';
    var $consoleHost = '192.168.1.111';
    
    

    Note : 192.168.1.111 is my VBoxHeadless Server

  12. Restart web server and run the VirtualBox services
    service apache2 restart
    vboxwebsrv --host 192.168.1.111 -b
    
  13. Open a browser and go to http://VBOXHeadLess-Address/phpvirtualbox, login with the default user: admin with password : admin

On the client side, access the VirtualBox VM by using rdesktop or krdc with following examples :

rdesktop 192.168.1.111:3389

Here is the view of VM on VBoxHeadless, running Minimal Server Appliance.


Note :

  1. If you encounter an error message: PHP does not have the SOAP extension enabled, install php5-soap package from openSUSE 11.2 OSS repository
  2. If the Console does not open or error, power off the virtual OS then click on Settings -> Select Display -> Remote Display -> Checklist on the Enable Server and give the port on the Server Port, for example 3389 -> OK then run again. If you have more than one virtual OS,  do the similar process and change Server Port to 3390 and so on

Viewing all articles
Browse latest Browse all 25

Trending Articles