Difference between revisions of "Tutorial7: Installing Linux / Live Linux / Virtualization"

From CDOT Wiki
Jump to: navigation, search
(INVESTIGATION 1: BOOTING KNOPPIX (LIVE LINUX) VIA VIRTUALBOX)
(INVESTIGATION 1: BOOTING KNOPPIX (LIVE LINUX) VIA VIRTUALBOX)
Line 153: Line 153:
 
# If prompted, click '''Scale''' to proceed.<br><br>
 
# If prompted, click '''Scale''' to proceed.<br><br>
 
# Allow '''time''' for the Knoppix Linux distribution to start. This is a '''graphical Linux distribution''' which will start-up in a desktop environment.<br><br>'''NOTE:''' You are '''NOT''' prompted for a ''username'' and ''password'' because this is a Linux Live distribution and you have been assigned a '''generic account'''.<br><br>
 
# Allow '''time''' for the Knoppix Linux distribution to start. This is a '''graphical Linux distribution''' which will start-up in a desktop environment.<br><br>'''NOTE:''' You are '''NOT''' prompted for a ''username'' and ''password'' because this is a Linux Live distribution and you have been assigned a '''generic account'''.<br><br>
# On the bottom left-hand side, click on the '''Knoppix start menu'''<br>(similar to the Windows start menu).<br><br>
+
# On the bottom left-hand side, click on the '''Knoppix start menu''' (similar to the Windows start menu).<br><br>
 
# In the start menu, select '''System Tools'''<br><br>[[Image:xterm.png|thumb|right|200px|The '''Konsole''' application will display the Bash shell to issue Linux commands.]]
 
# In the start menu, select '''System Tools'''<br><br>[[Image:xterm.png|thumb|right|200px|The '''Konsole''' application will display the Bash shell to issue Linux commands.]]
 
# In the system tools menu, scroll down and select to launch the terminal application called '''Konsole'''<br><br>'''FYI:''' To '''increase''' font size, press '''ctrl-+''' to '''reduce''' font size, press '''ctrl--'''. You can drag the Konsole terminal window from the bottom-right corner to increase the window size.<br><br>
 
# In the system tools menu, scroll down and select to launch the terminal application called '''Konsole'''<br><br>'''FYI:''' To '''increase''' font size, press '''ctrl-+''' to '''reduce''' font size, press '''ctrl--'''. You can drag the Konsole terminal window from the bottom-right corner to increase the window size.<br><br>

Revision as of 12:29, 13 February 2021

INSTALLING LINUX / LIVE LINUX / VIRTUALIZATION


Main Objectives of this Practice Tutorial

  • Download and install the VirtualBox VM software application
  • Download and install Knoppix Live in a virtual machine (via VirtualBox)


Tutorial Reference Material

Course Notes
Concepts
YouTube Videos
Course Notes: Installing Linux Knoppix Resources Instructional Videos:

KEY CONCEPTS

Installing Linux

Having a Linux system on your home computer provides access to a large selection of open source software.

Installing your own version of Linux on your notebook or desktop computer also can make it easier to practice working
in the Linux environment and learn how to perform routine Linux OS administration tasks.


Listing of Common Linux Distributions.
(Image licensed under cc)

A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that is based upon the Linux kernel and, often, a package management system. Linux users usually obtain their operating system by downloading one of the Linux distributions, which are available for a wide variety of systems ranging from embedded devices (for example, OpenWrt) and personal computers (for example, Linux Mint) to powerful supercomputers (for example, Rocks Cluster Distribution).

Reference: https://en.wikipedia.org/wiki/Linux_distribution


Steps in the Linux Installation Process:

  • Select a Linux Distribution and download a Linux Distribution Install ISO file
    to your Computer (Note: Be aware of any required Hardware Requirements for the Linux OS prior to installation.)
  • Burn an Linux Distribution CD/DVD, or USB, or use downloaded file when creating a virtual machine.
  • Once booted, the installation process transfers the live image to a disk (or flash memory) and configures the system.
  • For most distributions, the installation involves a guided graphical environment help assist with the Linux installation process.

Linux Installation Methods

Linux is the only OS on the computer
(Image licensed under cc)

Standalone Installation

  • Linux is the only OS on the computer
  • Any existing data on your hard disk will be erased


The grub boot menu to select different operating systems upon computer startup.
(Image licensed under cc)

