UPI Study › Courses › Introduction to Operating Systems › Free lessons › Lesson 10.1 Free with a free account
Virtualization Concepts
Introduction to Operating Systems · Chapter 10: Virtualization and Virtual MachinesSection 10.1 · lesson 78 of 838 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Introduction to Operating Systems.
Lesson complete
Earn the 3 college credits for Introduction to Operating Systems
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: The Benefits of Virtualization →← Antivirus SoftwareNext lesson: The Benefits of Virtualization →
A free account plays all of Chapter 1 and 3 more lessons of Introduction to Operating Systems. Create a free account →
In this lesson
How one physical computer runs several complete virtual machines.
- Define host, guest, hypervisor, and virtual hardware
- Explain why a virtual machine is not a fake or a recording
- State Popek and Goldberg's three tests for a hypervisor
- Distinguish a hypervisor from an emulator
Free study notes
Get this lesson's notes by email
The key points and 4 practice questions with answers, in your inbox. One email, free.
One email. Unsubscribe in one click.
Transcript
Everything said in the video, section by section (1,103 words). Read along, or search it.
Opening Story
A Second Computer Inside a Window
Sam, who runs a small online bakery from an old laptop, wants to try a different operating system, without wiping anything. Ivy, who looks after the computers at a school, has a simple answer: just run it inside a window. A whole second computer, with its own desktop, its own files, and its own programs, living in a window on the first one. It sounds like a magic trick, or a fake. It's neither. It's called virtualization, and it quietly runs a huge part of the internet.
Analogy
An Apartment Building of Computers
Think of an apartment building. One roof, one set of water pipes, one electric supply, and one building manager. Yet each family has its own flat, with its own front door and furniture. The family in flat 2 can't see into flat 3. And if one family floods its kitchen, the others stay dry. Virtualization does the same thing to a computer. It lets one physical machine act like several separate computers at once. Each one is a virtual machine, or VM: a complete computer made of software, with its own operating system, programs, and files.
Key Terms
Host, Guest, Hypervisor, Virtual Hardware
Four words come up in every talk about virtualization. Learn them now, and the rest of this chapter gets easy. The host is the real physical computer, plus the software that shares it out. In the last column, that's the whole building. A guest is a virtual machine and the operating system running inside it: one family in one flat. The hypervisor, also called a virtual machine monitor, creates the VMs, hands them resources, and keeps them apart. It's the building manager. And virtual hardware is the pretend processor, memory, disk, and network card that a guest believes it owns: the kitchen in each flat.
How It Works
The Hypervisor Sits in the Middle
The hypervisor sits between the real hardware and the VMs. When a guest asks for memory, the hypervisor picks a slice of the real memory. When a guest writes to its disk, the hypervisor writes into a file on the real disk. The guest never notices, because its virtual hardware looks just like the real thing. So a guest is usually an ordinary, unmodified operating system: Windows, Linux, or another. It has no idea it isn't alone. It boots, as in lesson 1.9, schedules its own processes, and manages its own memory, all on hardware that is partly an illusion.
Common Mistake
A Virtual Machine Is No Recording
Many people think a VM is a movie of a computer, a pretend program that only looks like one. It isn't. The guest's instructions really run on the real processor. And its files really take up space on the real disk. What's pretend is only the view: the guest thinks it owns the whole machine.
Formal Definition
Popek and Goldberg's Three Tests
In 1974, Gerald Popek and Robert Goldberg put it in one line: a virtual machine is an efficient, isolated duplicate of the real machine. They gave three tests for a true hypervisor. First, programs behave just as they would on the real machine. Second, most instructions run directly on the real processor, at full speed. Third, the hypervisor stays in control of every resource, so no guest can take what isn't its own.
Quick Check
Counting Operating Systems on One Laptop
Quick check. Ivy's school laptop runs Windows. On it, a hypervisor program runs two Linux guests, side by side. How many operating systems are running on that laptop right now, each one scheduling its own processes? Pause, and decide. Three. Windows is still running underneath: it's part of the host, the real computer plus the software that shares it out. And each Linux guest is a complete operating system. It boots, schedules its own processes, and manages its own memory. Picking one is the movie mistake: the guests are real systems, not pictures. And two forgets the host's own system underneath.
Layer Diagram
A New Layer Under Several Stacks
Now the layers. In lesson 1.4 you drew a computer as a stack: hardware at the bottom, the operating system above it, applications on top. Virtualization adds one new layer. The bottom is still the real hardware, but now the hypervisor owns it. Above the hypervisor sit several separate stacks. Each has its own virtual hardware, its own guest system, and its own applications. The guest system no longer touches the real hardware. It talks to virtual hardware, and the hypervisor translates. Each layer hides the details of the one below. And a crash or a virus in one stack stays in that stack, like a flooded kitchen in one flat.
Resource Sharing
Processor Time, Memory, and Devices
A building has limited pipes. A computer has limited memory and processor time. So the hypervisor must share them out fairly, in three ways. Processor time. Like the scheduler of lesson 2.6, the hypervisor gives each guest turns on the real processor cores. Memory. Each guest gets a private block of the real memory, and no guest may peek into another's block. Lessons 4.6 and 9.7 explain why such walls matter. Devices. Disks and network cards are shared out as files and virtual cables. Lesson 10.4 shows how.
Quick Check
Why an Emulator Is Not a Hypervisor
Quick check. A program on Ivy's laptop plays an old game console's games. It reads each console instruction, and imitates it in software. The console's processor is a different kind from the laptop's. Which of Popek and Goldberg's three tests does this program fail? Pause, and decide. Most instructions run directly. Here, none do: every console instruction is translated in software, which is slow. It can still behave like the console, and stay in control. That's an emulator, not a hypervisor. A VM is fast because the guest and the host speak the same processor language. So most guest instructions simply run on the real processor.
Everyday Uses
Where Virtualization Hides
You've probably used virtualization without noticing. Here are four places it hides. Rent a small server from a hosting company, and you usually get a VM, not a whole machine. Ivy keeps a clean Linux VM for each class, so a student's mistake can't damage the lab computers. A developer can test a program on three operating systems without owning three computers. And an old program can live on, inside a VM running its old system.
Story Ending
A Guest in Its Own Flat
Back to Sam, who worried that trying a new system would break the bakery's order spreadsheet. It lives in its own flat, Ivy said. The guest has its own disk file. Delete the whole guest, and your real files never notice. Sam grinned, and clicked Start.
Key Takeaways
Hosts, Guests, and Hypervisors Reviewed
To recap. Virtualization lets one physical computer act like several separate ones, called virtual machines. The host is the real computer, and the guests are the VMs. The hypervisor creates them and keeps them apart, behind virtual hardware. A VM isn't fake: its instructions run on the real processor. And the hypervisor shares out processor time, memory, and devices.
About Introduction to Operating Systems at UPI Study
Introduction to Operating Systems (Computer Science 354) is a self-paced online course of 83 video lessons in 10 chapters, from what an operating system does and process scheduling to concurrency, memory, devices, file systems, networks, the internet, security and virtual machines. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Computer Science courses Every course with PRO →
Compare: Linux vs Operating Systems
Why take it here
Why students take Introduction to Operating Systems with UPI Study
Where the credit goes
Universities that work with NCCRS
Introduction to Operating Systems carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Virtualization Concepts
What is a hypervisor?
What is the difference between a host and a guest in virtualization?
What are Popek and Goldberg's requirements for virtualization?
What is the difference between an emulator and a virtual machine?
About the Introduction to Operating Systems course
How many college credits is Introduction to Operating Systems?
How much does Introduction to Operating Systems cost and what is included?
Which universities accept UPI Study credits?
How long does Introduction to Operating Systems take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Introduction to Operating Systems.
83 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
Updated
3 credits · NCCRSEnroll →