IST346: LabLast Update: 1/22/2010 4:36 PM

L02Operating System and Networking Basics

Overview

This lab will introduce and demonstrate the key components of modern computer operating systems. Throughout the lab we will discover the similarities and differences among the Windows and Linux operating systems.

Learning Objectives

Upon completion of this lab, you should be able to

  • Recall the key components of modern-day operating systems and demonstrate those components by example.
  • Appraise similarities and differences among the Windows and Linux operating systems.
  • Understand the advantages and disadvantages of a CLI (command-line interface) and GUI (graphical user interface).
  • Execute shell commands from the command line to perform basic operating systems tasks.
  • Learn some networking basics and how to create and manage a virtual network.

Lab Breakdown

This lab consists of 4 parts:

  1. A walk-through demonstration of CLI and GUI operating systems shells.
  2. Understanding operating systems basics and the key components of all operating systems.
  3. Networking basics. Understanding TCP/IP and how computers communicate with each other via the network.
  4. On your own. Execute various commands on the Linux and Windows operating systems.

Requirements

Before you start this lab you will need each of the following items:

  1. Your PSD (Portable Storage Device) connected to a lab computer, or a computer running VMware Server 1.09 / VMware Workstation 6.X.
  2. These virtual machines, from the VM Garden, on your PSD:
  3. Centos5 (Centos Linux 5)
  4. Vista1 (Windows Vista)
  5. Vyatta(The NAT/Router/Gateway to the Internet)

Note: If you don’t have these, you will have to download them using the vmgetutility. If you need a refresher course, please watch the screencasts at

  1. All all three of the virtual machines from above added to your inventory on the Vmware server console, as seen in the following screenshot:

/ Note: you can add these virtual machines to Vmware by double-clicking on the shortcuts in the folder on your PHD, or you can find the
  1. Startup the Centos5 virtual machine:
  2. Double click on the shortcut inside the folder. This will open the virtual machine in VMware.
  3. Click on the power on button in VMware to start the virtual machine.
  4. When the logon prompt appears, logon as the userUser with password SU2orange!
  5. Startup the Vista1 virtual machine:
  6. Double click on the shortcut inside the folder. This will open the virtual machine in VMware.
  7. Click on the power on button in VMware to start the virtual machine.
  8. When the logon prompt appears, logon as the userroot with password SU2orange!
  9. We’ll save the vyatta virtualmachine for the end of the lab. You cn leave it powered off for now.

Part 1 – Shells: Command Line .vs. Graphical

Important!Please complete the requirements from above before starting this lab.

What is a Shell?

A shell is the component of the Operating System that provides a user interface. You tell the operating what you’d like it to do by communicating with it through the shell. There are two basic types of shells:

  • Command line Interface (CLI). This type of shell presents you with a simple prompt. To make the operating system do something, you simply type the command at the prompt. This is a simple concept, but to be effective you must know which command to type! CLI shells have a steep learning curve but are the best shells to use for automating tasks and mastering control of the inner workings of the operating system.
    Getting IP Information from the Windows Command Prompt:
  • Graphical User Interface (GUI). This shell usesvisual metaphors to represent the operating system commands. The traditional GUI uses the WIMP metaphor – Windows, Icons, MenusPointers. Well developed GUI’s are easier to learn then their CLI counterparts, but are often “feature incomplete” (not every function is implemented via the GUI) and impossible to automate.

Getting similar IP information from the Windows Graphical Shell

Which shell is better?

Neither the GUI nor CLI is better than the other and modern day operating systems are equipped with both shells. The GUI Shell softens the learning curve and helps you deal with running several simultaneous tasks; while the CLI Shell helps you master the OS innards and automate a series of commands. Most power users are comfortable with the command-line; it gives you the most freedom and flexibility for expressing your needs to the operating system.

The Windows Shells

By default the Windows operating systems Load the GUI shell Windows Explorer (Later names Vista Shell). This is the de-facto standard Windows Shell.

There are two main command-line shells for windows. First is Cmd.exe, a legacy shell from the pre-windows days, and a newer, and second a modernized shell known as WindowsPower shell. The future of the Windows CLI is Power Shell and it represents a major upgrade to the archaic and often poked fun at cmd.exe.

The Linux Shells

While the Windows world is very set-in stone when it comes to its shells, the open-source nature of Linux gives us many flavors of GUI and CLI shells.

The two most popular GUI shells for linux are GNOME and KDE. Our install of Centos uses GNOME.

The most popular CLI shell for Linux is Bash (borne again shell). The Bash shell is available for many Unix-like operating systems, making it easier to transport your command-line experiences to other operating systems like Solairs, FreeBSD, and even OSX!

You try it: Let’s make some shell Magic!

In yourWindowsvm:

  • To bring up the command prompt: Start  All Programs  Accessories  Command Prompt.

In yourLinuxvm:

  • To bring up the bash prompt: Applications Accessories Terminal

Important!Leave both prompts open for further commands that you’ll attempt in the next few steps.

Questions

Q1.1 what is an Operating Systems Shell?

Q1.2 what are the advantages and drawbacks of a Command-Line Shell?

Q1.3 what are the advantages and drawbacks of a Graphical Shell?

Q1.4 which shell is the better shell CLI or GUI?

Q1.5 what is the name of the primary GUI shell in Windows?

Q1.6 what are the two major GUI shells in Linux?

Part 2 – Operating systems components by example

Key components of the modern day operating system

All modern day operating systems have support for the following features, among other things.

  • Reporting CPU and Memory usage in real time.
  • Multitasking (executing more than one process at a time) and process and memory management
  • File system tasks: navigating the file system, file and folder management
  • Network Management

We will explore how the Windows and Linux operating systems approach these features in the next section.

Watch this! The Windows and Linux (bash) Command Prompts

This video will demonstrate how to get around the Windows and Linux operating systems, explain the key components of the OS and demonstrate how to issue commands to the OS.

Watch Here:

Questions

Q2.1what is the Windows equivalent of the Linux command pwd?

Q2.2 what symbol represents the current directory in Windows?

Q2.3 what is the path separator symbol in Linux?

Q2.4what Linux command displays the contents of a file?

Q2.5 what is the function of the pipe | operator?

Q2.6explain the purpose of the command more?

Part 3 – On Your Own

In this next part you will be tasked with executing various Windows and Linux commands on your own. Feel free to try them out inside your virtual machines. You may use the video from the previous section as well as this nice table of windows and linux commands to help you perform these tasks.

Questions

Q3.1 what command will display the files in the c:\windows\system32 folder.

Q3.2 there’s a lot of files in Q3.1 what is the command to show the files a page at a time?

Q3.3What is the Linux command to display the contents of the /etc/passwd file?

Q3.4 There’s a lot of entries in your answer to Q3.3. What command will locate the ftpline in the /etc/passwd file?

Part4 – Networking Basics

Hopefully at this point, you’re grasping the concepts behind operating systems virtualization and beginning to realize its benefits. Besides the coolness of running 2 (or more) different operating systems on the same computer, another really beneficial aspect of virtualization is the wide variety of ways you can simulate networks between the virtual computers.

Virtual Machines, Virtual Networks.

We live in a networked world, and many features found in today’s operating systems are unusable unless those systems are connected to a network. Just like in a computer lab where 20 computers are all connected with Ethernet cables or through a Wi-Fi access point, virtualized operating systems can connect to each other and to internet resources via virtual networking.

By default, most virtualization software, like VMware makes the task of virtual networking trivial and transparent to the user. You just “set it and forget it.” In this default mode the guest virtual machine can access then same resources as the host computer can. The fundamental the problem with this mode is each guest virtual machine lives in isolation and the guests cannot communicate with each other.(As depicted in the diagram on the left).

In most cases, isolated virtual networks are the desired configuration. However in a class like this we need to simulate enterprise networks – networks with servers and workstations inter-communicating with without interference from the outside physical network. We don’t need each guest to be in isolation; we need the entire group of guests to be in isolation. To accomplish this we need to virtualized our own network router as guest This is the purpose of the vyatta virtual machine. (Diagram on the right)

Still confused? Think of it this way: Assume 2 people share a house and all want access to the internet. The diagram on the left is like each person negotiating with the cable company and connecting their computer to their own broadband cable modem. (It’s not the way most people do it). The diagram on the right is how people usually share a connection to the internet. Each computer connects to the internal network set by the router, and then the router provides access through it to the internet.

How to configure your virtual machines to use the internal network

To configure your virtual machines to use the internal network, and route their traffic through the vyatta router:

  1. Power off the virtual machine (on Vista1,for example )
  2. Edit the virtual machine settings
  3. Click on the Ethernet device
  4. Change the network connection to VMNet9 (Host-Only)
  5. Click Ok. You now have changed the settings to the internal network.

At this time change the Vista1 and Centos5 virtual machines to use the internal network. This will be the default configuration for all of our virtual machines from this point forward.

Procedure for powering on the internal virtual network

Because the guest virtual machines now depend on the vyatta router virtual machine, you will always need to power on the vyatta virtual machine prior to starting any other virtual machines.

So, let’s try it:

  1. Power on the vyattavirtual machine. You know the router is ready when the login prompt appears (but there’s no need for you to login).
  2. Once the login prompt appears you can power on the other virtual machines.
  3. Logon to vista1 as the user User, logon to centos5 as the user root use the same password as before.
  4. Open a command prompt in the Vista1 guest, Open a bash prompt in the Centos5 guest.

Exploring the Internal Virtual Network Setup

In this part we will execute commands in the command prompts we opened to verify the virtual network setup.

In the Cenots5 virtual machine, from the Bash prompt:

  1. Type ifconfig to display the inetaddr address of the guest. If you’re in the labs, it should be 192.168.90.???where ???is most likely a number between 100 and 199.
  2. Make a note of your centos5 IP address, you’ll need it to test connectivity from the vista1 guest.
  3. The best way to verify network connectivity is with the ping command. Ping sends network packets to another computer on the network, and records information about the response. If you can ping a computer, then you know there aren’t any problems with the network between you and it. 
    In the command prompt, type ping –c 4 to ping SU’s main web server 4 times. If things are set-up correctly you should get 4 replies.

IMPORTANT: If things didn’t work for you, and you’re getting a “response timeout or 100% packet loss” error messages, power off your virtual machines are re-check your steps at the beginning of this section.

In the Vista1 virtual machine, from the command prompt:

  1. Type ipconfig(yes, that’s ipconfig, not ifconfig) to display the IPv4 address of the guest. If you’re in the labs, it should be 192.168.90.???where ???is most likely a number between 100 and 199. Also this number should be different that the number you got for centos5.
  2. Let’s try and ping the centos5 virtual machine. Type ping –n 4 192.168.90.??? (don’t type ??? but rather enter the 3 digits representing the IP address of centos5. If you get a reply, then you’ve confirmed the guests can talk to each other!
  3. Finally, in the command prompt, type ping –c 4 to ping SU’s main web server 4 times. If things are set-up correctly you should get 4 replies.

Questions

Q3.1 What is the command to display the IP address of a windows computer?

Q3.2 What is the command to display the IP address of a linux computer?

Q3.3 What is the purpose of the vyatta virtual machine?

Q3.4 Why does the vyatta virtual machine need to be started before the other guests?

Q3.5 What command can be used to test for network connectivity between two hosts?

This concludes our lab.

To avoid data loss, power off all virtual machines before disconnecting your PSD

Bonus Part –Downloading more Virtual Machines and Isos

As homework, you should download these virtual machines and ISO packages to your portable drive. By taking the time to download them now, you will get a jump-start on the remaining labs for this course.

Use the vmgetutility to download and verify you have the following virtual machines to your portable drive. (An * denotes that you may already have these.)

  • winxp1 *
  • vista1 *
  • centos5 *
  • win2008
  • vyatta *

Use the vmget utility to download and verify you have these ISO packages to your portable drive:

  • winxppro
  • vistaent
  • win2008std
  • centos5

Page 1