CSCI251 - Systems and Networks
Lab2 - Operating System Installation
Wednesday Jan 20, 2009
- The assignment is to be completed by the end of the lab session and shown to the instructor.
The computer assigned to you for this course has been set up
specially for CSCI 251 labs. You do not have superuser (aka 'root')
privileges on the machine as thses machines are be used by other users
for other work and the risks associated with giving
such privileges are too high. However, for many of the assignments in
CSCI 251 the students will need that highly privileged access to the
The solution to this problem is to use an operating system
within a virtualized environment. In that virtualized OS the student
has complete privileges. There are
various virtualization implementations available and we have chosen
VirtualBox, which was developed by Innotek. Sun Microsystems has
recently purchased Innotek and now supports VirtualBox and will keep it
as free, open software.
will find a special partition on the hard disk mounted as
/<username> for which you have full access. You will use
this partition to store all the files that have to do with the virtual
machine you will set up.
The VirtualBox environment is already present on OS251. In this lab,
install a minimal Debian Gnu/Linux within that virtualized environment.
Our terminology will be
You will have superuser privileges for lenny, but not for OS251. You will
have your ordinary user account on OS251 and another on lenny.
- OS251 is the host OS - which, for convenience, we'll call 'OS251'
or the 'host'
- the minimal Debian Gnu/Linux is the (virtualized) guest OS -
which we'll call 'lenny' or the 'guest'
Why install a minimal guest?
It won't even have X Windows (the GUI)! We
could actually install a fully featured Linux. The main reason for this is
that we can learn much more by starting from a minimal system. For
example, we'll eventually install X Windows. Another reason is that we
avoid getting a really bloated system.
How VirtualBox Operates
A typical PC operating system uses a hard drive (or equivalent) and
RAM. The guest will use a 'hard drive image' stored within the OS251
system and a portion of the available RAM. You will use the directory
/<username> to store that hard disk
In passing, we note that VirtualBox can be installed on a a variety of
OS's other than Linux. Similarly, the guest OS installed into that
virtual environment need not be Linux. This is a developer's dream. It
is, however, X86 specific. For this course, virtualization is not the
focus, just a handy tool; we are sticking with Linux for the host and
Task #1: Download the Debian installation CD image
- First of all, login to your machine using your ordinary lab account.
- Download the Debian 'netinst' CD image from here
and save it in /<username> directory. This is the image of a
single CD containing just the minimal amount of software to start a
Debian installation and fetch the remaining packages over the Internet.
(Typically you would burn this to a CD-ROM and use it to boot the
machine. But here we will skip the burning part.)
there may be errors during transmission, it is important to check
the md5 checksum using md5sum program and compare with the one on
Task #2: Set up Vbox parameters for the virtual machineThese steps precede the actual installation of the guest. Their purpose
is to set up an identity for the virtual machine and to set up a hard disk and other 'hardware' for it.
now have a machine identified as 'lenny' with 256MB RAM and 8GB. You
should see a new entry on the left panel of the VirtualBox OSE window
with the machine status shown as 'Powered off'.
- Start VirtualBox OSE
- Click New. This will open the 'Create Virtual Machine' wizard.
- Give the name lenny; select OS Linux and Version Debian
- Select amount of memory as 256MB
- Select 'Boot Hard Disk' and 'Create new hard disk'
the 'Create New Virtual Disk Wizard' select 'Dynamically expanding
storage ' and select the location '/<username>' by browsing. Select the default 8GB size for the disk. Give
name 'lenny' (file lenny.vdi), save and finish.
- Finish 'Create Virtual Machine' wizard
Task #3: Install Debian on the virtual machineNow
we will 'insert our CD' into our virtual machine and power it on.
'Inserting the CD' can be done in one of the following two ways:
We will use the second method to save a CD-ROM.
- use the CD drive on the host machine and physically insert a CD
- attach an iso image to the CD drive
From here on, the installation process is identical to one done on a physical machine.
'File -> Virtual Media Manager'. Go to the 'CD/DVD Images' and 'Add'
the Debian netinst iso to the list and click 'Ok'.
'Settings' and then 'CD/DVD-ROM'. Check the 'Mount CD/DVD Drive' box
and also the 'ISO Image File' button. Make sure the correct iso image
has been selected. Now the 'virtual machine has the Debian netinst CD
in its CD drive'.
- To power up the machine, double click on the 'lenny' icon.
- Read and confirm the default VirtualBox settings until you come to the Debian installation screen.
The installer will now scan the CD drive and load necessary software and drivers, including the one for the network card.
- Select 'Install'
- Select 'English' as the language
- Select 'Canada' as the country
- Select 'American English' as the keymap to use
Now the installer will take you to the disk partitioning step.
- Give 'lenny' as the hostname
- Accept the domain name 'mala.bc.ca'
- (You may have to cancel the installer's attempt to access a time server)
- Select 'Pacific' as the time zone
partition table is now written to the hard drive and filesystems are
created. After that, the installer starts installing the base system.
This will take a few minutes to complete. When it prompts:
- Select 'Guided - use entire disk' as we will use the whole 8GB disk we prepared for this (virtual) machine.
'Separate /home, /usr, /var, and /tmp partitions'. See how the
installer choses partition types (primary, logical), sizes. Also note
the swap partition.
- Select 'Finish partitioning and write changes to disk'. Confim your choice by selecting 'Yes'.
Now the installer is ready to access the Internet to get the rest of the files. It wants to know from where to get the files.
- enter a password for the root user, confirm
- enter your name, select a username if you want a different one than the suggesed
- enter a password for the user, confirm
At this point the 'Software Selection' screen will appear.
- Select 'Canada' for the Debian archive mirror country.
- Accept the default mirror (or select another one).
- Leave blank for HTTP proxy information.
- Say either 'Yes' or 'No' for the participation in popularity contest.
is now complete. The installer will ask you to remove the CD-ROM. For
that , you will select 'Devices -> Unmount CD/DVD-ROM' from the menu
bar and then select 'Continue'. The CD is now 'ejected' and the machine
should boot from the hard disk.
- Choose 'Standard system' (default). Once selected this will take a few minutes to complete.
- Answer 'Yes' to the question 'Install the GRUB boot loader to the master boot record?'
When the login prompt appears, login as user. Try out your system. The instructor might suggest a few commands to run.
Task #4: Show your workShow the running system to the instructor. Once he's satisfied, make sure he enters
that fact in his record for this lab.
Before you logout from the host machine, make sure you shutdown the virtual machine by running
shutdown -h now
as root user.