2011-11-07

Ubuntu 11.10 Server in VirtualBox 4.1.10

I've been doing a lot of research over the years looking for ways to integrate new or updated Software in different environments, something I always need is a Virtual Machine in which I install all the new stuff to test it and people ask me about how I create it to start their own (and, with a bit of luck, compete with me to be the first to implement something useful to make someone's job a bit easier).

At this time, I'm using VirtualBox 4.1.10 (no Extension Pack) and Ubuntu 11.10 Server (64 bit) but you can use 32 bit as well.

Preliminaries:
  1. Create a Virtual Machine using all the default option for a "Linux" Operating System and the "Ubuntu (64 bit)" Version.
  2. After creation, you need to change from SATA to IDE in the Storage configuration or your system will never boot (please! don't ask me why).

Installation:

After language selection (when you can highlight the "Install Ubuntu Server" entry) you should press "F4" on the keyboard to list the available instalation modes and select "Install a minimal Virtual Machine", now when you "Install Ubuntu Server" the installer will use a special version of the Linux Kernel made to be used in Virtual Machines.
Once the installation starts, configure everything according to you needs. I'll just list the following:
  • At the "Partition Disks" step I select "Guided - Use entire Disk" which will create a 534.8MB partition for Swap and leave the rest for the file system root "/" using EXT4.
  • At the "Software selection" step I leave everything blank to know exactly what packages I need to install when needed.

Post-Installation:

You will notice a faster boot of your Virtual Machine as it is using just what it needs to run, but to have complete functionality you might want to do the following:
  1. ACPI Shutdown from the "Machine" menu in VirtualBox does not work, to make it work use the following command:
    sudo apt-get install acpid
  2. Build Essential is missing, to install the packages needed to compile use the following command:
    sudo apt-get install build-essential
  3. No firewall installed, it is a good idea to install one if you want to understand your network services and add a level security, to install the Uncomplicated Firewall and enable it use the following commands:
    sudo apt-get install ufw  
    sudo ufw enable  
    
  4. There is no X server installed but you might want to use VirtualBox Shared Folders, select "Install guest additions..." from the "Devices" menu in VirtualBox and use the following commands:
    sudo apt-get install dkms linux-headers-virtual
    sudo mount /dev/cdrom /media/cdrom
    cd /media/cdrom
    sudo ./VBoxLinuxAdditions.run
Remember to keep your packages up to date with the following commands:
sudo apt-get update
sudo apt-get dist-upgrade
At this point you might want to export the appliance (444MB), clone the Virtual Machine or save a Snapshot.

I hope this will help someone out there, please feel free to send any comments.

No comments: