Lab 00 - VM Creation For the Course

Configuring your Lab Environment

Downloading The Required Files

  1. Download the ISO image for the latest LTS (Long-Term Support) version of Ubuntu Server.
  2. Download and install VirtualBox on your system
    • Visit https://www.virtualbox.org/ to download the latest version of VirtualBox
    • You can also download and install the matching VirtualBox Extension Pack
      • This step is optional, but is highly recommended

Configure VirtualBox

  1. (Optional, but recommended) Install VirtualBox Extension Pack
    • Select Extensions, and use the Install button to navigate to where you have downloaded the extension pack file in the previous step
      ddac6272e8cc54f52c0a5eb46a62213c.png
  2. Click on Network
    • Under the Host-only Networks tab, if a network does not exist, use the Create button to create a network
    • At the bottom of the window under the Adapter tab, select Configure Adapter Manually. This should give you an already allocated IPv4 address and network mask.
      06eb6c6b4526018ed5bd9e9e00722ff3.png
    • Click on the DHCP Server tab and check the Enable Server checkbox.
      1108162fdd7b2a4882b0a1188fca7373.png

Create a New Virtual Machine in VirtualBox

efb0d7991ec85a5955c8f7de1afbfe6b.png

Leave the rest of the settings as default, for example, the Hard Disk Type and Format should be VDI and should NOT have the Pre-allocated Full Size checked
b17a78e768f9fb3f797b046ccfb01a1a.png

Install Ubuntu Server

  1. Attach your Ubuntu Server installation ISO image file that you had downloaded earlier to the new VM Optical Drive. In the VM Settings page, click on the Optical Drive and select Choose a Disk File.... Navigate and select your Ubuntu Server ISO file.
  2. Start the VM, and it should boot from the installation media and start the setup.
  3. Follow the prompts through the installation and make sure to configure the following settings:
    • Set your username to be ubuntu, and choose a password you can remember
    • Set your hostname or Your servers name to be pc+ your student ID (for example, pc20059995)
    • Install OpenSSH Server when it is offered. You do not need to import an SSH identity.
    • Do not install any other optional software.
  4. Once the installation is complete, "remove" the optical media from your VM. The Ubuntu installer will attempt to do this automatically, and will prompt you to hit the ENTER key to reboot.

Software Updates and The server-check.sh Script

Log onto the default ubuntu account. Run the following commands to ensure your software is up to date, and ensure that the curl tool is installed (it should be by default). The curl utility will be used by the server-check.sh script as well.

# update the package lists and upgrade the software
sudo apt update
sudo apt upgrade

# make sure curl utility is installed
sudo apt install curl

# use curl to download the script to your server
sudo curl https://gorbehnare.github.io/COMP1071/server-check.sh -o /root/server-check.sh

# make the script executable
sudo chmod +x /root/server-check.sh
# update the package lists and upgrade the software
sudo apt update
sudo apt upgrade

# make sure curl utility is installed
sudo apt install curl

# use curl to download the script to your server
sudo curl https://gorbehnare.github.io/COMP1071/server-check.sh -o /root/server-check.sh

# make the script executable
sudo chmod +x /root/server-check.sh

For the next labs, in order to check your lab progress and a score, you run the script using the following format:

# Use your firstname, lastname, and student ID.
# For the -l option, N is the lab number, can check one or more labs
sudo /root/server-check.sh -l N firstname lastname studentnumber
# Use your firstname, lastname, and student ID.
# For the -l option, N is the lab number, can check one or more labs
sudo /root/server-check.sh -l N firstname lastname studentnumber

Backing Up your VM

The labs for this course are cumulative, meaning the results of one lab may affect the rest of the labs. It is important that you back up your VM after the successful completion of each lab. In case of an issue or mistake in the following labs, you can restore to a state where you had a good working machine. If you do not have a backup to restore to, you will need to start from Lab 0 and complete every lab to get back to the point where you can start your current assignment.

NOTE: In my experience, this method can be more resilient than relying only on snapshots. I have experienced issues where snapshots were corrupted and created unsolvable issues. Additionally, you can move your backup to any other medium or computer and keep your VM safe even if you lose access to your system for any reason. Do this, even if you are using snapshots, and also protect your backups.

Using Snapshots

If you are experimenting with your machine or attempting a new lab and want a quicker method of saving your system's current state, you can take a snapshot.

Grading

This lab is required, but is not graded. This lab creates the VM that you will be using for all the following labs. If you lose your VM for any reason and you do not have appropriate backups, you will have to start from doing this lab and every lab in between again, until you get to your current assignment.