Virtual Pc Seminar
Upcoming SlideShare
Loading in...5
×
 

Virtual Pc Seminar

on

  • 7,621 views

 

Statistics

Views

Total Views
7,621
Views on SlideShare
7,598
Embed Views
23

Actions

Likes
2
Downloads
338
Comments
2

2 Embeds 23

http://top-seminar-topic.blogspot.com 14
http://www.slideshare.net 9

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • please send this ppt to jophyjob@depaul.edu.in
    Are you sure you want to
    Your message goes here
    Processing…
  • please send this ppt tp jophyjob.edu.in
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Virtual Pc Seminar Virtual Pc Seminar Presentation Transcript

  • Virtual PC Welcome ! By PIYUSH .R. CHORDIA TE (Div. - I) Sinhgad College of Engineering Seminar Guide Prof.C.A.Laulkar
  • Agenda
    • Virtual PC
      • Architecture
      • Features
      • Terms & Concepts
      • Scenarios
      • Demo
  • Solution Accelerators View slide
  • Why Virtualization ?
    • 40 % per year
    • 30 % per year
    View slide
  • Virtualization
    • Virtualization is a framework or methodology of dividing the resources of a computer into multiple execution environments, by applying one or more concepts or technologies such as :
      • hardware and software partitioning,
      • time-sharing,
      • partial or complete machine simulation,
      • emulation,
      • quality of service and many others
  • Virtual PC Normal PC Operation Application Software Operating System Hardware Device Drivers
  • Virtual PC Architecture PC Virtualization Host Operating System Host Drivers Host Hardware Virtualized Hardware Guest Drivers Guest Applications Guest Operating System Virtual PC Guest Environment Host Environment
  • How does Virtual PC work Architecture Virtual PC Disk file Software Hardware Virtual Machine config in vmc-file CPU0 CPU1 Sound Diskette CD/DVD Ports USB Network host driver CPU Mem Disk VPC host driver host driver host driver VPC .iso .vfd VMM
  • Virtual Machine Monitors (VMMs)
    • VMM is a layer of system software
      • Enables multiple VMs to share platform hardware
      • Allows Apps to run without modifications
    ... Virtual Machine Monitor (VMM) VM n VM 0 VM 1 Platform HW I/O Devices Processor/CS Memory Virtual Machines (VMs) App n App 0 Guest OS 0 App 1 Guest OS 1 Guest OS n
  • VMM Arrangements Host OS VMM Guest 1 Guest 2 VMM Guest 1 Guest 2 Host OS VMM Guest 1 Guest 2 Type-2 VMM Type-1 VMM (Hypervisor) Hybrid VMM Examples: JVM CLR Examples: Virtual PC & Virtual Server Examples: Windows Virtualization Hardware Hardware Hardware What we have today What we’re building for the future
  • IA System Virtualization Today Physical Memory I/O Devices Logical Processors Virtual Machine Monitor (VMM) Virtual Machines Binary Translation Paravirtualization Page-table Shadowing IO-Device Emulation Interrupt Virtualization DMA Remap IA-based System Virtualization Today Requires Frequent VMM Software Intervention
  • The Hypervisor CPU Hard Drive Ethernet NIC RAM
    • Thin layer of software running on the hardware
    • Supports creation of partitions
      • Each partition is a virtual machine
      • Each partition has one or more virtual processors
      • Partitions can own or share hardware resources
      • Software running in partition is called a guest
    • Enforces memory access rules
    • Enforces policy for CPU usage
      • Virtual processors are scheduled on real processors
    • Enforces ownership of other devices
    • Provides simple inter-partition messaging
      • Messages appear as interrupts
    • Exposes simple programmatic interface called “hypercalls”
    Hypervisor Parent Partition
  • Device I/O Accesses
    • I/O accesses (IN & OUT instructions)
    • Trap into VMM kernel
    • Force a context switch back to the host context where device emulation module is invoked
    • “ Fast I/O handlers” can be called from within the VMM context
    • Some OUTs can be batched
    • MMIO accesses
    • Caught in VMM’s page fault handler
    • Very expensive
    Host Kernel Host Physical Machine Virtual PC VMM Kernel Host context Guest context Guest User Code Guest Kernel Guest HAL Host HAL 3 0 0 0 1 1 3 VMM Driver Device Emulation Module OUT instr. GPF trap Context Switch
  • VM Components
    • VMM Kernel
      • Thin layer, all in assembly
      • Code executed at ring-0
      • Exception handling
      • External Interrupt pass-through
      • Page table maintenance
      • Located within a 32MB area of address space known as the “VMM work area”
      • Work area is relocatable
      • One VMM instance per virtual processor
    Host Physical Machine VMM Kernel Host context Guest Context Guest Code VMM Driver NDIS Driver Host Kernel Virtual PC Virtual Server Virtual Machine “ Additions ”
  • VM Components
    • VMM Driver
    • Provides kernel-level VM-related services
      • Create Virtual Machine
      • Create Virtual Processor
      • Execute Virtual Processor
    • Implements context switching mechanism between the host and guest contexts
    • Loads and bootstraps the VMM kernel
    • Much of the security work we’ve done recently involved repackaging the VMM kernel code into the VMM driver
    Host Kernel Host Physical Machine VMM Kernel Host context Guest context Guest Code VMM Driver NDIS Driver Virtual PC Virtual Server Virtual Machine “ Additions”
  • VM Execution Loop
    • Host code repeatedly calls ExecuteVirtualProcessor
    • VMM acts as “co-routine” (i.e. VMM state is saved and restored each time ExecuteVirtualProcessor is called)
    • Cycles spent inside guest context are counted against the calling thread
      • Host code can control how much time is spent in guest
    • Return code indicates why ExecuteVirtualProcessor returned
      • Time slice complete
      • IN or OUT instruction encountered
      • HLT instruction encountered
  • Virtualized Hardware
    • Memory (up to 4 GB)
    • Virtual Hard Disks
      • (3 VHD – upto 16 GB/vhd)
    • CD/DVD drive
    • Floppy drive
    • Serial ports (COM1, COM2)
    • Paralell port (LPT1)
    • Networking (4 NICs)
    • Sound
    • Display
    • No USB support
  • Terms The ability to drag files or folders between the virtual machine and the host Drag and Drop The ability to use a folder on the host as a mapped drive letter in the virtual machine Shared Folders Virtual Machine Configuration (VMC) file is where all the settings for a virtual machine are stored VMC Virtual Hard Disk (VHD) is the file on the physical computer that a virtual machine uses as a hard disk and perform all the reads and writes VHD A CDROM implemented in software that can share the physical computer CDROM or access ISO images Virtual CDROM Software loaded on the guest operating system that provided increased functionality and performance enhancements Virtual Machine Additions A network created in software Virtual network The Operating software that is installed on the virtual machine Guest OS The actual hardware that is being used and where Virtual PC 2004 is installed Physical Computer The operating system that is installed on the physical computer Host OS The virtual hardware environment provided by Virtual PC 2004 Virtual Machine Description Term
  • Extended Page Tables (EPT)
    • A VMM must protect host physical memory
      • Multiple guest operating systems share the same host physical memory
      • VMM typically implements protections through “page-table shadowing” in software
    • Page-table shadowing accounts for a large portion of virtualization overheads
    Goal of EPT is to reduce these overheads
  • What Is EPT?
    • E xtended P age T able
    • A new page-table structure, under the control of the VMM
      • Defines mapping between guest- and host-physical addresses
      • EPT base pointer (new VMCS field) points to the EPT page tables
      • EPT (optionally) activated on VM entry, deactivated on VM exit
    • Guest has full control over its own IA-32 page tables
      • No VM exits due to guest page faults, INVLPG, or CR3 changes
    Guest IA-32 Page Tables Guest Linear Address Guest Physical Address Extended Page Tables Host Physical Address EPT Base Pointer (EPTP) CR3
  • EPT Translation: Details
    • All guest-physical memory addresses go through EPT tables
      • (CR3, PDE, PTE, etc.)
    • Above example is for 2-level table for 32-bit address space
      • Translation possible for other page-table formats (e.g., PAE)
  • Direct Execution
    • In some processor modes, it’s safe to use direct execution, others require emulation
    Emulation, unless known to be safe Protected Mode Ring 0 Direct Execution (with a few exceptions) Protected Mode Ring 3 Direct Execution Virtual 8086 (v86) mode Emulation Real Mode
  • Direct Execution
    • “ Ring Compression”
      • Guest ring-0, 1, 2 code is executed at ring 1
      • Guest ring-3 code is executed at ring 3
      • Provides correct MMU protection semantics (since ring 0-2 can access privileged pages)
    • Direct execution of ring-0 code is only allowed if the VMM is notified that it’s “safe”
      • This requires patching certain “dangerous” instruction sequences in the Windows kernel and HAL
      • Patching is performed at runtime in memory only
      • Patches are different for each version of Windows kernel & HAL
  • Guest OS Patching
    • Runtime Guest OS Patching
      • Replace synthetic instructions with subroutine calls
      • This technique prevents us from exposing internal VMM implementation details to OS vendors. We can change the subroutine implementations in the future.
    pushfd cli mov eax,[ebp+8] call [eax] popfd ret vmpushfd vmcli mov eax,[ebp+8] call [eax] vmpopf ret Original Code With Synthetic Instructions call _vmpushfd call _vmcli mov eax,[ebp+8] call [eax] call _vmpopfd ret With Runtime Patches This patched sequence is correct and fast
  • Emulated Hardware Same as host CPU Intel 440BX Chipset DEC/Intel 21140A (10/100) Network adapter (multi-function) S3 Trio 32/64 PCI with 8 MB Video RAM Video card Virtual machine emulated hardware Component Creative Labs Sound Blaster 16 ISA Plug and Play Soundcard AMI BIOS using Intel 440BX rev B chipset BIOS
  • Virtual Disks
    • Types of virtual disks
      • Dynamically expanding virtual disk
      • Fixed virtual disk
      • Differencing
      • Linked drive - use a host partition
    • Default is dynamic – 16GB
      • 35KB when created on disk, expands as you write data to it
    • Use Virtual Disk Wizard to pre-create other disk types
  • Undo Disks
    • Allows all changes from power-on to be saved, committed or discarded
      • Reboots are not affected
    • Enabled per virtual machine, applies to all disks
    • Writes are made to a separate undo file per disk
  • Virtual Machine States
    • Running states
      • Pause
      • Save State
      • Turn off
      • Shutdown the Guest OS
    • Undo disks add these states
      • Save State and save changes
      • Save State and commit changes
      • Turn off and Save changes
      • Turn off and discard changes
  • Virtual PC Features Benefits and Usage Scenarios
    • Ease application migration
      • Run older legacy applications while migrating to a new operating system
      • Pilot and test new operating systems in a controlled, fail-safe environment
    • Technical support
      • Support multiple operating systems on a single computer without rebooting the computer or buying additional computers
      • Set up numerous user-specific configurations on a single computer for real-time scenario testing and evaluation
    • Training
      • Train people on any operating system without purchasing additional computers
      • Dramatically reduce classroom turnaround time by instantly switching configurations
      • Restore students’ crashed operating systems with a mouse-click
  • Virtual PC Features Benefits and Usage Scenarios
    • Quality Assurance
      • Test and document software on different operating systems on one computer
      • Compare application look and feel in multiple environments simultaneously
      • Test potentially unstable prerelease software in a safe, isolated environment
    • Accelerate application development
      • Increase QA by testing on multiple OSs using VMs
      • Decrease time-to-market with less reconfiguration
    • Do more in less time
      • Run multiple OSs on a single physical computer
      • Reduces the number of physical computers needed
  • Virtual PC Features Key Features
    • Configurability
      • Adjust settings and allocate resources
    • Easy installation
      • No reboot required
    • Standardization
      • Avoid hardware conflicts
    • Convenience
      • Switch between OSs as easily as any application
    • Host integration
      • Drag and drop between guest and host
  • Virtual PC Features Using Virtual Machines
  • Virtual Networking
    • Up to 4 NICs per virtual machine
    • Network Modes
      • Not Connected
      • Local Only (virtual machines only)
        • VM communicates with other VMs on the Local Only network
      • External NIC (Virtual Networking)
        • Each VM appears to be a separate entity on the network
    • Use a MS Loopback adapter to get internal only traffic between host and virtual machine
  • Networking Virtual Networking vs Local only Virtual Machine #1 Virtual Machine #2 Virtual Network Host NIC External Ethernet
  • Networking Virtual Machine Virtual PC Translators Network Address Translator Server Host TCP/IP Connection
  • Virtual Machine Additions
    • Improved operating system performance
    • Drag and drop
    • Clipboard sharing
    • Shared folders
    • Integrated mouse
    • DOS CD-Rom support
    • Optimized video drivers
    • Time synchronization
    • Dynamic resizing of VM window
  •  
  • Today’s Uses Virtualization addresses today’s IT concerns 10:1 in many cases Enables rapid deployment Server Consolidation Test and Development VM1 HW VMM HWn … HW0 VM1 VMn OS App OS App … HW VM1 VMn VMM OS App OS App OS App OS App
  • Virtualization Capabilities Workload Isolation Workload Migration Workload Embedding HW App 2 App 1 OS HW 1 HW 2 App 2 App 1 OS 1 OS 2 VMM HW App 2 App 1 OS 1 OS 2 VMM HW 1 App HW 2 VMM OS VMM HW 1 App HW 2 VMM OS VMM HW App App OS 1 OS 2 VMM HW App 1 App 2 OS OS Virtualization has powerful capabilities Workload Consolidation
  • Virtualization Today Summary Of Challenges
    • Complexity
      • CPU virtualization requires binary translation or paravirtualization
      • Must emulate I/O devices in software
    • Functionality
      • Paravirtualization may limit supported guest OSes
      • Guest OSes “see” only simulated platform and I/O devices
    • Reliability and Security
      • I/O device drivers run as part of host OS or hypervisor
      • No protection from errant DMA that can corrupt memory
    • Performance
      • Overheads of address translation in software
      • Extra memory required (e.g., translated code, shadow tables)
    • Create a new VM
    • Review Virtual PC settings
    • Launch a VM