Lab 3 Warnings / Debrief
Contents
Preparing for Lab 3
Purpose of Lab3
In this lab, you are going to identify potential problems such as not properly compressing VM image files when backing up VMs, or forgetting your root password. You will also learn to conserve hard disk space by learning how to compress and decompress files that are stored on your computer server. In addition, you will learn alternative methods of how to install applications (i.e. programs).
Main Objectives
- Learn to troubleshoot some common problems after installing VMs
- Create and extract archive files (tar and tar.gz)
- Install applications using various methods:
- Download, decompress and archive file from the Internet, then compile source code in order to install an application.
- Use yum utility to install software from local source programs (on DVD drive)
- Use yum utility to install software from repositories (online storage areas)
- Learn how to add repositories (online software storage areas) to install less common applications.
- Demonstrate the use of Bash Shell scripts to automate routine tasks (generate a customized software report)
Rescuing Your System
There are a few "classic problems" that students can encounter with their virtual machines and their host machine after performing lab2. Although all OPS235 students may not encounter these problems, it is good to be aware of what a potential problem may look like, and know how to solve that problem.
A few common problems are:
- I Can't boot into Graphical Mode on my c7host machine
- I Forgot My Regular User Password
- I Forgot My root Password
- I Can't Start My Virtual Machine
- I Can't start my Host machine
Troubleshooting consists of 3 basic elements:
- Asking Questions (eg. what was done recently prior to problem?)
- Eliminating what the problem IS NOT
- Tenacity and patience (ability to focus on finding the cause of the problem)
If you cannot log graphically into your machine (first 3 common problems), there is a trick to boot your system into single-user mode. This mode does not provide networking, graphics, or logging in as other regular users, but can connect to a text-based interface as the root user. This method will only work if a GRUB (Grand Unified Boot-loader) password has not been set, or that you haven't forgotten the GRUB password.
Steps to Boot into "Single-User Mode":
- Boot-up your centos1 VM. when the Grub Boot menu appears, press the letter
e
(for "edit"). - Using your arrow keys, scroll to next screen to linux16 command and type the word
single
as an argument after quiet (see diagram for reference) and then pressctrl-x
to boot. - The system should boot into text-based mode. Enter your root password.
- One thing to look at is partition space usage. Issue the command:
df -h
- If you notice 0% free space in the / partition, then there is a problem. This most likely is caused by not following steps to create a compressed copy of the VM image. If that is the case, locate the large image backup and remove it. Do NOT remove the image in /var/lib/libvirt/images directory!
- You can use the passwd command to reset your regular user password (eg.
passwd regularuserid
). You can press ctrl-c if you wish to abort (i.e. not change password). - To restart in graphical mode, simply enter the command
reboot
.
- Unfortunately, this method does not work if you forgot your root password (To reset your root password, refer to procedure below).
Steps to Reset Root's Password:
- The procedure to reset root's password is different than shown above. Press
e
at the Grub boot menu. - Using your arrow keys, move to linux16 command and replace the argument ro with the argument
rw init=/sysroot/bin/sh
(see diagram for reference) and then pressctrl-x
to boot. - The system should boot into text-based mode without prompting for root's password.
- Issue the command:
chroot /sysroot
- Issue the command:
passwd root
in order to change your root password (press ctrl-c if you wish to abort - i.e. not change password). - To restart in graphical mode, simply enter the command
reboot
.
Catastrophic Boot Problems:
- Not being able to start your c7host due to Kernel Panic or some sort of catastrophic disk failure is not as easy to fix. You might be able to boot from your Centos LIVE DVD, open a terminal and mount the partition via command line and look for possible problems (setup files like /etc/fstab). Lab5 will discuss more about mounting and the /etc/fstab file. The "worst-case scenario" would be to purchase a new hard disk, perform lab1 completely, perform lab2 to install and set-up virtualization software, then restore your VM image and xml file backups (eg. decompressing images, issuing virsh define commands for .xml files). That is why consistently performing backups of ALL of your VMS at the end of each lab is absolutely essential! You have been warned!
Common Mistakes / Warnings
- FOLLOW THE INSTRUCTIONS CAREFULLY in terms of access safe mode, or changing root's password.
- You need to be root in order to use yum utility!
- Remember to backup your VMs after you have completed lab3! Perhaps you can use that shell script to backup all VMs!
- If need to start-over, you can right-click on VM in Virtual Machine Manager, and remove (Make certain "delete files" is also selected, so you can re-use VM name).
Preparing for Lab Sign-Off
In order to properly complete your lab and move to the next lab, you must have your instructor "sign-off" on your lab
- Each "signed-off" lab (before due date) is worth 1% of your final grade.
- Signing-off on labs help to spot errors that can cause problems with future labs.
- Do you ask the instructor what to check for! Read at the bottom of the lab the requirements, and have all proof available for instructor to view at same time.
- Failing to be prepared and asking instructor what to check when assignment is mark will result in deduct of marks!
- For example, open multiple terminals with command results. If properly set-up ahead of sign-off, the process should only take instructor approx 20 seconds to sign-off your lab.
- If you do not have your lab-logbook, you MUST show your work and your lab log-book to your instructor for sign-off in the next class. This may cause a late penalty if past the required due date.