Virtual machine

From Wikipedia, the free encyclopedia
  (Redirected from Virtual Machine)
Jump to: navigation, search

In computing, a virtual machine (VM) is an emulation of a given computer system. Virtual machines operate based on the computer architecture and functions of a real or hypothetical computer, and 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 complete substitute for the targeted real machine and a level of function needed to execute a full operating system. A hypervisor uses native execution to share and manage hardware, allowing multiple different environments, isolated from each other, to be executed on the same physical machine. Modern hypervisors use hardware-assisted virtualization, which provides efficient and full virtualization by using virtualization-specific hardware capabilities, primarily from the host CPUs. Process virtual machines are designed to execute one computer program by providing an abstracted and platform-independent program execution 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. Operating-system-level virtualization allows the resources of a computer to be partitioned via the kernel's 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[edit]

A VM or virtual machine was originally defined by Popek and Goldberg as "an efficient, isolated duplicate of a real machine." Current use includes virtual machines which have no direct correspondence to any real hardware.[1]

System virtual machines[edit]

The desire to run multiple operating systems was the initial motive for virtual machines, so as to allow time-sharing among several single-tasking operating systems. In some respects, a system virtual machine can be considered a generalization of the concept of virtual memory that historically preceded it. IBM's CP/CMS, the first systems to allow full virtualization, implemented time sharing by providing each user with a single-user 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 input/output devices not allowed by the standard system.[2]

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. This is especially useful for read-only 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 (e.g., Windows, Linux, or prior versions of an operating system) to support future software.[3]

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 real-time 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.[4]

Multiple VMs running their own guest operating system are frequently engaged for server consolidation.[5]

History[edit]

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 time-sharing, as notably implemented in the Compatible Time-Sharing System (CTSS). Time-sharing 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 IBM's research systems: the M44/44X, which used partial virtualization, and the CP-40 and SIMMON, which used full virtualization and were early examples of hypervisors. The first widely available virtual machine architecture was the CP-67/CMS; see History of CP/CMS for details. An important distinction was between using multiple virtual machines on one host system for time-sharing, as in M44/44X and CP-40, 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 360 in 1963,[6][7] while the software emulation (then-called "simulation") predates it.

While the emulators have continued to be used for compatibility and to combat obsolescence, time-sharing and virtualization fell relatively out of fashion since the late 1970s through early 1990s due to the personal computing revolution, which shifted attention to individual microcomputers. With the rise of the Internet from the mid-1990s and client-server computing, attention returned to virtualization in server farms and cloud computing. A significant player has been VMware, since 1998, which virtualized the x86 architecture, allowing programs targeting personal computers to run inside virtual machines.

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 O-code machine, a virtual machine which executes O-code (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 O-code 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).[8] This was popularized around 1970 by Pascal, notably in the Pascal-P system (1973) and Pascal-S compiler (1975), in which it was termed p-code and the resulting machine as a p-code machine. This has been influential, and virtual machines in this sense have been often generally called p-code machines. In addition to being an intermediate language, Pascal p-code was also executed directly by an interpreter implementing the virtual machine, notably in UCSD Pascal (1978); this influenced later interpreters, notably the Java virtual machine (JVM). Another early example was SNOBOL4 (1967), which was written in the SNOBOL Implementation Language (SIL), an assembly language for a virtual machine, which was then targeted to physical machines by transpiling to their native assembler via a macro assembler.[9] Macros have since fallen out of favor, however, so this approach has been less influential.

Significant advances occurred in the implementation of Smalltalk-80,[10] particularly the Deutsch/Schiffmann implementation[11] which pushed just-in-time (JIT) compilation forward as an implementation approach that uses process virtual machine.[12] Later notable Smalltalk VMs were VisualWorks, the Squeak Virtual Machine[13] and Strongtalk.[14] A related language that produced a lot of virtual machine innovation was the Self programming language,[15] which pioneered adaptive optimization[16] and generational garbage collection. These techniques proved commercially successful in 1999 in the HotSpot Java virtual machine.[17] Other innovations include having a register-based virtual machine, to better match the underlying hardware, rather than a stack-based 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.

Modern uses of virtual machines, either as an intermediate target for compilation or as a platform to implement directly in an interpreter, continue as seen in the Android Runtime (ART) released in 2013, which compiles bytecode to native code, and the earlier Dalvik virtual machine, which interprets bytecode.