Dual-boot / Multi-boot Installation

  • A boot menu allows the user to select the desired OS.
  • This options provides a method to access your computer if one OS fails to boot-up.
  • Most Linux distributions can access the Windows partition if your Windows OS cannot boot-up.
  • This booting method is great for troubleshooting (for example: booting into other OS to confirm that you can connect to the Internet to rule-out hardware issues.
  • It is recommended to back up important data before proceeding.
  • It is recommended to install the Linux OS last, as other operating systems may not offer a multi-boot option.


Virtualized Installation

VMware Player launch menu for Ubuntu Linux OS
(Image licensed under cc)
  • Virtualization requires a compatible processor: not all processors support that feature.
  • Most recent multi-core processors support virtualization.
  • The virtualized OS is installed and run in a window under another OS.
  • The installation can usually be accomplished from an ISO image.
  • One or more virtual machines can be run at the same time.
  • The guest OS shares hardware with the host OS and possibly other virtualized systems.
  • Special software is used to manage the entire process, referred to as the hypervisor.
  • The guest systems have network access through the host.
  • The selection of virtualization software (which allows creation and running of virtual machines) depends mainly on the host OS, although some are cross-platform. Other considerations as to virtualization software may be features, support, price and/or personal preferences.


Popular VM software for Windows and MAC include:

  • VMware
  • Oracle Virtual Box
  • KVM
  • XEN


Live Linux CD

Knoppix is a popular Live Linux CD Distribution.
(Image licensed undercc)

A live CD (also live DVD, live disc, or live operating system) is a complete bootable computer installation including operating system which runs directly from a CD-ROM or similar storage device into a computer's memory, rather than loading from a hard disk drive. A Live CD allows users to run an operating system for any purpose without installing it or making any changes to the computer's configuration. Live CDs can run on a computer without secondary storage, such as a hard disk drive, or with a corrupted hard disk drive or file system, allowing data recovery.

As CD and DVD drives have been steadily phased-out, live CDs have become less popular, being replaced by live USBs, which are equivalent systems written onto USB flash drives, which have the added benefit of having write-able storage. The functionality of a live CD is also available with a bootable live USB flash drive, or an external hard disk drive connected by USB.

Reference: https://en.wikipedia.org/wiki/Live_CD


The Knoppix Live CD is available to run on workstations at Seneca College via AppsAnywhere
or you can download and run it on your home computer as a Virtual Machine
(requires VirtualBox VM software installed on your computer).

INVESTIGATION 1: BOOTING KNOPPIX (LIVE LINUX) VIA VIRTUALBOX


In this section, you will first download and install the VirtualBox VM application on your home computer,
then you will then download the Knoppix Live Distribution VM file to your computer.


You will then launch the VirtualBox application via the VirtualBox VM application.
Once you launch the Knoppix Linux distribution, you will learn to perform a few basic operations
in the Knoppix Linux graphical Linux environment.


Perform the Following Steps:

Download page for VirtualBox VM application.
  1. Click the following link to access the Oracle Virtualbox application download website:
    https://www.virtualbox.org/wiki/Downloads https://www.virtualbox.org/wiki/Downloads]

  2. In this website, click the link corresponding to your computer's operating system
    to download to your computer.

  3. Install the downloaded Virtualbox VM application on your computer.

    NOTE: You may be required to allow authorization to run this program, select to install devices (if prompted)
    and to restart your computer after installation.

  4. Click the following link to download the zipped (compressed) Knoppix Live Distribution
    file to your computer: Knoppix Virtualbox VM

    NOTE: This file is approximately 5GB in size and might take a while to download.

  5. Open a File Manager application and navigate to directory that the Knoppix.zip file
    was downloaded (eg. Downloads).

    Knoppix VM file contained in the zipped file. Click Knoppix.vbox file to launch the Knoppix Live Linux Distribution.
  6. Unzip the downloaded zip file (In MS Windows: Right click and Select "Extract All" )

    NOTE: The contents of this zipped file should appear in another file manager window.

  7. Double-click the file called Knoppix.vbox to launch the Knoppix VM.

    NOTE: By double-clicking on this file (even if the VirtualBox application is not running)
    it will launch the VirtualBox application and launch the Knoppix virtual machine.

    If you have difficulty running Knoppix on your home machine/laptop you may ask your
    Learning Centre ULG leaders for additional help in troubleshooting why Knoppix is not working
    on your home machine/laptop.

    Knoppix Start Menu (not to be confused with YOUR host computer's start menu.
    The Knoppix Linux desktop environment has a similar look as the MS Windows desktop environment. (Image licensed undercc)
  8. If prompted, click Scale to proceed.

  9. Allow time for the Knoppix Linux distribution to start. This is a graphical Linux distribution which will start-up in a desktop environment.

    NOTE: You are NOT prompted for a username and password because this is a Linux Live distribution and you have been assigned a generic account.

  10. On the bottom left-hand side, click on the Knoppix start menu (similar to the Windows start menu).

  11. In the start menu, select System Tools

    The Konsole application will display the Bash shell to issue Linux commands.
  12. In the system tools menu, scroll down and select to launch the terminal application called Konsole

    FYI: To increase font size, press ctrl-+ to reduce font size, press ctrl--. You can drag the Konsole terminal window from the bottom-right corner to increase the window size.

  13. In the bash shell, issue the following Linux command: whoami

    What is the name of your generic Knoppix Linux Live account?

    Let's test this out by using the ssh command to connect to your Matrix account. Your Knoppix virtual machine uses your computer's main computer's operating system's connection which most likely is already connected to Seneca's Global Portal.

  14. Issue the following Linux command to connect to your Matrix account:
    ssh yourSenecaId@matrix.senecacollege.ca

  15. When prompted, enter your password (remember that password does not "echo-back").

    Were you able to connect to your Matrix account?

  16. Confirm that you are in your home directory on your Matrix account.

  17. Use a text editor (nano or vi) to create a file in your current directory called myvm.txt and enter the following text displayed below:

    This is line 1
    This is line 2
    This is line 3


  18. Save editing changes and exit the text editor.

  19. Confirm that you created this file and confirm that the contents of this file are correct.

    Let's run a shell script to check that you created the myvm.txt file (with correct fil e contents) in your home directory.

  20. Enter the following command: bash /home/murray.saul/scripts/week7-check-1

  21. If you encounter errors, make corrections and then re-run the checking script until you receive
    a congratulations message, and proceed to the next step.

    Although you will be learning to create and run shell scripts (near the end of this course)
    to automate tasks Matrix course , those scripts will only run in a command-line environment.

    On the other hand, since you are running a graphical Knoppix Linux distribution on your computer,
    you can run scripts graphically (including the use of dialog boxes for input, output, etc.).

  22. Issue the following command to download a shell script called week7-demo-1 from the Internet:
    wget https://matrix.senecacollege.ca/~murray.saul/week7-demo-1

  23. Issue the ls command to confirm that the file called week7-demo-1
    has been downloaded to your current directory.

  24. Issue the following to run this shell script:
    bash week7-demo-1

    What did you notice?

  25. Issue the following Linux command: ls -l week7-demo-1

    Notice there are NO execute permissions. That is why we have to issue the bash command
    followed by shell script name as an argument in order to run the shell script.

    Let's add execute permissions so we can run this command by name (i.e. without using the bash command).

  26. Issue the following command to add execute permissions for everyone for the week7-demo-1 file:
    chmod +x week7-demo-1

    FYI: This method is a quick method of adding execute permissions for
    the owner, same group members and others.

  27. Issue the ls -l command for this file to confirm execution permissions were properly added.

  28. Issue the following: ./week7-demo-1

    Did the shell script run?

  29. Issue the following command to terminate your Matrix session: exit

  30. Issue the Linux command: exit to close the Konsole terminal window.

  31. Use the Knoppix start menu and search for a menu item in oder to launch the firefox web-browser.

  32. In the web-browser, go to the Google website and perform a Net-search on Knoppix wiki.

  33. When finishing browsing the Knoppix WIKI, close the Firefox web-browser.

  34. Use the Knoppix start menu to select Office and then select LibreOffice - Writer
    to launch a word processor application.

  35. Create a small document and save changes to the file mydoc to your home directory,
    and exit the Libreoffice word processing document.

  36. Use the Knoppix start menu to select logout, then select shutdown to terminate your Knoppix Linux Live session.

  37. Repeat the steps to launch a new Knoppix Linux Live session.

    The LibreOffice application is the default word processor.
  38. Use the Knoppix start menu to launch a graphical file manager
    (Hint: Accessories -> File).

  39. In the file manager, search for your word processing document file that you saved on your home directory. Is there document there. If not, why?

  40. Use the Knoppix start menu to shutdown your Knoppix Linux Live session.

Work on the Linux practice questions located at the bottom of this tutorial.

LINUX PRACTICE QUESTIONS

The purpose of this section is to obtain extra practice to help with quizzes, your midterm, and your final exam.

Here is a link to the MS Word Document of ALL of the questions displayed below but with extra room to answer on the document to simulate a quiz:

https://ict.senecacollege.ca/~murray.saul/uli101/uli101_week7_practice.docx

Your instructor may take-up these questions during class. It is up to the student to attend classes in order to obtain the answers to the following questions. Your instructor will NOT provide these answers in any other form (eg. e-mail, etc).


Review Questions:

  1. Define the term Linux Distribution.
  2. List and explain two advantages of installing a Linux distribution on your home computer or laptop.
  3. List and explain two things to consider prior to installing a Linux distribution on your home computer.
  4. Explain why installing Multi-boot for Linux is useful for computer troubleshooting.
  5. Define the term Virtualization.
  6. List the steps to boot the Knoppix Linux distribution from a Workstation at Seneca College.
  7. List the steps to boot the Knoppix Linux distribution from a CD or USB from your home computer.
  8. List the home pages of the Linux distributions shown in the Linux distribution image above.