Copying a VirtualBox VDI file running Ubuntu Server and getting Drupal running

Sigh. Things are never as easy as you want them to be. 🙂

I have two computers on my desk. My MacBook and my Asus EEE B202 running Windows XP. I wanted a development environment for Drupal (a php content management framework), so I tried running PHP on my MacBook.

It worked fine, but the first problem appeared when I tried to run Drupal. The PHP GD library was missing (used by Drupal for graphics). This is a known problem and requires a recompilation of PHP. The problem is, the Apache web server installed on the MacBook is used by OS X and may change in future updates to the OS by Apple. It also seemed a bit cumbersome to get it all to work as it should. So, I figured, why not in stead run a virtual machine with a developer setup in linux and get a clean separation between my day to day OS (OS X) and my developer server.

I decided to use VirtualBox, a free software provided by Sun, and run it on my XP machine (the B202). I installed Ubuntu Server 8.10 on the virtual machine.

If you haven’t used a software like VirtualBox or VMWare before, I can only say that it’s much easier than it sounds like. If you can install an operating system you can use VirtualBox. It’s a very slick and easy to use program.

But, there are of course a few problems.

The first problem was that Ubuntu Server was also missing PHP GD (not because of VirtualBox of course, but still). This time I only needed to do a:

apt-get install php5-gd

and voila, Drupal was running.

Now everything should have been fine and dandy if it hadn’t been for the bluescreens that suddenly started to occur on my EEE-box. After running VirtualBox and Ubuntu Server for a couple of minutes, maybe half an hour, XP decides to just crash. This happened over and over again.

Finding the cause of a bluescreen is never fun but it was clearly due to the VirtualBox setup.

But, hey, I’m in the virtual world here. So, I simply copied the .vdi-file (the file that VirtualBox uses to store the operating system on – it’s like a virtual hard drive) to my MacBook and set up a virtual machine with the vdi-file.

Everything worked as it should, except networking (I’m using hosted networking, making the virutal machine appear just like a third computer on my network – very neat, when it works).

The problem is that, although the environments are similar, the virtual network adapter gets a new MAC address. So, the Ubuntu OS gets confused and can’t find the network adapter. This is easily fixed by simply deleting an autogenerated file:

rm /etc/udev/rules.d/70-persistent-net.rules

and rebooting.

Now I have Ubuntu Server 8.10 running on my MacBook. I don’t have any desktop environment set up, making it rather slim (I use 384MB RAM and the full OS only takes about 1,5GB hard drive space). You probably want something like Webmin to make configuration a bit simpler. Here are instructions for setting it up.

Now, let’s just hope my MacBook doesn’t bluescreen.

Standard

Leave a Reply

Your email address will not be published. Required fields are marked *