Hardware virtualization techniques[edit]

See also[edit]

References[edit]

  1. ^ Smith, James; Nair, Ravi (2005). "The Architecture of Virtual Machines". Computer. IEEE Computer Society. 38 (5): 32–38. doi:10.1109/MC.2005.173. 
  2. ^ Smith and Nair, pp. 395–396
  3. ^ Oliphant, Patrick. "Virtual Machines". VirtualComputing. Retrieved 23 September 2015. Some people use that capability to set up a separate virtual machine running Windows on a Mac, giving them access to the full range of applications available for both platforms. 
  4. ^ Super Fast Server Reboots – Another reason Virtualization rocks. vmwarez.com (2006-05-09). Retrieved on 2013-06-14.
  5. ^ "Server Consolidation and Containment With Virtual Infrastructure" (PDF). VMware. 2007. Retrieved 2015-09-29. 
  6. ^ Pugh, Emerson W. (1995). Building IBM: Shaping an Industry and Its Technology. MIT. p. 274. ISBN 0-262-16147-8. 
  7. ^ Pugh, Emerson W.; et al. (1991). IBM's 360 and Early 370 Systems. MIT. ISBN 0-262-16123-0.  pages 160-161
  8. ^ Wirth, N.; Weber, H. (1966). EULER: a generalization of ALGOL, and its formal definition: Part II, Communications of the Association for Computing Machinery, Vol.9, No.2, pp.89-99. New York: ACM. 
  9. ^ Griswold, Ralph E. The Macro Implementation of SNOBOL4. San Francisco, CA: W. H. Freeman and Company, 1972 (ISBN 0-7167-0447-1), Chapter 1.
  10. ^ Goldberg, Adele; Robson, David (1983). Smalltalk-80: The Language and its Implementation. Addison-Wesley Series in Computer Science. Addison-Wesley. ISBN 0-201-11371-6. 
  11. ^ Deutsch, L. Peter; Schiffman, Allan M. (1984). "Efficient implementation of the Smalltalk-80 system". POPL. Salt Lake City, Utah: ACM. doi:10.1145/800017.800542. ISBN 0-89791-125-3. 
  12. ^ Aycock, John (2003). "A brief history of just-in-time". ACM Comput. Surv. 35 (2): 97–113. doi:10.1145/857076.857077. 
  13. ^ Ingalls, Dan; Kaehler, Ted; Maloney, John; Wallace, Scott; Kay, Alan (1997). "Back to the future: the story of Squeak, a practical Smalltalk written in itself". OOPSLA '97: Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications. New York, NY, USA: ACM Press. pp. 318–326. doi:10.1145/263698.263754. ISBN 0-89791-908-4. 
  14. ^ Bracha, Gilad; Griswold, David (1993). "Strongtalk: Typechecking Smalltalk in a Production Environment". Proceedings of the Eighth Annual Conference on Object-oriented Programming Systems, Languages, and Applications. OOPSLA '93. New York, NY, USA: ACM. pp. 215–230. doi:10.1145/165854.165893. ISBN 978-0-89791-587-8. 
  15. ^ Ungar, David; Smith, Randall B (December 1987). "Self: The power of simplicity". ACM SIGPLAN Notices. 22: 227–242. doi:10.1145/38807.38828. ISSN 0362-1340. 
  16. ^ Hölzle, Urs; Ungar, David (1994). "Optimizing dynamically-dispatched calls with run-time type feedback". PLDI. Orlando, Florida, United States: ACM. pp. 326–336. doi:10.1145/178243.178478. ISBN 0-89791-662-X. 
  17. ^ Paleczny, Michael; Vick, Christopher; Click, Cliff (2001). "The Java HotSpot server compiler". Proceedings of the Java Virtual Machine Research and Technology Symposium on Java Virtual Machine Research and Technology Symposium - Volume 1. Monterey, California: USENIX Association. 

Further reading[edit]

  • James E. Smith, Ravi Nair, Virtual Machines: Versatile Platforms For Systems And Processes, Morgan Kaufmann, May 2005, ISBN 1-55860-910-5, 656 pages (covers both process and system virtual machines)
  • Craig, Iain D. Virtual Machines. Springer, 2006, ISBN 1-85233-969-1, 269 pages (covers only process virtual machines)

External links[edit]