Update April 28th 2012:
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.
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.
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.
- 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
- Ubuntu Server 10.10
- Virtual Box 3.x for Linux (obtained via apt-get below)
- webmin(obtained via apt-get below)
- Java run time for certain webmin features and phpvirtualbox
- SSH server daemon
- PuTTY as the SSH client for Windows
- phpvirtualbox (note: only works with VBox 3.x, not compatible with 4.x)
- vim (technically optional but still recommended) (obtained via apt-get below)
- LAMP installation
- Instructions for making the VM start up/shut down with the physical machine's start up/shut down
- Lots of hard drives, spare core2duo machine
- VB SATA controller drivers for lots and lots of drives (proper link pending)
- 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).
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).
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.
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
So all these commands work without prompting for a password a hundred times you may want to
sudo su
and authenticate.
- During install selected LAMP, OpenSSH server and SAMBA
- When install finished looked at IP address if command ifconfig
- Connected to Caprica-Phys with PuTTY
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.
- Setting up the group:
- In webmin visit open the "System" section on the left and go into "Users and Groups"
- Select the "create new user" link at the top
- I recommend calling the user "vbox" but as long as you remember the name it doesn't necessarily matter
- At the bottom of the new user page under "Group Membership"/"Primary group"/"existing group" click the little ellipsis ... button
- In the pop-up window scroll down and click the "vboxusers" group which will select that group and close the pop-up
- 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.
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.
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.