932
edits
Changes
Updating lab for winter 2014. Main host now using Centos 6.5, VMs using Fedora 20.
= Installation of Fedora 17 Centos 6.5 =
[[Category:OPS335]][[Category:OPS335 Labs]]
== Objectives ==
== Required materials ==
==Part A: Host Installation == === Installation instructions ===* #Download a copy of Fedora 17 Live CD the Centos 6.5 installation DVD (64 bit edition ) from the Fedora Project Centos web site or burn the CD DVD using Seneca's Freedom Toaster which is located in the Open Lab on the 2nd floor of the TEL building. Note: we'll be using the 64 bit version of Fedora otherwise known as x86_64 Fedora Centos because all of our lab computers are equiped with Intel 64 bit mainboards and CPUs. Also, weWe'll also be using a Fedora iso for installing the virtual machines, but you will not need to burn that to a disc. It is faster to download the Live CD for installation because it's much simpiler ISO and quicker to install a basic Fedora Linux system on a hard drivedirectly from it. Finally, if you're going to burn your CD DVD using the Freedom Toaster then be sure to use a blank CDDVD-R diskdisc. For some reason CDDVD+R disks discs sometimes fail to burn successfully.::#* '''Seneca's mirror of the Fedora projectCentos:''' http://belmont.senecac.on.ca/fedora/releases/17/Live/x86_64/Fedora-17-x86_64-Live-Desktop.iso centos <br />(This is very fast, but is only accessible from within Seneca's network - you can't access this from home. You can burn this disc on the machines in the Open Lab.)<br /><br />::#* '''Main Fedora RepositoryCentos mirror list:''' http://mirrorsisoredirect.fedoraprojectcentos.org/publiclistcentos/Fedora6/isos/17x86_64/<br />(Accessible from any Internet connection.)<br /><br />#Insert your HDD into the docking bay of a PC in the lab and boot the computer using your Fedora Live CDinstallation DVD. If possible try to use the same PC for this course for the rest of the semester. Some PCs may be configured with slight hardware variations from others which may cause problems when moving your HDD from one system to another. #Once Fedora has loaded, start Firefox and ensure the network is functioning. You will need to authenticate yourself with your LEARN user name and password before Internet access is allowed to the outside world. #Open a terminal window, switch to root using 'su' and use the 'ifconfig' command to view your assigned IP address. #Still in the terminal window use the 'fdisk -l' command to ensure your HDD is available for use.#If you're satisfied that your Fedora Live system is functioning properly, double click on the INSTALL icon to begin the installation of Fedora 17 onto your HDD. --#Perform your installation following these guidelines:
#*wherever possible select the default options
#*set your hostname to your learn ID.
#*set Toronto as your time zone
#*let Fedora configure your whole diskWhen given the option, click 'review and modify partition layout'. A typical installation devotes most of the available space to a logical volume for /home. You will have very fewer users and more virtual machines than a typical installation. Reduce the size of lv_home (minimum 10GB), and create a new logical volume for /var (called lv_var) and give it the space made available by shrinking lv_home (You will need enough space for 6 virtual machines at 8GB each).
#*set the root password
#After completing the installation, remove the Live CD DVD and reboot from your HDD.
{{Admon/tip|Tip: Boot Menu|If you got the boot failure message, restart the computer and press [F10] to get to the boot menu, select the Hard Disk as boot device and continue. }}
=== Booting your system ===
#create a user named with your learn ID
#Login as the user you created and open a terminal window. Then use 'su' to become root and run the 'yum update' command. Logout when done. Note, you may have to reboot after all updates have completed. Now that your system is up to date, again login using your learnid and do the following:
#*Run and record the output of the 'cat /etc/issue' command.
#*Run and record the output of the 'uname -a' command.
===Configuring a Linux Gateway===At this point you have a basic Fedora 17 Centos 6.5 installed and updated. This will serve as a host for the virtual machines where you will do the majority of the work in this course. All the rest of our labs will assume you have this basic system running. If, for any reason, your system becomes corrupted during the semester, you'll have to redo this lab to be able to continue with the remaining uncompleted labs. You are responsible for YOUR system. If you do not perform back-ups you have taken this risk on yourself. Poor planning on your part does not constitute an emergency for anyone else. *You will need to install some software to allow your machine to act as a host for virtual machines yum groupinstall virtualization yum install virt-manager libvirt*Start and enable the virtualization service service libvirtd start chkconfig libvirtd on*Note that when starting libvirtd you may receive a warning 'virGetHostname: getaddrinfo failed for "Machine Name": Name or service not known. This will not interfere with your machines.*Reboot your machine. If you do not, you will not be able to install any virtual machines.*Start the graphical virtual machine manager**You will need to enter your root password.*Create your own virtual network.**A default one has been created for you, but you will be using a custom one in this course.#Right click 'localhost (QEMU)' and select 'Details'. Click on the 'Virtual Networks' tab.#Stop and delete the 'default' network.#Use the plus sign to add a new virtual network using the following options.#*Name your virtual network 'ops335'#*Use the last two digits of your student number for the third octet of network IP address. Example, if your student number is 000-000-0<b>90</b>, the network address would be 192.168.<b>90</b>.0/24.#*Ensure the DHCP range will allow you to assign at least 3 static IP addresses outside it.#*Choose 'Forwarding to physical network' radio button, 'Destination: Any physical device' and 'Mode: NAT'#*Ensure the network is started at boot.#Once completed open a terminal and observe and record the output of the following command: iptables -t nat -L ==Part B: Virtual Machine Installation ==With the virtualization software installed and your personal network created, you are now ready to create your first virtual machine. If you have an installation DVD for Fedora you can use that, but it will be much faster to download the iso from belmont and install directly from it.TODO: UPDATE LINK TO FEDORA 20 wget http://belmont.senecac.on.ca/fedora/releases/17/Live/x86_64/Fedora-17-x86_64-Live-Desktop.iso or wget http://belmont.senecac.on.ca/fedora/releases/17/Live/x86_64/Fedora-17-x86_64-Live-KDE.iso===Installation===*Click on the icon "Create a new virtual machine" to begin.*Name your machine "f20-vm01" and choose your installation method - "Local install media". Choose the desired option to install from either the CD or iso. For "OS type" select "Linux" and for Version select "Fedora 18" (if there is no option for Fedora 20) then click on the "Forward" button.*Use the default memory and CPU options for use with lab computers (Depending on available hardware these settings can be adjusted). Then click on the "Forward" button to proceed.*Leave the disk image size set at 8GB, ensure "Allocate entire disk now" is checked, then click on the "Forward" button.*At the "Ready to begin installation" window click on 'Advanced options' arrow to review available options.**Select the Virtual Network named 'ops335'. Make note of any other available options (you will need them again in the assignments).*Select 'Install to Hard Drive' to begin your Fedora installation. Select the appropriate default options (You may wish to review your OPS235 notes to remind yourself what these are).*During installation you will be prompted to set the root password and an initial user account. For the initial user, enter the same information you entered on your host machine.*Set your hostname to "vm01.localdomain".{{Admon/important|Firstboot - First user created|For successful completion of the labs, please ensure the first user created is named using your Learn ID.}}===First Boot===*Ensure your machine has a network connection by running the command host cbc.caIf that did not work, edit the line in /etc/sysconfig/network-scripts/ifcfg-eth0 onboot=noshould be onboot=yes*Update your machine (this may take a while). yum update*Reboot the virtual machine once it is updated.*Now run the following commands and note the output. Note how they differ from the Centos installation on your host. df -hT cat /etc/fstab cat /etc/issue uname -a===Minimizing your VM's footprint===*Since all VMs used in this course are intended to be servers, the presence of a GUI in not recommended - servers are typically managed from the command line.* Make it boot by default to the command line only**Fedora 17 and onward do not use '/etc/inittab' to set the default run level but rather use targets as a more flexible replacement. Note the output of the following command: ll /etc/systemd/system/*.target lrwxrwxrwx. 1 root root 36 Dec 3 09:35 /etc/systemd/system/default.target -> /lib/systemd/system/runlevel5.targetand ll /lib/systemd/system/*.targetSystemd uses symbolic links to point to the default runlevel in use. To change the default runlevel you must first remove the existing symlink. rm /etc/systemd/system/default.targetTo change your system to boot in multi-user mode by default: ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.targetMake note of the command that would be needed to change the default 'runlevel' (or 'target' as it is now referred to when using systemd) to graphical or runlevel 5.Test your VM to make sure that it boots correctly before moving on to the next step. ===Managing a Service===*Before you start, if you are more familiar with the chkconfig or service commands, you may wish to review the [http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet SysVinit to Systemd Cheatsheet].*You will want to be able to communicate with your machines using ssh.**Check the ip address of the virtual machine ip address show**Start the ssh service on the virtual machine. Also set the service to start automatically when the machine boots.**Use ssh to connect from your host to the virtual machine.***You will be prompted to store the virtual machine's identification. Choose yes (we will cover this in more detail later).**Reboot the virtual machine and check the status of your ssh service. ===Cloning a Virtual Machine===*Now that you have one virtual machine working, you will create two more. If you struggled with the previous steps, repeat them to create to more virtual machines (naming them f20-vm02 and f20-vm03, with hostnames vm02.localdomain and vm03.localdomain respectively).*If you are confident with what you have done so far, you may clone your existing machine to create the others.**To quickly create additional VM's shutdown 'f20-vm01', right click and select 'Clone...'. Use the following options:*Name: f20-vm02*Storage:**Click the drop down menu below 'f20-vm01.img', choose details and rename the image to the f20-vm02.img**Once successfully created boot the new VM and correct the host name. This can be done using the GUI or command line. **Record in your notes how each is done.**Check for connectivity. host cbc.ca**After creating f20-vm02 repeat the above steps to create f20-vm03 and correct the host name.
== Completing the Lab ==
Upon completion of this lab you should have 4 installed machines. One machine running Centos 6.5 and acting as a host and gateway for three virtual machines running Fedora 20. Make sure that each machine can access the network (for example, to get updates) and that you can ssh from your host to your VMs, and between your VMs.
Record the following answers in your logbook.
#What is the code name of this your installed Fedora Linux system? How did you determine this?#What kernel release is your host system running?#What kernel release are your virtual machines running?
#What is the UUID (Universally Unique Identifier) of your root file system? What command was used to obtain this information?
#What is the size and type of your the /boot file systemon your host?#What is file was edited to change the expected release date of host name on your VM's?#How are ping and ssh affected (on both machines) when you run the following command on the host machine?#*echo 0 > /proc/sys/net/ipv4/ip_forward#*When changing the next version of Fedoradefault target on your VMs to multiuser, you used two commands. What option can be added to reduce this to a single command?