Installing Linux in a VM

We will be using Linux as a case study for this class. It is suited for this purpose because it is open source, we can examine its code, and we can write modules for the kernel.

Rather than installing Linux on your computer as one of your primary operating systems, you can install it in a virtual machine. This means it can run as a program within your current operating system. This way you can play around with it and even crash it without having to reboot your computer.

Even if you already run Linux on your computer you need to install Linux in a VM to use for certain assignments in this class.

Choosing a Distribution

There are many Linux distributions and all have their advantages and disadvantages. You may pick any one you choose, or try out more than one.

Ubuntu very popular and it is easy to get up and running. However it is also a large download and will take up a decent amount of space (~10 GB) on your computer. It can also be annoying to tinker with.

Debian (on which Ubuntu is based) is a smaller download and will suite the needs of this class but it has a little bit more of a learning curve than Ubuntu.

Other popular distributions include Linux Mint, Fedora, and CentOS.

Do not get too bogged down in your choice of distribution, as any functioning Linux distribution should work for this class. Whichever distribution you choose, go to the web site and download an ISO of the latest stable desktop release.

Installing VirtualBox

VirtualBox allows you to run virtual machines in OS X, Windows, Linux, and Solaris.

Download and install the appropriate version for your platform.

Creating a virtual machine

Open up VirtualBox and make a new VM like so:

You should now be ready to power on the VM.

Installing Linux

Now you can install Linux.

Now you can walk through the installer of whatever distribution you chose. Most are pretty straightforward. VMs are easily disposable, so if you screw it up or want to change it you can simply reinstall in a new VM.

Note that you DO want to select format or erase entire hard drive in the installer. This will format the virtual hard drive, not your actual hard drive.

Once installation is complete, you will need to reboot the VM.

VirtualBox Guest Additions

To take full advantage of your VM you should install VirtualBox guest additions. This is pretty straightforward in Ubuntu. In the VirtualBox menu select Devices -> Install Guest Additions CD Image. Let it download the image, insert it, and install.

Once guest additions is installed you can do things like resize the VM window and it will adjust the resolution automatically, and you can run your VM in proper fullscreen.

Finding the kernel version

The main thing that all Linux distributions have in common is that they use the Linux kernel. The kernel is the core of the operating system which interacts with hardware.

You can get the version of the Linux kernel that you are running by running this command in a terminal:

uname -r

Figure out how to launch a terminal in your VM installation and run the command.

Submission

The git-keeper repository for this assignment comes with the empty file linux_details.txt. In that file, write the name of the Linux distribution that you installed and the version of the Linux kernel that it is running. Save the file, add and commit to your local repository, and push your submission back to git-keeper.

A reminder of the git-keeper workflow, if you are working in a terminal: