Virtualization. Darren Alton

Similar documents
Virtualization. Pradipta De

for Kerrighed? February 1 st 2008 Kerrighed Summit, Paris Erich Focht NEC

LINUX Virtualization. Running other code under LINUX

24-vm.txt Mon Nov 21 22:13: Notes on Virtual Machines , Fall 2011 Carnegie Mellon University Randal E. Bryant.

Learning Outcomes. Extended OS. Observations Operating systems provide well defined interfaces. Virtual Machines. Interface Levels

Module 1: Virtualization. Types of Interfaces

Virtualization. Dr. Yingwu Zhu

COMPUTER ARCHITECTURE. Virtualization and Memory Hierarchy

Introduction to Cloud Computing and Virtualization. Mayank Mishra Sujesha Sudevalayam PhD Students CSE, IIT Bombay

Nested Virtualization and Server Consolidation

Virtualization. Starting Point: A Physical Machine. What is a Virtual Machine? Virtualization Properties. Types of Virtualization

Virtualization. ! Physical Hardware Processors, memory, chipset, I/O devices, etc. Resources often grossly underutilized

Virtualization and memory hierarchy

CS370 Operating Systems

Virtual Machines. Part 2: starting 19 years ago. Operating Systems In Depth IX 1 Copyright 2018 Thomas W. Doeppner. All rights reserved.

The Architecture of Virtual Machines Lecture for the Embedded Systems Course CSD, University of Crete (April 29, 2014)

Lecture 5: February 3

Distributed Systems COMP 212. Lecture 18 Othon Michail

Virtualization. ...or how adding another layer of abstraction is changing the world. CIS 399: Unix Skills University of Pennsylvania.

The Future of Virtualization

CS 470 Spring Virtualization and Cloud Computing. Mike Lam, Professor. Content taken from the following:

Virtualization. Operating Systems, 2016, Meni Adler, Danny Hendler & Amnon Meisels

EE 660: Computer Architecture Cloud Architecture: Virtualization

Unit 5: Distributed, Real-Time, and Multimedia Systems

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

Chapter 5 C. Virtual machines

Spring 2017 :: CSE 506. Introduction to. Virtual Machines. Nima Honarmand

Operating Systems 4/27/2015

Lecture 4: Extensibility (and finishing virtual machines) CSC 469H1F Fall 2006 Angela Demke Brown

Virtualization. Virtualization

Lecture 09: VMs and VCS head in the clouds

Virtual Machines. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

COS 318: Operating Systems. Virtual Machine Monitors

Virtualization Introduction

Virtual machines are an interesting extension of the virtual-memory concept: not only do we give processes the illusion that they have all of memory

Cloud Computing Virtualization

NON SCHOLAE, SED VITAE

OS Virtualization. Why Virtualize? Introduction. Virtualization Basics 12/10/2012. Motivation. Types of Virtualization.

Virtualization (II) SPD Course 17/03/2010 Massimo Coppola

The Challenges of X86 Hardware Virtualization. GCC- Virtualization: Rajeev Wankar 36

references Virtualization services Topics Virtualization

A Survey on Virtualization Technologies

I/O and virtualization

Virtualization. Adam Belay

Lecture 5. KVM for ARM. Christoffer Dall and Jason Nieh. 5 November, Operating Systems Practical. OSP Lecture 5, KVM for ARM 1/42

Virtual Machine Systems

CHAPTER 16 - VIRTUAL MACHINES

Björn Döbel. Microkernel-Based Operating Systems. Exercise 3: Virtualization

CS370: Operating Systems [Spring 2016] Dept. Of Computer Science, Colorado State University

Virtualization. join, aggregation, concatenation, array, N 1 ühendamine, agregeerimine, konkateneerimine, massiiv

Virtual Machines. To do. q VM over time q Implementation methods q Hardware features supporting VM q Next time: Midterm?

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

Multiprocessor Scheduling. Multiprocessor Scheduling

An overview of virtual machine architecture

Introduction to Virtual Machines. Carl Waldspurger (SB SM 89 PhD 95) VMware R&D

CSC 5930/9010 Cloud S & P: Virtualization

CSCI 8530 Advanced Operating Systems. Part 19 Virtualization

The only open-source type-1 hypervisor

e-pg Pathshala Subject: Computer Science Paper: Cloud Computing Module 23: Virtualization II Module No: CS/CC/23 Quadrant 1 e-text

Virtualization and Performance

Introduction to Virtual Machines

CS5460: Operating Systems. Lecture: Virtualization. Anton Burtsev March, 2013

Concepts. Virtualization

OPERATING SYSTEMS Chapter 13 Virtual Machines. CS3502 Spring 2017

