Virtualization and Other Tricks.

Similar documents
Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

Comparing Free Virtualization Products

Anh Quach, Matthew Rajman, Bienvenido Rodriguez, Brian Rodriguez, Michael Roefs, Ahmed Shaikh

Hypervisors. Introduction. Introduction. Introduction. Introduction. Introduction. Credits:

Virtualization. Types of Interfaces

The Art of Virtualization with Free Software

Virtualization. Pradipta De

Hypervisor Software and Virtual Machines. Professor Howard Burpee SMCC Computer Technology Dept.

Comparing Virtualization Technologies

Full and Para Virtualization

VMware Server 2.0 Essentials. Virtualization Deployment and Management

Chapter 16: Virtual Machines. Operating System Concepts 9 th Edition

Introduction to Virtual Machines

Systems Administration Introduction to OSPF

Virtualization. Jia Rao Assistant Professor in CS

Virtualization and the U2 Databases

Virtualization with Windows

Virtualization. Michael Tsai 2015/06/08

Enabling Technologies for Distributed Computing

Virtual Machines.

A cure for Virtual Insanity: A vendor-neutral introduction to virtualization without the hype

nanohub.org An Overview of Virtualization Techniques

Virtualization: Know your options on Ubuntu. Nick Barcet. Ubuntu Server Product Manager

MODULE 3 VIRTUALIZED DATA CENTER COMPUTE

Computer Virtualization in Practice

Virtual Hosting & Virtual Machines

Enabling Technologies for Distributed and Cloud Computing

PERFORMANCE ANALYSIS OF KERNEL-BASED VIRTUAL MACHINE

Analysis of Virtualization Tools and Techniques

IOS110. Virtualization 5/27/2014 1

CPET 581 Cloud Computing: Technologies and Enterprise IT Strategies. Virtualization of Clusters and Data Centers

EXPLORING LINUX KERNEL: THE EASY WAY!

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

COM 444 Cloud Computing

Virtualization. Dr. Yingwu Zhu

Introduction to Virtualization & KVM

Distributed systems Techs 4. Virtualization. October 26, 2009

Cloud Computing CS

Virtualization. Jukka K. Nurminen

Basics of Virtualisation

9/26/2011. What is Virtualization? What are the different types of virtualization.

VMware and CPU Virtualization Technology. Jack Lo Sr. Director, R&D

Eddy Integrated Development Environment, LemonIDE for Embedded Software System Development

Intro to Virtualization

Virtualization Technologies

Lecture 2 Cloud Computing & Virtualization. Cloud Application Development (SE808, School of Software, Sun Yat-Sen University) Yabo (Arber) Xu

Virtualization. Introduction to Virtualization Virtual Appliances Benefits to Virtualization Example Virtualization Products

Hardware Based Virtualization Technologies. Elsie Wahlig Platform Software Architect

Virtualization for Cloud Computing

CSE 501 Monday, September 09, 2013 Kevin Cleary

COS 318: Operating Systems. Virtual Machine Monitors

OPEN SOURCE VIRTUALIZATION TRENDS. SYAMSUL ANUAR ABD NASIR Warix Technologies / Fedora Community Malaysia

Installing & Using KVM with Virtual Machine Manager COSC 495

Example of Standard API

Distributed Systems. Virtualization. Paul Krzyzanowski

SUSE Linux Enterprise 10 SP2: Virtualization Technology Support

Virtual Machine Monitors. Dr. Marc E. Fiuczynski Research Scholar Princeton University

PARALLELS SERVER 4 BARE METAL README

Virtual Computing and VMWare. Module 4

Cloud Computing #6 - Virtualization

PARALLELS SERVER BARE METAL 5.0 README

Virtualization in Linux. DCLUG talk Przemek Klosowski October 2011

To join the audio portion of this webcast: meeting code

Distributed and Cloud Computing

Using VMware Player. VMware Player. What Is VMware Player?

Introduction to Virtualization

Outline. Outline. Why virtualization? Why not virtualize? Today s data center. Cloud computing. Virtual resource pool

Virtualization in a Carrier Grade Environment

