Types of Virtualization, Explained

UPI Study › Courses › Introduction to Operating Systems › Free lessons › Lesson 10.3 Free with a free account

Types of Virtualization

Introduction to Operating Systems · Chapter 10: Virtualization and Virtual MachinesSection 10.3 · lesson 80 of 838 min · free with a free account

← The Benefits of VirtualizationNext lesson: How Virtual Machines Replicate an OS →

A free account plays all of Chapter 1 and 3 more lessons of Introduction to Operating Systems. Create a free account →

Earn 3 college credits for Introduction to Operating SystemsRecommended for credit by NCCRS · Computer Science 354 · self-paced · one payment, lifetime access

In this lesson

Type 1 and type 2 hypervisors, virtualization techniques, and containers.

  • Distinguish type 1 bare-metal hypervisors from type 2 hosted hypervisors
  • Compare full virtualization, paravirtualization, and hardware-assisted virtualization
  • Explain how containers differ from virtual machines
  • Choose between a virtual machine and a container for a given job

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,047 words). Read along, or search it.

Opening Question

Not Every Virtual Machine Is the Same

Ivy, who looks after the computers at a school, runs virtual machines in two places: on the school's servers, and on her own laptop. The software underneath is built very differently in each. And Sam, who runs a small online bakery, has a small program that may not need a VM at all. Not every virtual machine is the same. Which kind fits which job? This lesson helps you decide.

Type 1

Bare-Metal Hypervisors on the Hardware

The first way to sort hypervisors is by where they sit. A type 1 hypervisor, also called bare-metal, runs directly on the physical hardware, with no ordinary operating system under it. It's the first thing the machine starts. Examples are VMware ESXi, Microsoft Hyper-V, and KVM, which is built into the Linux kernel and turns Linux itself into a hypervisor. Server rooms, like the one at Ivy's school, use this kind. With fewer layers, it's fast, and easier to protect.

Type 2

Hosted Hypervisors as Ordinary Apps

A type 2 hypervisor, also called hosted, is an ordinary program running on a normal host operating system, just like a browser. Oracle's VirtualBox and VMware Workstation are examples. You install one on a laptop, open it, and start VMs in windows. It's easy, and perfect for learning, testing, and desktops. The price is one extra layer. A guest's request passes through the hypervisor, then through the host operating system, and only then reaches the hardware.

Common Mistake

Type 1 Is Not Simply Better

A common mistake is to think type 1 means better, and type 2 means worse. They're built for different jobs. A server room wants speed and tight control, so it picks type 1. A learner with one laptop wants a guest in a window, so type 2 is the right tool. Some products even blur the line. So treat the two types as a helpful way to sort, not a strict law.

The Core Problem

When the Guest Is Not the Boss

The second way to sort is by how the guest and the hypervisor cooperate. A guest system is used to being the boss, in kernel mode, from lesson 2.3. But in a VM it isn't the boss. The hypervisor is. So when the guest tries a powerful action, such as changing its page tables, someone must step in. There are three famous ways to do that.

Three Techniques

Full, Para, and Hardware-Assisted

Full virtualization: the guest runs unmodified. The hypervisor catches or rewrites its sensitive actions, so the guest never knows. Any ordinary system works. Paravirtualization: the guest system is changed so it knows it's in a VM. Instead of trying powerful actions, it calls the hypervisor, with a hypercall. A hypercall is like a system call, but to the hypervisor. That cuts the work of catching, but the guest must be modified. Xen is a well-known hypervisor that supports it. Hardware-assisted virtualization: the processor helps. Intel calls its feature VT-x, and AMD calls its feature AMD-V. The chip runs the guest at full speed, and hands control to the hypervisor automatically whenever a sensitive action happens.

Current Practice

VT-x, AMD-V, and Paravirtual Drivers

Today almost every desktop and server processor has VT-x or AMD-V, and most modern hypervisors rely on it. That's why a computer's firmware may have a setting to switch it on or off, which lesson 10.5 revisits. And paravirtual ideas live on, in the special drivers a guest installs to speed up its disk and network, from lesson 10.4.

Quick Check

An Old Chip and an Unchanged Guest

Quick check. An old server's chip has no virtualization help built in. The guest is a stock copy of an everyday operating system, never altered. Which technique is left for the hypervisor? Pause, and decide. Full virtualization. The hypervisor has to catch, or rewrite, the guest's sensitive actions in software. Hardware assist is out, because the chip has no VT-x or AMD-V. Paravirtualization is out, because the guest was never changed to make hypercalls. That's exactly how early PC hypervisors ran ordinary systems, before processors helped.

