Creating a minimal Ubuntu 10.4 VirtualBox Virtual Machine

  1. Download the latest Ubuntu Minimal ISO.
  2. Start up VirtualBox and create a new Ubuntu Virtual Machine. Give it say 768MB RAM and create a new 8GM dynamically expanding disk space (you cannot increase this maximum disk size so make sure you pick something that will accommodate the largest possible size your VM will take).
  3. Go to the Settings dialog in VirtualBox and select to mount the the mini Ubuntu ISO you downloaded. Go through all the other settings as well and make sure sensible configurations are enabled (you can always change these later).
  4. Start the VM, it should boot from the ISO and take you to a 'boot:' prompt. Just hit enter without typing anything.
  5. Select Command-line install from the next menu and follow the prompts selecting language, keyboard, etc. All defaults work fine in most cases.
  6. Set a proxy when prompted if you're behind a proxy server. The installer will then do it's thing, connect to the internet, download packages and install the core of the OS.
  7. After the install, create a user and password when prompted, say ubuntu/ubuntu.
  8. Once all that is over, the VM will restart and you'll be taken to a login prompt. 
  9. Login with the user you created, then install the following (first is a minimal gnome setup, second is needed for installing Guest Additions later):
    1. sudo apt-get install xorg gnome-core gdm gnome-applets gnome-system-tools gnome-utils ubuntu-artwork compiz-gnome file-roller
    2. sudo apt-get install build-essential linux-headers-generic
  10. Restart the VM and login via the new interface.
  11. Install the VirtualBox Guest Additions by clicking on Devices/Install Guest Additions in the VirtualBox menu bar at the top of the VM window. This will just mount a CD ISO under /media/VBOXADDITIONS_x_x_x. Navigate to that directory in a terminal and run 'sudo ./'. 
  12. This gives you a minimal install with not much besides the Gnome environment (you could use an alternative to Gnome such as xfce4 which is supposed to be lighter, but I find Gnome is just a lot more standard and will give you less headaches in the long term). Before installing anything else you may want to just shut down the VM and make a zip of the .vdi disk file to store in a safe place. You can use this as a base image that you can import into a new VM and configure differently. Whenever you do this though (create a new VirtualBox machine configuration and attach it to a copy of this .vdi), login to Ubuntu and delete the file /etc/udev/rules.d/70-persistent-net.rules (otherwise the virtual network card won't be detected, the new VM config creates a new random virtual MAC, Ubuntu caches the old MAC from the original VM you used and gets confused, deleting the file and restarting the VM forces Ubuntu to reconfigure the eth0 interface).
If you want to install PHP/Apache/Postgresql, do the following:
  1. sudo apt-get install postgresql postgresql-client postgresql-contrib
  2. sudo apt-get install php5 php5-gd php5-curl php5-pgsql
  3. sudo apt-get install apache2-mpm-prefork libapache2-mod-php5 
To install a web-browser, just do:
  1. sudo apt-get install firefox
You may also want to create a shared folder between the host OS and the guest OS. In the VirtualBox application on the host OS, click settings and add a new shared folder giving it a name, say 'share'. Then, in the Ubuntu VM, type 'sudo vi /etc/rc.local' and add the line 'mount -t vboxsf share /tmp'. This will link the host folder named 'share' with the Ubuntu /tmp folder at startup. Note though that if you're thinking of creating a shared folder which is also a Dropbox folder, it won't work. The Ubuntu guest Dropbox client won't be able to properly detect and index the files that are being shared by the host.

Install whatever other tools you may need, and remember you can always shut-down and make a zip of the .vdi to take a backup copy that you can come back to later (you can also use the VirtualBox snapshot feature, but make sure you back these up to redundant storage).


    Popular posts from this blog

    Wkhtmltopdf font and sizing issues

    Import Google Contacts to Nokia PC Suite

    Can't delete last blank page from Word