Setting up a Virtual Machine to run Ubuntu

Setting up a Virtual Machine to run Ubuntu

The Open Source community has created some wonderful products in the mapping realm in the last few years including OpenStreetMap, OpenLayers, Mapnik, TileMill (built upon open source libraries), PostgreSQL, and GDAL to name just a few.  These are all powerful applications but because they are designed for and by the open source community, some of these tools work a lot easier on a Linux platform.  After struggling to get these programs to work on my Windows set up for over a year, I finally gave in and attempted to set up an Ubuntu platform.  I haven’t turned back since.

Ubuntu

It seems that the most common way to set up Ubuntu is through a Dual Boot system where the two operating systems run off the same Hard Drive.  It is also possible to set it up so that Windows runs on one hard drive and Ubuntu on another.  In this tutorial I will show you another option which explains how to set up Ubuntu through a virtual machine.

There are several pros and cons (http://www.psychocats.net/ubuntu/virtualbox) to consider when deciding how to set up your system, but I prefer the virtual machine because I do not want to hassle with partitioning my hard drive and potentially destroying my company owned computer.  Through the virtual machine I can easily switch between Ubuntu and Windows, access shared files in either system, and run all my open source applications without the frustration of trying to make it work in Windows.

In this tutorial, I am really only going give references to the tutorials that I found most useful when installing Ubuntu.  So I am not going to duplicate material when it is already out there, but I will walk you through from start to finish of everything involved, not just one part of the procedure.

There are two pieces of software that you need to download: VirtualBox (your virtual machine software package) and the most recent version of the Ubuntu ISO.

 

Setting up Virtual Box

There are several virtual machine options but VirtualBox has worked very well for me and was relatively easy to use, so it is the software that I recommend.  Great instructions for setting up the virtual machine can be found here: http://www.psychocats.net/ubuntu/virtualbox

Installing Ubuntu

Once the virtual machine is up and running, you can simply install Ubuntu like you would with a normal hard drive instead of a virtual machine.  It is pretty straight forward, but Psychocats (you can tell this site has really helped me) does a step by step example: http://www.psychocats.net/ubuntu/installing.

Install

Full Screen Ubuntu

Once installed, one would think that everything is over.  But upon running Ubuntu through the virtual machine, the user will immediately find that Ubuntu is not running in full screen mode and that the mouse has a slight (and annoying) delay.  This can be a big headache, but one that can be easily fixed. Guest Additions

With the Ubuntu Virtual Machine running, go click Device -> Install Guest Additions.  Click Run, type in your password and you should be off.  After you restart your machine, it should be working in full screen mode.  This is a clear video of how to do it: http://www.youtube.com/watch?v=jGlCdxKx0gI.

Share files between windows and your virtual machine

The next step is to share certain Windows folders with your virtual box.  This should be an easy task, but it took me a long time to find a method that worked for me.  In the end, this video: http://www.youtube.com/watch?v=ddExu55cJOI showed me the way to correctly mount a folder.

mount

Done

Now you should be able to run your open source software through your virtual machine version of Ubuntu.

 

Testing Ubuntu First

If you are not fully convinced that you are ready to make the move to Ubuntu, you can give it a test run first.  Ubuntu offers a pretty nifty option in that you can try it out before investing much time setting it up.  Give Ubuntu a test spin by running the software as a LiveCD (https://help.ubuntu.com/community/LiveCD) .

After downloading the Ubuntu ISO, you need to get it onto a CD so that you can boot your computer from CD.  This might be obvious to everyone else, but I didn’t realise that you couldn’t simply burn the ISO file onto a cd like a normal data file.  It actually needs to be burned in a way that expands the image so you have usable files on the disk.  Check out these specific instructions: https://help.ubuntu.com/community/BurningIsoHowto.

Hopefully you can simply restart your computer with your Ubuntu ISO CD in the computer and you will be given the option to boot the computer off the CD.  If that is not the case (it wasn’t for me either), you may have to dabble with your BIOS a bit.  This is a good starting point for looking at the BIOS https://help.ubuntu.com/community/BootFromCD, but every computer is going to be different and you may need to look into the user manual for you specific computer.

I hope that this has been a good starting point for you.  Feel free to shoot me any questions you have.