Utah Tech Logo

IT3300

DevOps virtualization

Lab 7a

Part I

In this assignment you will install a CLI version of Linux, often known as a headless version (no GUI).

Create a new VM using 1024MB RAM, 1 CPU, 16GB Hard Drive, the focal_server image. You will also create the following partitions on the machine: 6G on /, 3G on /home, 2G swap.

Follow the quick_guide instructions found here but note that any reference to bionic should read focal.

After the install is complete, ssh into the machine (remember that you may have to go through the ssh server if you are connecting from a machine outside our network).

  1. If you get a connection refused error then your OpenSSH did not install during the initial setup of your Linux server.
    • To Fix this
      • login into the machine using your VNC Viewer and run
      • sudo apt update
      • sudo apt install openssh-server.
  2. If you get a connection timeout then you probably have an ip typo or network configuration error
    • To fix this
      • login into the machine using your VNC Viewer and
      • Check your Internet connection by typing ip a.
      • View the network configuration by cat /etc/netplan/50-cloud-init.yaml. The dhcp4 argument should be false. If it is true then it means that you failed to enter the network information during install.
      • You can edit the file using sudo and vim. Download this worksheet [CLI-Network-Fix] (../files/CLI-Network-Fix.pdf)

      • If you make changes to the file you need to restart your machine
      • Complete a proper command-line shutdown sudo shutdown now
      • Log into vm.cs.dixie.edu and push the green button to restart your machine.
  3. Check you partitions with the following commands.
    • df -h | grep sda should return something like the following (the sizes do not have to be exact but around 6G on / and 3G on /home:
      • /dev/sda2 5.9G 2.4G 3.3G 43% /
      • /dev/sda3 2.9G 11M 2.8G 1% /home
    • swapon -s should return something like the following. The size does not have to be exact but must be around 2G:
      • /dev/sda4 partition 2097148 3108 -2

Part II

After you have successfully ssh’d into your VM:

Install Package

Create User

Just for fun - some more fun commands

To pass off

You must copy my key to your virtual machine. To do this, perform the following steps on your virtual machine logged in as your username - not JOE (Do not copy/paste all 6 lines at once, they must be individually entered):

    sudo bash
    wget http://cit.dixie.edu/it/3100/sources/install_key.bash
    chmod +x ./install_key.bash
    ./install_key.bash
    rm ./install_key.bash
    exit

The grading script will be run as you are logged into scratch. The command you will execute will be similar for all of your assignments that have an autograder. Here is a sample of the command you will run: run_grader.py --n 2 --ip 1.2.3.4. The 2 is representative of lab2. (Lab 3 would replace the 2 with a 3). NOTE you will pass in the ip address of your virtual machine that you have created. You will see some feedback. You should make sure that all your tests pass and that your score is correctly recorded. Please see your instructor for any help or questions on the output.