Tuesday, November 20, 2012

Installing an Ubuntu Virtual Machine

Installing a Virtual Machine

The steps to installing a virtual machine can be found anywhere on the web. However, I'm writing on this subject to get my feet wet on the world of blogging and lose my blogging virginity! Well, here goes.... 

Get VMWare

Although there are other virtual machine client software packages out there I will focus on the VMWare product line for this blog. VMWare provides a free player to get virtual machines running. Ensure that you get the latest player version from vmware.com as there are constant updates to be found. The version that I will be using for these instructions will be VMWare Player 5.0.1


BINARY DETAILS
VMware Player for Windows 32-bit and 64-bit
FILE NAME
VMware-player-5.0.1-894247.exe
BUILD NUMBER
894247
RELEASE DATE
2012-11-06
CHECKSUMS
MD5SUM: 4919e442e80044e58e25a8a0706c2aff
SHA1SUM: b6515b282b7f2fbf2e1ce27e6537f234d3198f53

My host operating system will be Windows 7 64-bit machine. Therefore, I downloaded the Windows version of installation package. I had on my machine an older version of the player (3.0.1) which had some major performance problems with the version of Ubuntu that I was installing. Therefore, get the latest players for best results.


The screen shot above shows the player when you first start it. From here you need to tell it what virtual session to open. To create a virtual image file, you will need either a VMWare Workstation version or my preferred method is to go to http://www.easyvmx.com. This site provides a way to create a template .vmx file that is used to install the operating system into the virtual machine. 

Easy VMX

Easy VMX (http://www.easyvmx.com) is quite easy to use and setup but here is a simple explanation of how to create a basic virtual machine template. When you first reach easyvmx.com, you are presented with a few options. I choose the "easyvmx: virtual machine create" option as it provides the basics of what is needed for this setup. 

Once you click on the easyvmx option, you are presented with a form where you customize your virtual machine as you want. I chose the default setting except for the following:

  • I chose a larger hard-drive since I intend to use it to download larger files (i.e programs, video, music, etc). 
  • Bumped up the RAM to 2GB
  • Changed my operating system to be Ubuntu. 
Once you are happy with your customization, click on the "create experimental virtual machine" button. At this point it will re-direct you to another page that provides a link to your virtual machine files compressed (.zip). Download the file and save it to your machine.

Installing Ubuntu

I originally started with Ubuntu 12.10 but decided to go with the more stable 12.04 LTS release since it provided a more stable platform for VMWare. Installation of 12.10 at the time had some well known issues including some pretty limiting performance problems with the use of Unity. In the end, I decided to by-pass all the headaches and just go with 12.04.

Installation is pretty straightforward. VMWare will generally auto-detect the image if on a mounted drive but you can tell it to use an .iso located on your hard-drive.

The Ubuntu installation is not too complicated and asks things like time-zone, username, password, etc. All the usual stuff. If you are unsure about something, just go with the default setting and click on next.

Once you go through the installation process you will have a fully functional Linux OS! Now we proceed to some customization.

Installing VMWare tools

Installing VMWare tools provides performance advantages along with several other features that make it worth the effort for installing. 

First go to Player > Manage > Install VMWare Tools

At this point it will mount an image on your system. Open up a command prompt and open up the package

> tar -xsvf /media/VMWare\ Tools/VMWareTools-<version>.tar.gz

This will extract the archive and uncompress all the files. Now navigate to the location that the files were extracted to and run the perl script

> sudo ./vmware-install.pl

Now, unless you are doing some customization I would safely accept all the default settings. 

dpkg and apt-get

If you are completely new to Ubuntu, you will be wondering how do programs get installed. For user familiar with Windows OS this is a process of downloading an installation package (.exe or .msi) and double clicking on the resulting icon at which point an installation dialog is presented to the user. Ubuntu and similar Linux operating systems have special applications that do this for you, however the workflow that you might be used to is a little different. 

Now, that is not to say that Ubuntu and related OS do not have nice GUI front-ends that provide a more user friendly experience when installing software (i.e Ubuntu Software Center, Synaptic Package Manager, etc) but when working with Linux OS (and any Unix based system for that matter) one should eventually embrace the power of command line processing. Sorry!

dpkg and apt-get are all about getting the right software and all its dependencies to your machine all safe and sound. At the core sits dpkg which allows packages (ie. software) to be installed on your computer. apt-get also does the same but deals well with all the dependencies these packages may have, resolving additional software, fixing broken dependencies, removing obsolete packages, etc. I would say 90% of the time when installing software you will use apt-get so learn how to use it.

The most important commands for apt-get are as follows:

sudo apt-get update (this will update the links within the repository apt-get uses to retrieve software)
sudo apt-get install <package name> (installs a particular package)
sudo apt-get upgrade (updates all packages installed)

There are others of course but as you learn about apt-get you will add to your list of commands. 

Useful Tools 

  • Install Sublime Text Editor (http://www.technoreply.com/how-to-install-sublime-text-2-on-ubuntu-12-04-unity/)