Chapter 2 Addendum (More on Virtualization)

Knut Omang Ifi/Oracle 19 Oct, 2015

Open Source Virtualization

Virtualization in Linux KVM + QEMU

A Comparison of VMware and {Virtual Server}

How To Virtualize A Computer System

RPM Brotherhood: KVM VIRTUALIZATION TECHNOLOGY

SCO Virtualization Presentation to Customers

Compromise-as-a-Service

Practical Applications of Virtualization. Mike Phillips IAP 2008 SIPB IAP Series

Chapter 14 Virtual Machines

Operating System Structures

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Options in Open Source Virtualization and Cloud Computing. Andrew Hadinyoto Republic Polytechnic

Parallels Desktop for Mac

Virtualization: Concepts, Applications, and Performance Modeling

x86 ISA Modifications to support Virtual Machines

Virtualization Technologies (ENCS 691K Chapter 3)

Operating Systems Virtualization mechanisms

Server and Storage Virtualization. Virtualization. Overview. 5 Reasons to Virtualize

Understanding Full Virtualization, Paravirtualization, and Hardware Assist. Introduction...1 Overview of x86 Virtualization...2 CPU Virtualization...

Virtual Machines. Virtualization

Virtualization Technologies and Blackboard: The Future of Blackboard Software on Multi-Core Technologies

12. Introduction to Virtual Machines

Virtualization benefits Introduction to XenSource How Xen is changing virtualization The Xen hypervisor architecture Xen paravirtualization

Enterprise-Class Virtualization with Open Source Technologies

Virtual Machine Security

The Xen of Virtualization

Performance tuning Xen

<Insert Picture Here> Oracle Database Support for Server Virtualization Updated December 7, 2009

Running Windows on a Mac. Why?

Hypervisors and Virtual Machines

Transcription:

Virtualization and Other Tricks. Pavel Parízek, Tomáš Kalibera, Peter Libič DEPARTMENT OF DISTRIBUTED AND DEPENDABLE SYSTEMS http://d3s.mff.cuni.cz CHARLES UNIVERSITY PRAGUE Faculty of Mathematics and Physics

Cross-development Common definition Process of development of a software system for platform A on platform B Development on platform B Software runs on platform A Platform CPU architecture Operating system (OS) System libraries

What (and when) it is good for Development of software for platforms With limited resources Compilers cannot run on such platforms Where it is hard to develop (compile, debug) No user interface (text mode, GUI) Not available to developers for testing New CPU architecture Expensive HW

Target domains Software for embedded systems Consumer electronics, industrial robots, jet fighters, Example: different HW Development on a normal PC (Linux 3.0.1, x86-64) Deployment on an embedded system (no OS, ARM) Software for different versions of OS and libraries Example: multiple platforms Development of SW on Linux Deployment on Windows, Linux, FreeBSD, Solaris,

Approaches to cross-development Common runtime environment Executable can run on different platforms Bytecode programs Examples Java Virtual Machine (JVM),.NET (CLR) Issues Not a solution for systems with limited resources Runtime environment not available on all platforms (though, there is some Java hardware) Cross-compilation

Cross-compilation Common definition Compilation for a platform A on platform B Compiler runs on platform B Software runs on platform A Cross-compiler Creates a binary (executable) for a different platform than the one it runs on Tools: GCC, Many cross-compilers exist (free, proprietary)

Usage scenario 1. Create a cross-compiler 2. Use the cross-compiler Four different platforms can be involved Build platform Where a compiler runs Host platform Where the compiled SW runs Target platform (only for compilers and compiler tools) For what platform it will compile Compiler build platform Where the compiler is built

Cross-compilation with GCC GCC supports many platforms Various CPU architectures Different system libraries (glibc, newlib, ) System library (for C) and binutils for each target platform must be available Binutils package includes GNU Assembler Options for C library glibc (full), newlib (small C library), uclibc, Two aspects Creating a cross-compiler with GCC Running GCC as a cross-compiler