Containers

Private Rooms Sharing One Kernel

A VM brings a whole guest operating system, with its own kernel. That's safe, but heavy: gigabytes of disk, and often a minute to boot. What if a program only needs its own private room, and not its own building? That's a container. A container is a group of processes that the host kernel walls off. They see their own files, their own process list, and their own network. But every container shares the host's one kernel. On Linux, kernel features called namespaces decide what a container can see, and control groups limit how much it may use. Tools like Docker package programs this way.

Comparison

VMs Versus Containers Row by Row

Here are the differences, row by row. A VM holds a full guest system with its own kernel. A container holds one app and its libraries, and shares the host's kernel. So a VM is larger and slower to start, but its wall is stronger, with separate kernels. A container is small and quick, but all of them lean on one kernel. And a VM can run a different operating system from the host. A container can't. It needs the same kernel family.

Quick Check

Linux Containers on a Mac

Quick check. Ivy runs a Linux container with a tool called Docker Desktop, on a Mac. Containers share their host's kernel, but macOS isn't Linux. So where does the Linux kernel come from? Pause, and decide. A small Linux VM. Docker Desktop quietly runs a Linux virtual machine on the Mac, and the containers share that VM's kernel. The macOS kernel doesn't speak Linux's system calls. And a container never brings a kernel of its own: that's exactly what makes it light. That's containers inside a VM. Companies do it on purpose, too, to get the strong wall of a VM and the light packaging of a container.

Decision Rule

Does the Job Need Its Own OS

To choose, ask one question: does this job need its own operating system? If yes, say a Windows program on a Linux host, or a strict wall between customers, use a VM. If it needs a clean, repeatable place for one app, a container is lighter. Back to Sam's small program: one little Linux program for the shop. Does it need its own system? No. So a container is plenty.

Key Takeaways

Hypervisors and Containers Reviewed

To recap. A type 1 hypervisor runs on the bare hardware. A type 2 hypervisor is an app on a host operating system. Full virtualization runs unmodified guests, paravirtualization uses hypercalls, and VT-x or AMD-V lets the chip help. And a container shares the host's kernel: lighter than a VM, but it can't run another operating system.

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.

Compare: Linux vs Operating Systems

Why take it here

Why students take Introduction to Operating Systems with UPI Study

What happens under every app you runIntroduction to Operating Systems explains the software that runs a computer: processes and scheduling, threads and synchronization, deadlock, memory and paging, devices and storage, file systems, networking, security and virtualization. It suits computer science and information technology degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

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.

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 Types of Virtualization

What is the difference between a type 1 and a type 2 hypervisor?
A type 1 hypervisor runs directly on the physical hardware, while a type 2 hypervisor runs as an application on a normal host operating system. Type 1 examples include VMware ESXi, Microsoft Hyper-V, and KVM, which suit server rooms that need speed and tight control. Type 2 examples include VirtualBox and VMware Workstation, which suit learning, testing, and desktops but add an extra layer.
What is paravirtualization?
Paravirtualization is a technique in which the guest operating system is modified so it knows it runs in a virtual machine. Instead of attempting sensitive actions that the hypervisor must catch, the guest calls the hypervisor directly through hypercalls, which work like system calls aimed at the hypervisor. This cuts the work of catching, but the guest must be modified. Xen is a well-known hypervisor that supports it.
What is the difference between a container and a virtual machine?
A virtual machine runs a full guest operating system with its own kernel, while a container is a group of processes that shares the host's kernel. Containers are small and quick to start, while VMs are larger and slower but have a stronger wall between them. A VM can run a different operating system from its host, but a container needs the same kernel family.
How do Linux containers isolate processes?
Linux containers rely on kernel features called namespaces and control groups. Namespaces decide what a container can see, giving it its own files, process list, and network. Control groups limit how much of the machine's resources it may use. Tools such as Docker package programs this way. On a Mac, Docker Desktop runs a small Linux virtual machine whose kernel the containers share.

About the Introduction to Operating Systems course

How many college credits is Introduction to Operating Systems?
Introduction to Operating Systems (Computer Science 354) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Introduction to Operating Systems cost and what is included?
$250, paid once, with lifetime access: all 83 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Introduction to Operating Systems take?
It is self-paced with no deadlines. The 83 lessons total about 10 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

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

Introduction to Operating Systems
3 credits · NCCRS
Enroll →