Quantcast
Channel: Matthew Hodgkins Blog » vm whs2011
Viewing all articles
Browse latest Browse all 2

How to run VirtualBox on WHS 2011 – Part 1 of 2

$
0
0

One of the slight drawbacks of my migration from a Windows Server 2008 R2 file server to a Windows Home Server 2011 file server was the lack of Hyper-V in WHS 2011. I used to run a few Virtual Machines under Hyper-V for testing purposes and wanted to do the same under WHS 2011. I decided to use VirtualBox as I have had a great experience with it before on my desktop’s and laptops.

After following Part 1 and Part 2 in this series of articles you will be able to:

  • Host Virtual Machines on your Windows Home Server 2011 box
  • Manage Virtual Machines using a Web Interface
  • Login to managing your Virtual Machines using WHS user accounts
  • Remotely RDP into your Virtual Machines even if they are Linux machines
  • Shutdown machines automatically upon shutting down your WHS
  • Start machines automatically up booting up your WHS

In Part 1 we will cover:

  • Installing Virtual Box
  • Installing phpVirtualBox in IIS for web management of VirtualBox

VirtualBox Application

  • Download the latest version of VirtualBox from https://www.virtualbox.org/wiki/Downloads
  • Follow the VirtualBox installation steps accepting the defaults
  • After install has finished configure default location for Virtual Machines
  • Open the Oracle VM VirtalBox application
  • In the top navigation pane choose File | Preferences
  • In the General tab | Modify the Default Machine Folder. I would not recommend putting them in a WHS shared folder, or the C:\ drive. Just put them in a separate folder on one of your hard drives.
    Figure - Set the VirtualBox Default Machine Folder
  • Download and install the Oriacle VM VirtualBox Extension Pack from https://www.virtualbox.org/wiki/Downloads. This will enable us to RDP into the virtual machines.

Run VirtualBox as a Service

  • Download the latest version of VBoxVMService https://sourceforge.net/projects/vboxvmservice/files/
  • Open the VBoxVMService zip file you downloaded | Open the vms | Extract the contents into C:\Apps\VBoxVMService
    Figure - Extract VBoxVMService
  • Open C:\Apps\VBoxVMService\VBoxVmService.iniin notepad and update the values accordingly, removing the [Vm0] and [Vm1] sections:
    [Settings]
    ServiceName=VBoxVmService
    RunAsUser=.\Administrator
    UserPassword=YourPassword
    VBOX_USER_HOME=C:\Users\Administrator\.VirtualBox
    RunWebService=yes
    PauseShutdown=5000

    Note: It is important to have RunWebService=yes as this will be used by our web interface.

  • Open a command prompt and enter the following commands:
    cd \
    cd apps\VBoxVMService
    VmServiceControl.exe –i
  • You will receive the Service VBoxVmService installed after you enter your command if it worked successfully:
    Figure - VBoxVmService successfully installed
  • As the service installation adds an environment variable, restart the Windows Home Server now

VirtualBox Web Interface

As most Windows Home Servers are headless boxes, it would be nice if we could manage our virtual machine through a web interface so we don’t need to remote desktop into the server each time we want to manage VirtualBox. phpVirtualBox will handle this for us.

  • Download the latest version of phpVirtualBox http://sourceforge.net/projects/phpvirtualbox/
  • Extract phpVirtualBox to C:\Apps\phpvirtualbox
  • Browse to the C:\Apps\phpvirtualbox folder | Rename config.php-example to config.php
  • Open config.phpin a notepad | Modify the configuration file with the username and password you will be running VirtualBox as (most likely Administrator)
    /* Username / Password for system user that runs VirtualBox */
    var $username = 'Administrator';
    var $password = 'YourPassword';

Now that phpVirtualBox has been configured, we need to configure IIS to serve the web page. First we need to give IIS PHP support.

  • Download and install the Microsoft Web Platform Installer http://www.microsoft.com/web/downloads/platform.aspx
  • From the Start Menu | Open Internet Information Services (IIS) Manager
  • In the left navigation pane click on Your Server Name and open Web Platform Installer in the right hand pane
    Figure - Open Web Platform Installed in IIS
  • After the Web Platform Installer loads do a search for PHP
  • In the search results click on the Add buttons next to PHP 5.3.10 and PHP Manager for IIS
  • Press the Install button down the bottom right and click I Accept
  • Now IIS supports PHP, we can finish the phpVirtualBox configuration.
  • Add the C:\Apps\phpvirtualbox as a virtual directory in IIS
    • From the Start Menu | Open Internet Information Services (IIS) Manager
    • Expand out Your Server | Expand out Sites | Right click on Default Web Site and choose Add Virtual Directory
      Figure - Add a Virtual Directory in IIS
    • Give it the alias VM and set its Physical path to C:\Apps\phpvirtualbox
      Figure - Configure the VM Virtual Directory
  • Open the web browser on the WHS server and browse to http://localhost/vm use the default username and password admin / admin
    Figure - Open phpVirtualBox
  • You are now logged in to the web interface and can start managing and creating your virtual machines!
    Figure - Manage VirtualBox from the browser
  • You can also access your virtual machine management web page from the internet using SSL thanks to the build in WHS remote web access. Just browse to https://yourname.homeserver.com/vm from anywhere:
    Figure - Access your Virtual Machines over the internet using SSL

In the next part of this series we cover:

    • Login to managing your Virtual Machines using WHS user accounts
    • Remotely RDP into your Virtual Machines even if they are Linux machines
    • Shutdown machines automatically upon shutting down your WHS
    • Start machines automatically up booting up your WHS

Update: Part 2 of the series has now been posted here.

Update (1/4/2014): Fixed link to phpVirtualBox as it has moved to SourceForge


Viewing all articles
Browse latest Browse all 2

Trending Articles