Overclock.net banner
1 - 5 of 5 Posts

· Registered
Joined
·
1,767 Posts
Discussion Starter · #1 ·
Update April 28th 2012:
  • I've only just started to work on this once more (only been a year+). I decided to re-organize a little and better utilize the spoiler tag. This is the first time I've tried to edit an old thread since the re-design and I can't seem to figure out how to edit the title.

This document outlines how to use the "OSE" (open source edition) version of VirtualBox (VB for short) as a dedicated VM server using Linux as the host (using my recorded steps of how I managed it as a plot device). Kind of a poor man's version of the industrial strength versions of this found in that of Xen or KVM (presumably inferior in performance and other features).

I want this new headless Linux host to be as easy to manage as possible so I'll be installing webmin and phpvirtualbox.

My main goals of this setup was to make getting around the system as easy as possible by utilizing both webmin and phpvirtualbox along with easy startup/shutdown of my WHS VM when the host is started and shutdown.
  • Original "physical" installation of WHS has a host name of "Caprica"
  • Current virtual install of WHS under VB is (the very descriptive) "Caprica-V"
  • The host of the "Caprica-V" VM temporarily is my sig rig (Galactica)
  • New physical Linux host for Caprica-V will be called Caprica-Phys
  • LAMP: the combo of Linux/Apache/MySQL/PHP


  • Install Ubuntu Server 10.10 with LAMP/SSH server/SAMBA done
  • Install support files like unzip, webmin and virtualbox done
  • Download/extract and configure phpvirtualbox done
  • Create new VM on with phpvirtualbox, configuring virtual NIC and SATA controller as necessary done
  • Set up NFS, SAMBA shares, SCP, FTP or use webmin or something else for copying the VDI files between the Win7 box and the Linux box [currently stuck on this part, any help greatly appreciated]
  • Copy over VDI files from current location on Win7 box to new home on Linux host
  • Attach VDI files to this new VM and perform test boot
  • RDP into Caprica-V on new Linux host home
  • (assuming all is running correctly and smoothly)
  • Configure Linux to start and shutdown the Caprica-V with the physical host's startup/shutdown auto-magic

Q. Why VirtualBox and not Xen/KVM/VMWare/Hyper-V/etc.?
A. I didn't have a spare machine with the "VM extension" on the CPU until very recently. And I have finished moving all the data over to a VB VM so I'm not doing that again.

Q. What are the hardware specs of the Linux host box?
A. Didn't write them, but from memory: Core2Duo (several years old) with roughly 3.5 gigs of memory and four hard drives for storage, a combo of 1TB and 500 gig drives (haven't decided how many of which yet).
Several years ago I purchased an OEM copy of WHS and put it on a spare box. At the time my main desktop and the "spare box" were about the same amount of power and memory so I used WHS as my "also ran" to rip DVDs, encode videos and store videos and experiment with VMs using VirtualBox (the non-OSE version). Over time the OS started to degrade as the amount stored data steadily increased to around 1.5TBs of data most of which was not backed up (not enough hard drives/PCs/sata ports even if I had wanted to).

Sometime in 2010 it became rather obvious WHS was in desperate need of a re-install. Besides that since the "drive extender" technology can't be transferred between installs of WHS (as far as I know) I was starting to wonder what I would do if the mother board died or the system became otherwise non-bootable.

I decided instead of simply re-installing WHS on the same box I would convert it over to a VM as that way it would make it physical-hardware independent: just take the virtual hard drives and connect them to VirtualBox on another physical computer. I could also figure out some way of backing up just the virtual hard drive files and perhaps add in other forms of redundancy.

Since I need to re-install anyway and all "physical to VM" converter products seem to cost money for use on server-based Windows I installed (and activated) WHS fresh in VirtualBox.

The first issue was the practicality of moving all that data: did I really want a single file of more than a TB in size as a single point-of-failure? I was going to be using a combination of 1TB and 500 gig drives so I decided to split the data over several virtual hard drives about 220 gigabytes in size each: This was so I could fit two virtual HDDs per 500 gig drive and four per 1TB drive. I also re-formatted these physical drives with the largest possible sectors offered in Windows since I knew I would be working with such large files.

