Virtual machine

from Wikipedia, the free encyclopedia
Virtual machine in VirtualBox

In computer science, the software- technical encapsulation of a computer system within an executable computer system is called a virtual machine ( VM ) . The virtual machine simulates the computer architecture of a real hardware computer or a hypothetical computer.

The abstracting layer between the real or host or host computer on which the virtual machine is running and the virtual machine is called a hypervisor or virtual machine monitor and its implementation is purely hardware-based, purely software-based or a combination of both. As a rule, the hypervisor allows several virtual machines to be operated simultaneously on one physical computer.

In contrast to emulators , virtual machines are executed directly on the host computer's CPU and usually use the CPU's virtualization functions. Emulators are implemented purely as software, which means that a different computer architecture than that of the host computer can be simulated.

Types of virtual machines

Today, virtual machines are classified according to the extent to which they simulate the functionality of a real computer. System-based virtual machines reproduce a computer so completely that operating systems that were designed for the real computer can be run on the virtual machine in the same way as on the corresponding real computer. This approach is also known as full virtualization . It is essentially based on the definition given by Robert Goldberg and narrowed down by Gerald Popek in 1972:

"A virtual machine is an efficient, identical, and isolated duplicate of a real processor."

Examples of well-known products that implement virtualization using system-based virtual machines are Oracle's VirtualBox or VMware's vSphere .

In contrast, process-based virtual machines only allow individual programs to be executed in an abstract manner from the execution environment of a computer architecture by providing a runtime environment based on them. Such virtual machines are usually provided on several computer architectures, which means that the application can then be executed on all of these platforms without any changes. Well-known examples of such environments with corresponding virtual machines are the Java runtime environment as part of the Java platform and the common language runtime as part of the .NET framework .

System-based virtual machines

history

The desire to be able to run several operating systems on one computer at the same time was the original motivation for introducing system-based virtual machines. IBM's CP / CMS , first published in 1966, was the first operating system to support complete virtualization, thereby allowing multiple users to simultaneously use their own individual user operating systems on one physical computer.

In their 1974 article Formal Requirements for Virtualizable Third Generation Architectures , Gerald J. Popek and Robert P. Goldberg laid the formal foundations and set out the basic requirements for an architecture to support virtual machines with the help of a hypervisor.

Advantages and disadvantages of using system-based virtual machines

The use of system-based virtual machines offers several advantages over the direct execution of operating systems on the computer :

Multiple operating systems at the same time
Different operating systems can be operated simultaneously on the same physical machine. This means that the resources of the physical computer (e.g. the processor) can be better used, since these can be shared by several operating systems. Different operating system versions or systems from different operating system manufacturers can also be operated in parallel.
Support of different instruction sets
The virtual machine can support an instruction set architecture that is different from the physical machine. This means that operating systems can be run that would not even run on the real hardware.
Cheaper and simplified operation
In data centers in particular, a large number of systems have to be operated in parallel. The use of virtual machines means that separate hardware does not have to be provided for each system, rather different systems share a very powerful platform. Since the operation of a very powerful platform is usually more economical than the operation of many smaller platforms with (overall) the same performance, the virtualization approach for data centers (see also recentralization ) is a good choice .

However, these advantages are “bought” with some disadvantages that result from running the operating system directly on the computer:

Loss of efficiency
A virtual machine is less efficient than the real machine, as part of its performance has to be used to operate the hypervisor (to manage the virtual machines).
Mutual influencing of simultaneously operated virtual machines
If several virtual machines are operated in parallel, separation is ensured by the hypervisor, but they share the (limited) resources of the physical computer. Since the load behavior of other virtual machines cannot be foreseen or influenced for an individual VM, peak loads can lead to unstable or unpredictable performance of individual or all simultaneously operated virtual machines if the hypervisor does not take special precautions (e.g. by guaranteeing Resources for individual VMs).
New challenges in terms of security and data protection
Protection mechanisms against viruses and malware were previously implemented at the operating system level and thus protected the user. The use of hypervisors creates a new possibility of attack, namely the hypervisor itself to execute malicious code on the computer. Therefore, new protection mechanisms are required beyond those previously known.
New challenges regarding the licensing of operating systems
While the licensing of an operating system used to be tied to a particular physical computer with its properties (e.g. number of processors, memory size), this is no longer easily possible with virtualization. A computer no longer has to exist with the actual memory size or number of processors; it may only exist virtually. This forces manufacturers and customers to grapple with what are sometimes quite complicated license models. Certain manufacturers (e.g. Apple ) also do not allow their operating systems to be virtualized at all. However, the legal validity of this ban is disputed in Germany.

Methods

Hypervisor
Hardware emulation
Hardware virtualization
Paravirtualization

Application scenarios

Process-based virtual machines

history

The history of process-based virtual machines began with the seminal essay Transportability of Software Applications on Microcomputers by W. Wellbourne (1983) and the previous work A Comparison of Pascal Intermediate Languages by P. Nelson (1979). The aim here is to solve the problem of executing application code that was developed for one computer architecture without making changes to another computer architecture. In particular, to keep the porting effort for applications from one architecture to another (e.g. new computer architectures) low.

Advantages and disadvantages of using process-based virtual machines

The use of process-based virtual machines offers the following advantages:

The use of process-based virtual machines has the following disadvantages:

  • Running a portable program on a portable virtual machine is slower than running a program natively that has been translated specifically for the target environment.
  • Using an interpreter results in additional indirections, which is more inefficient than direct execution.
  • Dynamic translation at runtime (JIT compiler) resolves most of the indirections and ensures mostly direct execution, but the translation itself requires additional effort until the code can be executed directly (but only at the moment of the translation, not during later runs ).

These disadvantages can be reduced by suitable (e.g. dynamic) optimization. Another option is automatic compilation using the ahead-of-time compiler immediately before execution. This means that the back end of a highly optimizing, machine-oriented compiler is executed directly on the user system. As a result, the compiler can carry out even more specific optimizations for the user's system than would be possible with a precompiled program without special optimizations for the user's system or processor.

Application scenarios

See also

literature

Web links

Individual evidence

  1. ^ Hans-Jürgen Siegert, Uwe Baumgarten: Operating systems . Oldenbourg, 2007, ISBN 3-486-58211-9 , p. 270
  2. James E. Smith, Ravi Nair, Virtual Machines: Versatile Platforms For Systems And Processes , Morgan Kaufmann, May 2005, ISBN 1-55860-910-5 , p. 8.
  3. ( Page no longer available , search in web archives: Lecture Systems I - Chapter 2 - Page 2 eLecture Uni Freiburg )@1@ 2Template: Toter Link / electures.informatik.uni-freiburg.de
  4. ^ A b Gerald J. Popek, Robert P. Goldberg: Formal Requirements for Virtualizable Third Generation Architectures . In: Communications of the ACM . 17, No. 7, 1974, pp. 412-421. doi : 10.1145 / 361011.361073 .
  5. James E. Smith, Ravi Nair, Virtual Machines: Versatile Platforms For Systems And Processes . Morgan Kaufmann, 2005, ISBN 1-55860-910-5 , p. 10
  6. ^ RJ Creasy: The origin of the VM / 370 time-sharing system . (PDF) In: IBM Journal of Research & Development , Vol. 25, No. 5 (September 1981), pp. 483-490 - perspective on CP / CMS and VM history by the CP-40 project lead, also a CTSS author
  7. Ferenc Bator: Virtual Machines ( Memento of the original from April 25, 2014 in the Internet Archive ) Info: The archive link was automatically inserted and not yet checked. Please check the original and archive link according to the instructions and then remove this notice. 2005 @1@ 2Template: Webachiv / IABot / www.devmatic-it.de