virtual machine program execution general concepts code translation compiler compiletime optimizing compiler intermediate representation ir execution runtime system runtime executable interpreter virtual machine types of code source code object code bytecode machine code microcode compilation strategies justintime jit tracing justintime aheadoftime aot transcompilation recompilation notable runtimes android runtime art common language runtime clr mono crt0 hhvm java virtual machine jvm objectivec v8 nodejs pypy zend engine notable compilers toolchains gnu compiler collection gcc llvm clang vte in computing a virtual machine vm is an emulation of a computer system virtual machines are based on computer architectures and provide functionality of a physical computer their implementations may involve specialized hardware software or a combination there are different kinds of virtual machines each with different functions system virtual machines also termed full virtualization vms provide a substitute for a real machine they provide functionality needed to execute entire operating systems a hypervisor uses native execution to share and manage hardware allowing for multiple environments which are isolated from one another yet exist on the same physical machine modern hypervisors use hardwareassisted virtualization virtualizationspecific hardware primarily from the host cpus process virtual machines are designed to execute computer programs in a platformindependent environment some virtual machines such as qemu are designed to also emulate different architectures and allow execution of software applications and operating systems written for another cpu or architecture operatingsystemlevel virtualization allows the resources of a computer to be partitioned via the kernels support for multiple isolated user space instances which are usually called containers and may look and feel like real machines to the end users definitions a virtual machine was originally defined by popek and goldberg as an efficient isolated duplicate of a real computer machine the physical realworld hardware running the vm is generally referred to as the host and the virtual machine emulated on that machine is generally referred to as the guest a host can emulate several guests each of which can emulate different operating systems and hardware platforms system virtual machines see also hardware virtualization and comparison of platform virtualization software the desire to run multiple operating systems was the initial motive for virtual machines so as to allow timesharing among several singletasking operating systems in some respects a system virtual machine can be considered a generalization of the concept of virtual memory that historically preceded it ibms cpcms the first systems to allow full virtualization implemented time sharing by providing each user with a singleuser operating system the conversational monitor system cms unlike virtual memory a system virtual machine entitled the user to write privileged instructions in their code this approach had certain advantages such as adding inputoutput devices not allowed by the standard system as technology evolves virtual memory for purposes of virtualization new systems of memory overcommitment may be applied to manage memory sharing among multiple virtual machines on one computer operating system it may be possible to share memory pages that have identical contents among multiple virtual machines that run on the same physical machine what may result in mapping them to the same physical page by a technique termed kernel samepage merging ksm this is especially useful for readonly pages such as those holding code segments which is the case for multiple virtual machines running the same or similar software software libraries web servers middleware components etc the guest operating systems do not need to be compliant with the host hardware thus making it possible to run different operating systems on the same computer eg windows linux or prior versions of an operating system to support future software the use of virtual machines to support separate guest operating systems is popular in regard to embedded systems a typical use would be to run a realtime operating system simultaneously with a preferred complex operating system such as linux or windows another use would be for novel and unproven software still in the developmental stage so it runs inside a sandbox virtual machines have other advantages for operating system development and may include improved debugging access and faster reboots multiple vms running their own guest operating system are frequently engaged for server consolidation process virtual machines see also application virtualization runtime system and comparison of application virtualization software a process vm sometimes called an application virtual machine or managed runtime environment mre runs as a normal application inside a host os and supports a single process it is created when that process is started and destroyed when it exits its purpose is to provide a platformindependent programming environment that abstracts away details of the underlying hardware or operating system and allows a program to execute in the same way on any platform a process vm provides a highlevel abstraction that of a highlevel programming language compared to the lowlevel isa abstraction of the system vm process vms are implemented using an interpreter performance comparable to compiled programming languages can be achieved by the use of justintime compilation this type of vm has become popular with the java programming language which is implemented using the java virtual machine other examples include the parrot virtual machine and the net framework which runs on a vm called the common language runtime all of them can serve as an abstraction layer for any computer language a special case of process vms are systems that abstract over the communication mechanisms of a potentially heterogeneous computer cluster such a vm does not consist of a single process but one process per physical machine in the cluster they are designed to ease the task of programming concurrent applications by letting the programmer focus on algorithms rather than the communication mechanisms provided by the interconnect and the os they do not hide the fact that communication takes place and as such do not attempt to present the cluster as a single machine unlike other process vms these systems do not provide a specific programming language but are embedded in an existing language typically such a system provides bindings for several languages eg c and fortran examples are parallel virtual machine pvm and message passing interface mpi they are not strictly virtual machines because the applications running on top still have access to all os services and are therefore not confined to the system model history see also history of cpcms and timeline of virtualization development both system virtual machines and process virtual machines date to the 1960s and continue to be areas of active development system virtual machines grew out of timesharing as notably implemented in the compatible timesharing system ctss timesharing allowed multiple users to use a computer concurrently each program appeared to have full access to the machine but only one program was executed at the time with the system switching between programs in time slices saving and restoring state each time this evolved into virtual machines notably via ibms research systems the m4444x which used partial virtualization and the cp40 and simmon which used full virtualization and were early examples of hypervisors the first widely available virtual machine architecture was the cp67cms see history of cpcms for details an important distinction was between using multiple virtual machines on one host system for timesharing as in m4444x and cp40 and using one virtual machine on a host system for prototyping as in simmon emulators with hardware emulation of earlier systems for compatibility date back to the ibm system360 in 1963 while the software emulation thencalled simulation predates it process virtual machines arose originally as abstract platforms for an intermediate language used as the intermediate representation of a program by a compiler early examples date to around 1966 an early 1966 example was the ocode machine a virtual machine that executes ocode object code emitted by the front end of the bcpl compiler this abstraction allowed the compiler to be easily ported to a new architecture by implementing a new back end that took the existing ocode and compiled it to machine code for the underlying physical machine the euler language used a similar design with the intermediate language named p portable significant advances occurred in the implementation of smalltalk80 particularly the deutschschiffmann implementation which pushed justintime jit compilation forward as an implementation approach that uses process virtual machine later notable smalltalk vms were visualworks the squeak virtual machine and strongtalk a related language that produced a lot of virtual machine innovation was the self programming language which pioneered adaptive optimization and generational garbage collection these techniques proved commercially successful in 1999 in the hotspot java virtual machine other innovations include having a registerbased virtual machine to better match the underlying hardware rather than a stackbased virtual machine which is a closer match for the programming language in 1995 this was pioneered by the dis virtual machine for the limbo language full virtualization full virtualization logical diagram of full virtualization in full virtualization the virtual machine simulates enough hardware to allow an unmodified guest os one designed for the same instruction set to be run in isolation this approach was pioneered in 1966 with the ibm cp40 and cp67 predecessors of the vm family examples outside the mainframe field include parallels workstation parallels desktop for mac virtualbox virtual iron oracle vm virtual pc virtual server hyperv vmware workstation vmware server discontinued formerly called gsx server vmware esxi qemu adeos maconlinux win4bsd win4lin pro and egenera vblade technology hardwareassisted virtualization hardwareassisted virtualization in hardwareassisted virtualization the hardware provides architectural support that facilitates building a virtual machine monitor and allows guest oses to be run in isolation for use with vm370 the first virtual machine operating system offered by ibm as an official product in 2005 and 2006 intel and amd provided additional hardware to support virtualization sun microsystems now oracle corporation added similar features in their ultrasparc tseries processors in 2005 examples of virtualization platforms adapted to such hardware include kvm vmware workstation vmware fusion hyperv windows virtual pc xen parallels desktop for mac oracle vm server for sparc virtualbox and parallels workstation in 2006 firstgeneration 32 and 64bit x86 hardware support was found to rarely offer performance advantages over software virtualization operatingsystemlevel virtualization operatingsystemlevel virtualization in operatingsystemlevel virtualization a physical server is virtualized at the operating system level enabling multiple isolated and secure virtualized servers to run on a single physical server the guest operating system environments share the same running instance of the operating system as the host system thus the same operating system kernel is also used to implement the guest environments and applications running in a given guest environment view it as a standalone system the pioneer implementation was freebsd jails other examples include docker solaris containers openvz linuxvserver lxc aix workload partitions parallels virtuozzo containers and icore virtual accounts computing portal amazon machine image linux containers native development kit storage hypervisor universal turing machine virtual appliance virtual backup appliance virtual disk image virtual dos machine vdm virtual machine escape james e smith ravi nair virtual machines versatile platforms for systems and processes morgan kaufmann may 2005 isbn1558609105 656 pages covers both process and system virtual machines craig iain d virtual machines springer 2006 isbn1852339691 269 pages covers only process virtual machines mendel rosenblum august 31 2004 the reincarnation of virtual machines acm queue vol2 no5 how to create and use a virtual machine sandia national laboratories runs 1 million linux kernels as virtual machines the design of the inferno virtual machine by phil winterbottom and rob pike software portability by virtual machine emulation by stefan vorkoetter a virtual machine for building virtual machines vtevirtualization softwarecomparison of platform virtualization softwarehardwarevirtualizationhypervisorsnative adeos cpcms hyperv kvm red hat enterprise virtualization ldoms oracle vm server for sparc logical partition lpar lynxsecure pikeos proxmox ve simmon vmware esxi vmware vsphere vcloud vmware infrastructure xen oracle vm server for x86 xenclient xtratum zvm hostedspecialized basilisk ii bhyve bochs cooperative linux dosbox dosemu pcem pikeos sheepshaver simh windows on windows virtual dos machine win4lin independent microsoft virtual server parallels workstation parallels desktop for mac parallels server for mac pearpc qemu virtualbox virtual iron vmware fusion vmware player vmware server vmware workstation windows virtual pc tools ganeti ovirt system center virtual machine manager virtual machine manager oslevelvirtualizationos containers freebsd jail icore virtual accounts linuxvserver lmctfy lxc openvz solaris containers workload partitions application containers docker rkt kernel features cgroups namespaces seccomp orchestration ecs kubernetes desktopvirtualization citrix xenapp citrix xendesktop remote desktop services vmware horizon view ulteo open virtual desktop applicationvirtualization ceedo citrix xenapp dalvik installfree microsoft appv remote desktop services symantec workspace virtualization turbo vmware thinapp zerovm networkvirtualization distributed overlay virtual ethernet dove nvgre open vswitch virtual security switch virtual extensible lan vxlan see also list of emulators vtemajor fields of computer sciencenote this template roughly follows the 2012 acm computing classification systemhardware printed circuit board peripheral integrated circuit very large scale integration systems on chip socs energy consumption green computing electronic design automation hardware acceleration computer systemsorganization computer architecture embedded system realtime computing dependability networks network architecture network protocol network components network scheduler network performance evaluation network service software organization interpreter middleware virtual machine operating system software quality software notationsand tools programming paradigm programming language compiler domainspecific language modeling language software framework integrated development environment software configuration management software library software repository software development software development process requirements analysis software design software construction software deployment software maintenance programming team opensource model theory of computation model of computation formal language automata theory computational complexity theory logic semantics algorithms algorithm design analysis of algorithms algorithmic efficiency randomized algorithm computational geometry mathematicsof computing discrete mathematics probability statistics mathematical software information theory mathematical analysis numerical analysis informationsystems database management system information storage systems enterprise information system social information systems geographic information system decision support system process control system multimedia information system data mining digital library computing platform digital marketing world wide web information retrieval security cryptography formal methods security services intrusion detection system hardware security network security information security application security humancomputerinteraction interaction design social computing ubiquitous computing visualization accessibility concurrency concurrent computing parallel computing distributed computing multithreading multiprocessing artificialintelligence natural language processing knowledge representation and reasoning computer vision automated planning and scheduling search methodology control method philosophy of artificial intelligence distributed artificial intelligence machine learning supervised learning unsupervised learning reinforcement learning multitask learning crossvalidation graphics animation rendering image manipulation graphics processing unit mixed reality virtual reality image compression solid modeling appliedcomputing ecommerce enterprise software computational mathematics computational physics computational chemistry computational biology computational social science computational engineering computational healthcare digital art electronic publishing cyberwarfare electronic voting video games word processing operations research educational technology document management book category portal wikiproject commons 