Creating a cross-compiler with GCC Compile binutils for the target platform Using the --target=<some target> argument for the./configure script Some of the following have to be specified in target s name CPU architecture, format of executables (binaries), operating system Examples: arm-elf, sparc-linux, Build and install C library for the target platform Put all necessary files (includes, library) into the proper directory e.g. /usr/local/<some target> Depends on the --prefix argument to./configure Build GCC for the target platform Using the --target=<some target> argument for the./configure script

Running GCC as a cross-compiler Run the proper version of GCC Option 1: different names of executables <machine>-gcc, <machine>-gcc-<version> Option 2: command-line arguments gcc b <machine> -V <version>

Tool-chains for cross-compilation Typical features Scripts for construction of cross-compilers and (images of) file systems Integration with virtualization tools Buildroot Scratchbox Some crosscompilers are available in binary form In Linux distributions for popular embedded processors By vendors of embedded processors

ESA Venus Express Mission Photo: ESA Framing camera controlled by RTEMS/LEON Launched 2005, arrived 2006 to Venus, still operating

NASA Dawn Mission Launched 2007, reached Vesta Asteroid (July 16, 2011) Expected to reach Ceres in 2015 Framing camera with Xilinx FPGA running RTEMS/LEON2

Xilinx FPGA Board

Want to Learn More? NSWE001 Embedded and Real-time Systems Summer term NSWE003 Model-driven design of embedded and real-time systems using Matlab/Simulink Winter term NPRG037 Microcontroller Programming Winter term

Virtualization

Virtualization Abstraction of computer resources Different kinds of virtualization Platform virtualization Construction and use of virtual machines Resource virtualization Creation of logical resources based on physical Mainly used for: memory, storage, and network Application virtualization Running applications on platforms for which they were not compiled

Platform virtualization Prevailing usage Testing and debugging of software built by cross-compilers Different virtual machines for each version of the software (for different products) can be used Experimental changes in an operating system Running of several virtual servers on one physical computer Running applications not available for the platform used MS Office, Adobe Photoshop on Linux...

Key concepts Virtual machine Software implementation of a physical computer Guest OS runs in a virtual machine Guest code Code of guest OS and applications running in it Virtual machine monitor Runs virtual machines (guest systems) Sometimes called hypervisor Guest OS Guest OS Native app Virtual machine Virtual machine Virtual machine monitor Host OS Host machine (physical computer)

Relation between virtual and physical machine Virtual machine can be Copy of the underlying physical machine Same CPU architecture and devices Emulation of a different CPU Different instruction set than the physical machine

Virtual machine monitor (VMM) Purpose Running multiple virtual machines concurrently Management of the virtual machines Classification Type 1: native, bare-metal Runs directly on the host machine (no host OS is needed) IBM CP/CMS, VMWare ESXi, MS Hyper-V, KVM Type 2: hosted Runs in the underlying host OS (on top of it) VMWare WS, VirtualBox, Parallels desktop,...

How the virtualization typically works Non-privileged guest code A) Same architecture of host and guest machines Runs natively on the host machine Better performance than provided by emulation B) Different architectures of host and guest Emulation of guest instruction set (e.g. via dynamic translation to host instruction set) Privileged operations (code) Interception by virtual machine monitor Motivation Services provided by OS (file I/O, HW access) must be emulated using HW of the virtual machine Operations that may influence host system or other guests must be handled in a special way isolation (protection)

Interception of privileged operations Same CPU architecture (and instruction set) of host and guest Full virtualization Para-virtualization Different CPU architecture Complete emulation

Full virtualization Key characteristics Virtualization of the whole computer (all HW devices) No direct access to physical HW is performed by the guest code Interception of privileged operations via exceptions When the guest code performs privileged operation, an exception is thrown Exception is handled by VMM, which performs the operation on the emulated HW Benefit No modification of guest OS is necessary Drawback Worse performance (due to emulation of all HW)

Para-virtualization Key characteristics Some HW devices are not virtualized Physical HW is accessed in such a case Privileged operations performed by direct calls of host OS (via VMM) from guest OS Used mainly at x86 architecture Does not support virtualization Benefit Better performance Drawback Specific modifications of guest OS are necessary No change to ABI only guest OS has to be modified, not the applications running on top of it

