January 31, 2012 Spare yourself the trouble: go virtual
If you’re considering serious software development, you should consider doing your development in a virtualized environment. When dealing with Linux, this is by far the best approach. Agility with virtualization will allow you to test your code in a multitude of different distros and scenarios, easily check for package dependencies, etc etc. The source code of your programmatic ramblings should be stored in a public server, instead of being kept local, trapped inside the virtual machine. This is why using version control software such as git or svn is crucial. But that’s for another talk, this one is about virtualization.
1. Get VirtualBox
VirtualBox is a full-feature free software virtualization suite that runs Linux like a charm. Download it from www.virtualbox.org or hit
sudo apt-get install virtualbox
on your console if you’re pro and are already running Linux. Super!
2. Get Ubuntu
Let’s talk about Ubuntu versions. As you may or may not know, Ubuntu releases a new version every 6 months. Every 2 years, in April, a long-term support version is released which is usually referred to as the LTS. LTS versions are supported for 3 years (5 years for servers) instead of the usual 1.5 years. The latest LTS versions are 8.04, 10.04 and the upcoming 12.04.
That’s a lot of versions. How do users choose what version to install? Well, regular users just stick with the latest version. We’ll call them general population or gen pop for short. This is to allude to the fact that they live in a sort of computing prison, constantly reinstalling their OS. So gen pop always upgrades to the latest version and doesn’t give a shit about the LTSs. Who uses the LTS? We’ll call them the saners, since they don’t live in a self-inflicted prison. They normally only upgrade from an LTS to an LTS.
Here’s a quick overview of the last 2 years of Ubuntu versions:
- 10.04 called the Lucid Lynx is the pinacle of a generation. It runs Gnome 2 and is taken seriously by professionals in computing-related fields. This where the saners are.
- 10.10-11.10 are a series of beta-level editions whose main objective is to develop and test the new Unity desktop. Only Gen pop and Ubuntu developers ride this wave.
- 12.04 called the Precise Pangolin is the first generation LTS running Unity. Everyone is a bit suspicious of what’s gonna happen. It’s due in 3 months. People in the professional area are especially suspicious of what the hell is gonna happen.
So, what’s the deal? As soon as 12.04 is released gen pop will adopt it immediately, so the 10.10-11.10 versions are irrelevant. Saners will only upgrade if Unity isn’t a disaster. Either way, what makes sense today if we intend our software to reach a high number of people is to support both Ubuntu 10.04 and 12.04. You can get the latest daily build of 12.04 here.
3. Create the machine
This is dead simple. Some basic configurations on the new machine:
- 1536MB RAM is a good base.
- 8GB dynamically allocated is enough for light development, adapt accordingly. Remember that dynamically allocated means the size of the disk file is proportional to the amount of disk used. So you can setup a 32GB disk, and the file that supports it is only 1GB in size, and as you use Ubuntu, the disk will start to grow.
4. Install Ubuntu
Start your VM and choose the Ubuntu iso you downloaded when the First Run Wizard asks you for an installation media.
Heads up! Boot into the live session first and install by double clicking the shortcut in the desktop. Choosing install Ubuntu from the boot menu will fail!
The rest of the installation is just a matter of clicking next next next as fast as you can.
VirtualBox provides a custom set of kernel modules to make Ubuntu run super-smooth. To install them go to Devices->Install Guest Additions in the VM’s menu. This will mount a CD with the required software. Now it’s just a matter of running the executable in the terminal. Open a terminal and hit
cd /media/VBOXADDITIONS/* sudo ./VBoxLinuxAdditions.run
Restart and boom, all done.
Here’s a couple of tricks and tips that will make your life easier as a developer.
Open terminal nautilus plugin-in
sudo apt-get install nautilus-open-terminal
Opens a terminal in the current nautilus folder. Super convenient. Just logout and log back in to see the new option in the context menu.
Go down you lousy paragraph! Down I say! DOWN!
sudo apt-get install terminator
Terminator ia a terminal that opens several windows and this way you can either control several machines through ssh, or be at several folders at the same time.
Useful for programs that have makefiles all over the place.
Have some tips of your own? Please leave a comment and I’ll add it to the post, we’re trying to look like a team here : -)
Alright, ready for development! At the end of this step you should have both versions running inside their own little VMs like in the pretty picture – PreciseVirgin and LucidVirgin. You’re ready to proceed to step two in this series.