Introduction to Virtual Machines. Michael Jantz

Server Virtualization Approaches

Virtual Machines Measure Up

Originally prepared by Lehigh graduate Greg Bosch; last modified April 2016 by B. Davison

CS 350 Winter 2011 Current Topics: Virtual Machines + Solid State Drives

CSE 120 Principles of Operating Systems

T Jarkko Turkulainen, F-Secure Corporation

Virtual Machine Monitors!

CLOUD COMPUTING IT0530. G.JEYA BHARATHI Asst.Prof.(O.G) Department of IT SRM University

BUD17-301: KVM/ARM Nested Virtualization. Christoffer Dall

Virtualization. Introduction. Why we interested? 11/28/15. Virtualiza5on provide an abstract environment to run applica5ons.

What is KVM? KVM patch. Modern hypervisors must do many things that are already done by OSs Scheduler, Memory management, I/O stacks

Virtualization Overview NSRC

Cloud Networking (VITMMA02) Server Virtualization Data Center Gear

CSCE 410/611: Virtualization!

Portland State University ECE 587/687. Virtual Memory and Virtualization

Virtual machine architecture and KVM analysis D 陳彥霖 B 郭宗倫

Virtualization. Michael Tsai 2018/4/16

Virtualization Food Fight. Rik van Riel

CSCE 410/611: Virtualization

A Review On optimization technique in Server Virtualization

VIRTUALIZATION: IBM VM/370 AND XEN

MANAGEMENT OF TASKS IN VIRTUALIZED ENVIRONMENTS

CS370 Operating Systems

CS370 Operating Systems

Introduction to Virtualization and Containers Phil Hopkins

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Computer Systems Engineering: Spring Quiz I Solutions

Open-source virtualization. Master Thesis. Jan Magnus Granberg Opsahl. Functionality and performance of Qemu/KVM, Xen, Libvirt and VirtualBox

CS 550 Operating Systems Spring Introduction to Virtual Machines

Zdeněk Kubala Senior QA

Performance of Kernels in Virtual Machines: An Introduction to KVM Hypervisor

Πποχωπημένη Κατανεμημένη Υπολογιστική

Mechanisms and constructs for System Virtualization

Virtual Virtual Memory

Operating system hardening

Virtualization. Guillaume Urvoy-Keller UNS/I3S

Transcription:

Virtualization Darren Alton

A brief introduction... In general, virtualization means emulating computer hardware* with software**. Virtual machine (VM) can mean a couple of things: A process virtual machine runs a single process. A system virtual machine usually emulates an entire computer. We'll be primarily, but not necessarily exclusively, focusing our attention on system virtual machines. * sometimes not real hardware ** sometimes assisted by real hardware

Terminology An operating system installed inside a VM is often called the "guest." An operating system installed on the physical hardware is similarly called the "host" (assuming it has any guests). The virtual machine software itself is often called a "hypervisor," a "virtual machine monitor" (VMM), or, in some cases, an "emulator."

Why bother? Guests can often be managed in the same ways as files and processes on the host system. Run software incompatible with the host system on a guest. Simultaneously run multiple guests on the same host, sharing the host's resources. Isolate the guest systems for security reasons.

How does it work? The simplest case of an emulator is a pure interpreter, where the guest CPU is implemented entirely in software. + Portable, easily generalizes to nearly any host or guest architecture + Conceptually simple - Very slow! // the basic concept in pseudo-code: while (running) { op = memory[pc++]; if (op not in ISA) { error("illegal instruction!"); running = false; } run_guest_opcode(op, memory); } image: David Byrne, in Once in a Lifetime by Talking Heads

How does it work? A dynamic recompiler, or Just-In-Time (JIT) compiler, disassembles the guest's machine code and recompiles it for the host. + Much faster than interpreting each operation individually - More complex, harder to implement // the basic concept in pseudo-code: while (running) { if (cache[pc] does not exist) { asm = disasm_guest(memory, pc); if (asm is null) { error("illegal instruction!"); running = false; } cache[pc] = compile_for_host(asm); } execute(cache[pc]); } image: "Johnny 5," from Short Circuit

What about the same architecture? You may ask, "Suppose I just want to run an x86 guest on an x86 host, can't I just forgo all that re-interpreting and recompiling business and run the guest's code directly?" In a sense, yes, but there are some issues. First, we need to discuss some properties of instruction set architectures (ISA), and what is needed to be "virtualizable." In a paper published in 1974, Gerald J. Popek and Robert P. Goldberg defined criteria for what we now call "classical virtualization." Fidelity - The guest must run the same as it would natively. Performance - A "statistically dominant" subset of the opcodes must be executed directly on the host's CPU. Safety - The hypervisor must always remain in control of the guest. x86 in particular doesn't quite meet these requirements!

