Friday, August 5, 2011

What is virtual machine (VM)?

A virtual machine (VM) is an environment, usually a program or operating system, which does not physically exist but is created within another environment. In this context, a VM is called a "guest" while the environment it runs within is called a "host." Virtual machines are often created to execute an instruction set different than that of the host environment. One host environment can often run multiple VMs at once. Because VMs are separated from the physical resources they use, the host environment is often able to dynamically assign those resources among them.
The phrase "virtual machine" is commonly used to describe Java runtime environment, the Java Virtual Machine (JVM), in which Java-specific commands are interpreted. The JVM is a virtual machine in that it executes code compiled specifically for it – known as bytecode – and abstracts use of resources for this bytecode. The Java programming language does not rely on platform-specific instruction sets, such as APIs specific to any one operating system, to display output or access resources such as files. Instead, the JVM creates virtualized resources which the bytecode accesses. These actions are then passed on to the machine's actual resources.
A user interacting with a virtualized server can view the server as a physical machine, in the sense that the user would see access to machines resources like hard disks, RAM, processors and Ethernet connections. In fact, all of these machine resources are virtual. For instance, instead of accessing a real hard disk, the user is accessing a construct of the host environment. This construct then accesses the real disk to record the data.
"A running program is often referred to as a virtual machine - a machine that doesn't exist as a matter of actual physical reality. The virtual machine idea is itself one of the most elegant in the history of technology and is a crucial step in the evolution of ideas about software. To come up with it, scientists and technologists had to recognize that a computer running a program isn't merely a washer doing laundry. A washer is a washer whatever clothes you put inside, but when you put a new program in a computer, it becomes a new machine. . . The virtual machine: A way of understanding software that frees us to think of software design as machine design." -From David Gelernter's "Truth, Beauty, and the Virtual Machine," Discover Magazine, September 1997, p. 72.