163
edits
Changes
no edit summary
[[Category:OPS335]][[Category:OPS335 Labs]]
== Objectives OBJECTIVE & PREPARATION ==*Install your host machine (Centos 7)*Install 3 virtual machines (VMs) (Fedora 22 - Server)*Prepare for lab exercises.
=== Installation instructions for Centos 7 Required materials ===#Download a copy of the Centos 7 installation DVD (64 bit edition) from the Centos web site or belmont. Note: we'll be using the 64 bit version of Centos because all of our lab computers are equiped with Intel 64 bit mainboards and CPUs. We'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 ISO and install directly from it.#* '''Seneca's mirror of Centos:''' http://belmont.senecacollege.ca/pub/centos/7/isos/x86_64/CentOS-7-x86_64-Full Installation DVD-1511.iso<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 />#* '''Centos mirror list One Solid State Drive (available from any Internet connectionSSD), mininmum capacity:''' https://www.centos.org/download/mirrors/ 240 GB (version: '''7USB 3.2.1511'''0)<br />#Insert your HDD into the docking bay of a PC in the lab and boot the computer using your installation 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. #Most modification It is now perform through strongly advised you dedicate a single summary screen. Use it to customize your installation following these guidelines:#*Set Date & Time#*'''Turn on networking''' and use '''your Seneca ID''' as the '''hostname'''.#*Under software selection, choose '''Server with gui''', and ensure you enable the software package '''KDE''' (located on the right-hand-side).#*For installation destination, select your drive (not the one internal to the PC), and select the option to manually configure partitioning.#**Delete any old partitions.#**Click the link to '''create partitions automatically''' (for this will give a typical layout with /, /boot, /boot/efi, /home, etc).#**Free up space by shrinking the '''/home''' partition. Since your machine will have far fewer users and more virtual machines than a typical installation, we will need that space elsewhere.#**Create a new logical volume for '''/var/lib/libvirt/images''' and give it the space made available by shrinking /home (You will need enough space for 6 virtual machines at 8GB each). You may wish to keep some extra space left unassigned in case you need some space later, but the majority of the space you will need will be for ''/var/lib/libvirt/images''.#**Make certain that the existing partitions have the file system type '''ext4''' (not xfs).#During the installation process you will also have the opportunity to create users.#*set the root password#*create a '''user account''' named with '''your Seneca ID'''#After completing the installation, remove the DVD and reboot from your HDDcourse only.
=== Online Resources===
==INVESTIGATION 1: HOST INSTALLATION== === Installation instructions for CentOS 7 ===#Login as It may be advisable to obtain the <u>latest version</u> of the CentOS 7 Full Installation DVD since there may be improvements since the user last version from when you created took OPS235.<br><br># Download and open burn on a DVD a terminal windowcopy of the CentOS 7 installation DVD (64 bit edition) from the CentOS web site or the Belmont server. Then use <br>'''Note:'''suwe' to become root ll be using the 64 bit version of CentOS because all of our lab computers are equipped with Intel 64 bit mainboards and CPUs, and run any computer you bought in the last few years for yourself will be 64bit as well.<br><br>#* '''Seneca's mirror of CentOS:''yum update' commandhttps://mirror.senecacollege. Reboot after all updates have completedca/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-2009. Now that your system iso <br>This is up to datevery fast, again login using your learnid and do 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 following:Open Lab.)<br><br>#*Verify that your system date and time are correct'''Outside Seneca College link (available from any Internet connection):<br>''' https://mirror.netflash.net/centos/7.9. If not then set the correct system date and time2009/isos/x86_64/CentOS-7-x86_64-DVD-2009.iso<br /><br>#*Verify that You need to refer to your OPS235 notes in order to install your network host machine.<br>Here is functioninga direct link:<br> [https://wiki.cdot.senecacollege.ca/wiki/OPS245_Lab_1 OPS245 - Lab1] <ol><li value=4>Customize your installation following these guidelines:#**If <ul><li>'''Turn on networking''' and use '''host''' as the '''hostname'''.<li>Under software selection, choose '''Gnome desktop'''.<li>The partition setup is similar to what you do not have an ip address, edit had in OPS235:<ul><li>Delete any old partitions.<li>Select the line in either hard disk and indicate "I will configure partitions" and click done.<li>Click the file link to '''create them (partitions) automatically'''(this will give a typical layout with /, /boot, /boot/efi, /home, etc).<li>Free up at least '''100GB''' of disk space by shrinking the '''/sysconfighome''' partition (At least '''40 GB''' for root (/network-scripts) and '''40GB''' for /ifcfg-eno1home). Since your machine will have far fewer users and more virtual machines than a typical installation, we will need that space elsewhere.<li>Create a new logical volume for ''' or /var/lib/libvirt/images'''and give it the space made available by shrinking /home (You will need enough space for up to 10 virtual machines at 8GB each plus room to compress/etcextract images).<li>Make certain that the existing partitions '''except swap, /sysconfigboot and /network-scriptsboot/ifcfg-eth0efi''' have the file system type '''ext4''' (note this file name may differ between machinesnot xfs). onboot=no</ul></ul><li>After the installation starts you will also have the opportunity to create users.<ul>:should be:<li>Set the root password <li>Create a '''user account'''onboot=yesnamed with '''your MySeneca ID'''</ul></ol><br> === First boot === # In the current version of CentOS the first time you boot your system a graphical licence prompt comes up.<br><br><ol><li value="2">Log in and check that you have access to the internet. If you had don't - you need to get the network interface to change that, reboot come up on boot. Edit the appropriate config file and configure your machine before continuingmain network interface to come up at boot.</liul><li>Run and record You can then use the purpose and output after issuing the following '''ifup'''/'''ifdown''' commands:to reset your network configuration or you can just reboot.</li></olul></li><li> Make certain that '''df -hTSELinux''' is '''cat /etc/fstabenforcing'''for security reasons (this should be the default). To make it ''enforcing'', simply edit the '''cat /etc/issueselinux/config'''file and follow the instructions inside. {{Admon/important |SELinux in Andrew's sections|If you're in one of Andrew'uname s sections -aplease disable SELinux (i.e. do the opposite of the bullet above). This will give you some extra freedom in the rest of the course to learn and experiment without being bogged down by inexplicable permission denied errors.}}</li><li>Install all updates using the '''yum update'''command.</li></ol><br>
===Using iptables===
The most recent variants of Centos and Fedora are using a service called '''firewalld''' that is intended to replace '''iptables''', however the ''iptables'' service is still in relatively common usage. In this course we will keep running concentrate on ''iptables'' .<ol><li>Disable firewalld:<source>systemctl disable firewalldsystemctl stop firewalld</source></ol><ol><li value="2">Install and enable the IPTables services:<source>yum install iptables-servicessystemctl enable iptablessystemctl start iptables</source></ol>At this point you have a basic Centos system 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. '''Record steps, commands, and your observations in INVESTIGATION 1 in your OPS235 lab log-book''' ==INVESTIGATION 2: VIRTUAL MACHINE INSTALLATION== ===Configuring a VM host=== # You will need to install some software to allow your machine to act as a host for virtual machines. We'll be using the same '''libvirt''' and '''virt-manager''' you used in [https://wiki.cdot.senecacollege.ca/wiki/OPS235_Lab_2 OPS235 - Lab2].<br>You may find it helpful to refer back to the '''OPS235 notes''' to perform the following operations:#* Install the required virtualization software#* Start and enable the virtualization service#* Reboot your host machine<br><br># Start the graphical virtual machine manager (''virt-manager''). Do this as you regular user, and gain experience with the new service don't run virt-manager from a terminal where you're logged in as root.# We will be creating our own virtual network. A default virtual network has been created for you, but you will be using a <u>custom</u> one in this course.#* Right click '''localhost (firewalldQEMU) ''' and select '''Details'''.#* Click on the virtual machines'''Virtual Networks''' tab.#install * Stop and enable iptablesdelete the '''default''' network. #* Use the '''yum install iptables-servicesplus sign'''to add a new virtual network using the following options: #:* Name your virtual network '''systemctl enable iptablesops235'''#:* Use the '''last two digits of your student number for the third octet of network IP address''' (for example, if your student number is 000-000-0<olb>90<li value="2"/b>disable firewalld by issuing , the command:network address would be 192.168.<brb>90</lib><.0/ol>24.#:* Ensure the DHCP range will allow you to assign '''at least 10 static IP addresses outside it''' (note: leave the low numbers available for static addresses).#:* Choose '''Forwarding to physical network''' radio button, '''Destination: Any physical device''' and '''Mode: NAT''' #:* Ensure the network is '''systemctl disable firewalldstarted at boot'''. <br>
<ol><li value="3">Since you will be installing a Linux <u>server</u> (as opposed to a Gnome Desktop workstation), you can '''Record steps, commands, use the <u>default</u> memory and your observations in Part A in your OPS335 CPU options for use with lab log-bookcomputers'''.</li><li>Set the disk image size set to '''8GB'''<br><br>Note: Since you already setup your virtual network to OPS335, your VM will be automatically connected to your new ops335 virtual network.<br><br></li><li>Note the following installation steps when you install your created VM:</li></ol>
::* Select the correct ''location / Time Zone''.
::* For Software Selection: Accept the default '''minimum install'''. None of your VMs in this course will have a GUI since GUIs needlessly consume resources and image space. <ol><li>Click '''Installation Destination''', and then click '''Done''' to confirm that an '''automatic install''' will be performed.</li><li>Click Network & Hostname and set hostname to: '''vm1.localdomain''' and make certain the ''Ethernet connection'' is set to '''ON'''.</li><li>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.</li></ol>
===First Boot===
#You will notice that the server installation defaults to a command-line interface. This is normal, and we will only be using this interface during this course.
#Ensure your machine has a network connection by running the command
'''host cbcssh your_seneca_id@matrix.senecacollege.ca'''<ol><li value="3">If that did not work, edit the line in the file '''/etc/sysconfig/network-scripts/ifcfg-eno1''' or '''/etc/sysconfigmake sure GlobalProtect VPN is installed on your Windows/Mac and connected. If it is, ensure your CentOS network-scripts/ifcfg-eth0''' interface is started automatically on boot.</li></ol> {{Admon/tip|Default for network config for onboot=no:should |If you've turned on your networking interface during installation - it will be '''onboot=yes''turned on by default. If you've left the network interface off during the installation - it will be off by default.}}<ol><li value="4">If you had to change that, reboot your machine.</li><li>Once you have a working connection - update your machine (this may take a while).</li></ol>
'''yum update'''
<ol><li value="65">Reboot Install the virtual machine once '''bind-utils''' package. The commands it is updatedprovides (e.g. nslookup) will be useful in troubleshooting your network connection.</li><li>If your virtual machine hangs on boot, you will need You may also want to change a graphics option:<ul><li>While install the VM is off'''nmap''', click on 'View' (from the menu at the top of the VM window), 'telnet''' and select 'Details''net-tools''' packages to help you troubleshoot connectivity issues.</li><li>From the menu on the left sideConfigure '''firewalld, select iptables'Display'.</li><li>Change the drop-down list for Type from 'VNCand (if required) '' to 'SpiceSELinux', and click apply.</li><li>Switch the view back to 'Console' and start the machine again.</li><li>Now run same way you did for the following commands and note the outputhost.</li><li>Issue Reboot the commands below and note in your lab logbook how they differ from the Centos installation on your hostvirtual machine once it is updated.</li></ul></li></ol> '''df -hT''' '''cat /etc/fstab''' '''cat /etc/issue''' '''uname -a'''
===Cloning a Virtual Machine===
You may choose to:
* Submit screenshots of your work on Blackboard, in which case you don't need to come to the lab.
* Or come to the lab, show me your work, and talk to me about it. I want to hear what you've learned and answer any questions you have.
You'''Record steps, commands, and your observations in Part B in ll get the same grade regardless of how you choose to submit your OPS335 lab log-book'''work.
Expected results of this lab are:
::<span style="color:green;font-size:1.5em;">✓</span> Host Machine installed::<span style= Completing the Lab ==Upon completion of this lab you should have 4 installed machines"color:green;font-size:1. One machine running Centos 7 and acting as a host and gateway for three 5em;">✓</span> 3 virtual machines running Fedora 22 Serverinstalled::<span style="color:green;font-size:1. 5em;">✓</span> Each machine must have (host and VM) has access to the network (for example, to get updates) and be able ping ::<span style="color:green;font-size:1.5em;">✓</span> Lab logbook completed::<span style="color:green;font-size:1.5em;">✓</span> Run the others'''labcheck_install.sh''' shell script on your host machine-->
#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 the /boot file system on your host?
#What file was edited to change the host name on your VM's?#Explain Are there other ways to change the iptables rules displayed when you ran the command 'iptables -t nat -L'. How did they change after creating your personal network.hostname?