Handling sensitive instructions First, some definitions: Sensitive instructions depend on or affect the system configuration. Privileged instructions can only be run in kernel mode and cause an exception if run in user mode. Let S be the set of sensitive instructions, and P be the set of privileged instructions: Popek and Goldberg proposed that if S P, then the ISA can be virtualized by a "trap-and-emulate" method. // the basic concept in pseudo-code: while (running) { try { execute(memory + pc); } catch (Exception e) { pc = e.location; op = memory[pc++]; if (op not in ISA) { error("illegal instruction!"); running = false; } else { run_guest_opcode(op, memory); } } } image: Admiral Ackbar, from Star Wars: Episode VI

Failing to handle sensitive instructions However, the x86 ISA contains no less than seventeen instructions that are sensitive, but not considered privileged. VMware, VirtualBox, and others employ binary translation, which uses dynamic recompilation where needed. AMD and Intel processors retrofit classical virtualizability onto the x86 architecture in 2005.

Hardware-assisted failure These extensions added: The VMCB, which contains the state of the guest, and what to trap. The "vmrun" instruction, which enters virtual machine mode until a trap. A security hole in the x86 ISA itself! The "Blue Pill" attack. image: Morpheus and Neo, from The Matrix

Memory management Virtualizing memory is a tricky problem as well. Consider that the guests and host each must have their own page tables, and they must not interfere with each other. Also consider how swap space would behave...

Paravirtualization Suppose we didn't care about "classical" virtualization. We probably don't want to budge much on performance and safety... But suppose we don't care whether the guest knows that it's a guest. Enter paravirtualization, which requires modifying the guest operating system's kernel to interact with the hypervisor. Requires the guest OS be modified to cooperate with the hypervisor.

Recursive virtualization Popek and Goldberg, again: "THEOREM: A conventional third generation computer is recursively virtualizable if it is: 1. [classically] virtualizable, and 2. a VMM without any timing dependencies can be constructed for it." Recursive virtualization is not always possible. image: Cobb from Inception

In practice... QEMU is effectively the Swiss Army Knife of virtualization. VMware and VirtualBox are popular virtual machines for x86, with a GUI for managing virtual machines and disks. Xen is a popular hypervisor for paravirtualization.

High-level emulation (HLE) Some hardware is costly to fully emulate. Instead of emulating the whole device at a lower level, reimplement the functionality that device provides. So, instead of emulating the GPU, pass along the job to the host GPU. "UltraHLE" popularized this approach in 1999. VMware, Parallels, and VirtualBox now do this. image: Mewtwo from Pokemon Stadium

Not quite emulation, but... WINE Is Not an Emulator. Cygwin provides a Unix-like environment on Windows. User-mode Linux is a Linux kernel built to run as an ordinary process on the host. colinux is the same thing, but for Windows hosts. OpenVZ and Lguest allow the host kernel to use multiple instances of itself as "guests." Similar to FreeBSD's jail(8), which differs from typical chroot(8) jail in that it isolates everything, not just the filesystem. image: stock photo

Live migration between hosts It is sometimes possible to move a guest from one host to another without the guest ever being shut down. This is called "live migration" or "seamless migration." Usually requires that any virtual disks be on a network share available to both hosts to be possible. The memory of the guest is copied over the network... then the guest starts on the target and stops on the source.

To the cloud! Infrastructure as a Service (IaaS) Some cloud-based services offer the ability to rent virtual machines. More flexible than paying for and maintaining physical servers. Usually don't have to worry about installing and configuring the OS. What virtualization methods are best for IaaS hosting? image: Tim from Braid

Running a Nintendo Wii emulator inside VirtualBox on Linux

Virtualizing a lot of game consoles on Linux... at the same time

Resources Hardware Support for Efficient Virtualization http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.110.1676&rep=rep1&type=pdf Xen and the Art of Virtualization http://research.microsoft.com/~tharris/papers/2003-sosp.pdf A Comparison of Software and Hardware Techniques for x86 Virtualization http://www.vmware.com/pdf/asplos235_adams.pdf Introducing Blue Pill http://www.coseinc.com/en/index.php?rt=download&act=publication&file=introducing%20blue%20pill.ppt.pdf Formal requirements for virtualizable third generation architectures http://www-users.cselabs.umn.edu/classes/spring-2010/csci5105/papers/popek-virt-reqmts.pdf Live Migration of Virtual Machines http://www.cl.cam.ac.uk/research/srg/netos/papers/2005-migration-nsdi-pre.pdf

Questions (and, hopefully, answers) This presentation, with more detailed slides: http://goo.gl/kgzej