Virtualization tools

Virtualization tools Full virtualization QEMU, VMware, Para-virtualization Xen, Emulators QEMU, Bochs, (some products span multiple classes)

QEMU Machine virtualizer and emulator Runs on x86 and PowerPC hosts Key features Able to run guest code on the host machine When guest and host have the same architecture Uses dynamic translation of guest instructions For emulation of different CPUs No modification of the host OS is required Support for inspection of the virtual machine s state with GDB displaying registers, running guest OS kernel in GDB, Support for VM snapshots

QEMU: Operating modes Full system emulation Whole computer is emulated (all HW devices) Useful for running a guest OS User mode emulation For running of applications compiled for one platform on a different platform

QEMU: Dynamic translation of guest code How it is done Guest code is translated when it is executed for the first time Each guest code instruction is translated to a sequence of simpler instructions Each simple instruction is implemented by a piece of C code in the host system Benefit Reasonable performance

QEMU: Supported HW CPU architecture System emulation x86, x86-64, PowerPC, SPARC, ARM, MIPS (and many other) User mode emulation x86, PowerPC, SPARC, MIPS, ARM HW devices (peripherals) VGA card, mouse, keyboard, 2 IDE ports (for hard disk or CD-ROM), network adapters, serial ports, various sound cards, USB controller and hub, SMP is supported

QEMU: Usage Emulation of PC (x86) Running: qemu [options] [disk_image] Disk image with guest OS must be provided Available for Linux on various CPUs Many options available Selection and configuration of HW devices to be emulated Configuration of a virtual network (VLAN) Emulation of non-pc systems Running the correct executable (CPU-specific) qemu-system-ppc, qemu-system-mips,

QEMU Monitor Management tool for QEMU Supported operations Insertion and removal of media (e.g. CDs) Freezing of virtual machines Saving and restoration of VM snapshots to/from a file Inspection of VM state without an external debugger (GDB)

Disk images for QEMU Supported formats raw Most generic, plain binary image of a hard disk qcow2 Native format of QEMU, copy-on-write vmdk VMware image format

How to create a disk image for QEMU Two basic options Create a blank image file and install a guest OS inside QEMU from a CD/DVD qemu-img create -f raw fedora10.img 3GB qemu -m 512 -had fedora10.img -cdrom /dev/cdrom -boot d Create a complete file system in a partition and dump it into an image file mount -t ext2 /dev/hda3 /mnt/newfs cp -R /bin /boot /lib /mnt/newfs dd if=/dev/hda3 of=newfs.img

VMware Family of virtualization tools Developed by the VMware company Host systems Windows, Linux, Mac OS X Guest systems Focus on x86-compatible (x86-based) CPU architectures Desktop products VMware Workstation VMware Player Free version with somewhat limited features Enterprise products VMware Server (GSX) Free VMware ESX Server Runs directly on HW (no underlying OS is necessary)

Xen Virtual machine monitor (hypervisor) Host OS Linux, OpenSolaris, *BSD Guest CPU architectures IA-32, x86, x86-64, IA-64, PowerPC Guest OS Linux, OpenSolarins, *BSD, Windows Supported virtualization techniques Para-virtualization Modifications of Linux as guest OS are available Full virtualization Only on selected CPU architectures (Intel VT or AMD-V)

VirtualBox Virtualization tool developed by Oracle (Sun) Focus on x86-based CPU architectures Supported host OSes Windows, Mac OS X, Linux Supported guest OSes Officially supported Windows (NT, 2000, XP, Server, Vista, 7), Linux (2.6.13+), Solaris Modifications for better performance (para-virtualization) are available Any x86 operating system in theory (DOS, Windows, Linux, ) No modifications for performance Key features Management of VMs via GUI (like VMware) or command-line tools Software Development Kit (SDK) Integration with other tools via API

Links GCC http://gcc.gnu.org Buildroot http://buildroot.uclibc.org/ Scratchbox http://www.scratchbox.org QEMU http://bellard.org/qemu/ Xen http://www.xen.org/ Bochs http://bochs.sourceforge.net