Since I didn't have a machine to dedicate to this whole process and since my Core i7 PC is so fast and has so much memory (and sata ports!) I just started the process on it (galactica).

  • Installed and activated WHS in VirtualBox
  • added a whole bunch of SATA ports to the VM
  • installed the SATA controller drivers in WHS so it could see the extra ports (this is not included in Guest Additions for some reason)
  • Configured VirtualBox so it had an actual accessible IP address so I could access it with Remote Desktop
  • Finished moving the data over (original "Caprica" is actually ready to host the VM)
  • Created an Ubuntu server VB VM to practice: install the SSH daemon, LAMP stack, VB and phpvirtualbox

What I quickly realized is that if I started copying too much data at a time the VM would eventually either freeze up or BSOD. The host machine would remain functional while the VM would just sit until I finally force-closed it.

To work around this I would move a a couple gigabytes at a time from the old WHS install to the new one until eventually there was only the original WHS boot drive left. Which I have removed and saved separately in case I need it for some reason.

I have the the VDIs (VBs virtual disks) spanned across several hard drives as "dynamically sized" virtual disks between 130 and 200 gigabytes (as reported by the host OS, Win7). I believe these host drives are formatted as large of sectors as it would let me set (that's supposed to be good for large files, right?).

I'm starting to think the physical size limit of any single file is 200 gigabytes. Apparently I found the limit.
Install Ubuntu Server 10.10 on new physical host, Caprica-Phys
  • During install selected LAMP, OpenSSH server and SAMBA
  • When install finished looked at IP address if command ifconfig
  • Connected to Caprica-Phys with PuTTY
I developed this series of commands after installing and setting up ubuntu server in the VM several times. This is where some options open up for the reader. You can create a new text file and paste this into it with vi then mark the file as executable. Or you can just paste this directly into your connected PuTTY window. No guarantee of success with that approach but it worked some-what consistently for me.

So all these commands work without prompting for a password a hundred times you may want to
sudo su
and authenticate.
Code:

Code:
echo deb http://download.webmin.com/download/repository sarge contrib >> /etc/apt/sources.list
echo deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib >> /etc/apt/sources.list
echo deb http://download.virtualbox.org/virtualbox/debian maverick contrib non-free >> /etc/apt/sources.list
cd /root
wget http://www.webmin.com/jcameron-key.asc
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
apt-key add oracle_vbox.asc
apt-key add jcameron-key.asc 
apt-get -y update
apt-get -y install webmin
apt-get -y install vim
apt-get -y install unzip
apt-get -y install php-soap
apt-get -y install dkms
apt-get -y install virtualbox-3.2

For more information on webmin under Ubuntu I already wrote a convenient thread about this.

Depending on your connection to the Internet this may take a while.

If you encountered any errors during the above process the command
sudo apt-get -f install
usually does a good job of resolving any issues.

To confirm you have VirtualBox installed you can issue the (case sensitive) command
VBoxManage
A whole list of usage options should scroll by.

  • When the the list of installs are done you can connect to the server in a web browser with the same IP you used for PuTTY:
  • http then 's' then the server IP then :10000
  • Don't forget the s in https and colon-10-thousand.
  • You will likely get a scary looking warning because of the certificate used for webmin. It's okay to continue anyway (I wouldn't recommend this for a normal internet site).
  • Login using the same name/password you have been using on the physical box/PuTTY
  • The first thing you'll see from webmin is a prompt to auto-update all the various packages and dependencies. This may or may not be necessary but it also may take a while.
  • You want to stay at VB 3.2 for reasons that will be clear in a moment. VB should not be in the list of packages with an available update anyway.

  1. Setting up the group:
  2. In webmin visit open the "System" section on the left and go into "Users and Groups"
  3. Select the "create new user" link at the top
  4. I recommend calling the user "vbox" but as long as you remember the name it doesn't necessarily matter
  5. At the bottom of the new user page under "Group Membership"/"Primary group"/"existing group" click the little ellipsis ... button
  6. In the pop-up window scroll down and click the "vboxusers" group which will select that group and close the pop-up
  7. Click the "Create" button at the bottom of the page

  • Download the phpvirtualbox zip package using command:

    Code:

    Code:
    wget http://phpvirtualbox.googlecode.com/files/phpvirtualbox-0.5.zip
  • You can use webmin for this but I prefer good old PuTTY. Just paste it right in. It's okay to download the zip to your home folder or wherever, it will be extracted else where anyway.
  • Then extract the zip to /var/www the sudo portion is optional depending on if you already did the sudo su command above
    sudo unzip phpvirtualbox-0.5.zip -d /var/www
  • This will extract the contents to the directory /var/www/phpvirtualbox-0.5
  • This phpvirtualbox directory will be in your URL. For instance (http:) server ip/phpvirtualbox-0.5
  • I preferred something a little shorter so I re-named it to simply "vbox"
  • From here you can use the webmin file manager to rename this phpvirtualbox-0.5 directory to something shorter or use the command line for something like
    sudo mv /var/www/phpvirtualbox-0.5/ /var/www/phpvbox
    to rename the directory

  • Expand the "Other" link in the left frame of webmin
  • Select "File Manager" (This is where you'll need that annoying Java runtime)
  • Browse to your phpvbox folder from above, such as /var/www/phpvbox/
  • Select config.php and hit the "Edit" icon: a window with the contents of config.php will pop up
  • You'll want to change these lines to look like this, change the username and password lines to match yours if different:
    var $username = 'vbox';
    var $password = 'vbox';
  • Just click "Save" and "Close" when done
  • No further steps for phpvirtualbox should be necessary
  • Try your URL in a browser:
    http://*server ip*/phpvbox/
  • Either it will load right up (using Java) or will issue some cryptic error

I spent I think more than a week trying to get this phpvirtualbox to come up. I read the instructions over and over, I re-installed ubuntu server in the VM several times trying to figure what I was doing wrong. It was really, really frustrating and I came close to giving up.

Then I found on the "issues" portion of the phpvirtualbox home page one comment mentioning phpvirtualbox not being compatible with virtualbox 4.0. Would have been nice if they put that on the home page in big bold letters. I don't know, maybe it's just me, but "supports virtualbox 3+" translates to "three-or-greater" as in "all numbers that are greater than 3". Which I thought included, you know, 4. Silly me. So as I write this, the last thing I read, was that phpvirtualbox does not support version 4 of virtualbox. Thus the reason my "script" above auto-installs virtualbox 3 instead of 4.
As of April 10th this is as far as I have made it. As of April 10th this is as far as I have made it. The Linux host "Caprica-Phys" has a small boot drive and a 500 gig drive. I tried to create an LVM partition on the 500 gig drive but I have no idea what I am doing.

So if any one can render assistance for the creation of the LVM partitions and subsequently setting up auto-mounting for said new drive and then creating a samba share on it (or some other method to transfer files over the network) it would be much appreciated.
 

· Registered
Joined
·
12 Posts
Just a thought, are you going to be using this box for anything else besides running WHS in a VM?

I currently use Proxmox http://pve.proxmox.com and I LOVE it. It's Debian based, and has support for OpenVZ and KVM. I have several VM's running on mine and it's rock solid, plus easy to administer and it's plain jane Debian 5 under the hood if you want to do more tinkering. I got fed up with trying to make PHPVirtualBox work satisfactorily and honestly have no love for VirtualBox in general so I've been using Proxmox ever since.

It's really simple to setup and they have built some really nice tools into it.

EDIT: Doh! Forgot about the part where you said you didn't have VT extensions on the CPU your using, so this probably won't help you much
frown.gif
sorry about that!
 

· Registered
Joined
·
1,767 Posts
Discussion Starter · #4 ·
Ya the VTx thing will get ya. Besides not requiring VT-x VBox also has the advantage, if you can call it that, of being available for multiple OSes. So I could switch host OSes if I wanted, run it on server 2008 embedded storage or whatever it's called (I have my MSDN ISOs). I probably won't but it's kind of nice to know it's an option on some level.
 

· Registered
Joined
·
1,767 Posts
Discussion Starter · #5 ·
Since I'm picking this back up I thought I would organize it a little, thus giving myself a bump. As noted in the top post maybe I'm missing something obvious but I can't seem to figure out how to edit the main thread title. Any clues would be appreciated.
 
1 - 5 of 5 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top