Virtual Machine
Virtual Machine
Virtual Machine
The name of the game in software development is return on investment. Companies want to
invest money in software that will be useful long enough for the resources spent to be justified.
Porting a software package from one platform to another is costly and, depending on the
number of platforms supported, can prove to be a Sisyphean nightmare.
The worst-case scenario occurs when business logic is stranded on an aging system. Due to
historical forces, a large base of code may end up on an obsolete platform that no one wants to
deal with. The people who wrote the original code have either quit or been promoted and don't
remember anything (sometimes intentionally). The source code has been transformed by time
into an encrypted historical artifact that will require years of work by researchers to decipher.
If the language and tools used to develop the initial code are linked to the original platform,
porting may be out of the question. In pathological cases, the code may be so obscure and
illegible that maintenance engineers are too scared to touch anything. I'm sure Y2K
programmers are familiar with this type of imbroglio. The only recourse may be a complete
rewrite and this is an extremely expensive alternative, fraught with all sorts of dangers and
hidden costs. This is the kind of situation CIOs lose sleep over.
Using a virtual machine offers a degree of insurance against this kind of thing happening.
When confronted with a new hardware platform or operating system, the only application that
needs to be ported is the virtual machine itself. If a virtual machine is, say, 100,000 lines of
code, you might think that actually porting the code is a bad investment. 100,000 lines of code
is not a trivial porting job. However, let's say that the virtual machine runs an application suite
that consists of 11 million lines of code. Suddenly, porting the virtual machine is not such a
bad deal because the alternative would be to port the 11 million lines of application code. Don't
think that this isn't realistic. I once visited an automobile insurance company that had around
30 million lines of application code.
OBJECTIVE:
Objective was to build a virtual machine that satisfied three criterion. In order of priority,
these are:
1. Portability
2. Simplicity
3. Performance
Portability is the most important feature because being able to work with a uniform
software interface, across multiple platforms, is the primary benefit of using a virtual machine.
If you can't port a virtual machine, then you're stuck with a given platform, in which case you
might as well use tools that compile to the native machine encoding.
Portability is also the most important priority in the sense that I had to make sacrifices in
terms of simplicity and performance in order to achieve it. There is rarely a solution that is ever
optimal under all conditions in software engineering.
One way of boosting performance would be to make heavy use of assembly code.
However, using an assembler does not necessarily guarantee faster program execution. In order
to be able to justify using an assembler, the programmer has to have an intimate knowledge of
both the assembly code a compiler generates and the kind of optimizations it performs. The
goal is to be able to write faster assembly code than the compiler can. This requires a certain
amount of vigilance and skill because, in most cases, the optimizer in a C compiler can do a
better job than the average programmer.
Another problem with using assembly language is that it ties your code to the hardware
you're working on. To port the code to new hardware, you'll need to rewrite every single line of
assembly code. This can turn out to be much more work than you think. Again, in the effort to
maintain a certain degree of portability, I opted out of low-level, high-performance assembly
coding and wrote everything in ANSI C.
simplicity has priority over performance by virtue of my desire to make the code
maintainable. A year from now, I would like to be able to modify my code without having to
call in a team of archaeologists. Code that is optimized for performance can become very
brittle and resistant to change. Developers writing high-performance C code will often use all
sorts of misleading and confusing conventions, like bitwise shifting to divide by 2. What is
produced is usually illegible by anyone but the original developer, and given enough time even
the original developer may forget what he had done and why he had done it. In an extreme
case, a programmer who has created a mess and is too scared to clean it up may opt to quit and
go work somewhere else. I've heard people refer to this as "the final solution" or "calling in for
air support and pulling out."
Dept. of Computer Engineering, ICOER, Pune. 2
Virtual Machine
Run-time Systems
A run-time system is an environment in which computer programs execute. A run-time
system provides everything a program needs in order to run. For example, a run-time system is
responsible for allocating memory for an application, loading the application into the allocated
memory, and facilitating the execution of the program's instructions. If the program requests
services from the underlying operating system through the invocation of system calls, the run-
time system is in charge of handling those service requests. For instance, if an application
wants to perform file I/O, the run-time system must offer a mechanism to communicate with
the disk controller and provide read/write access.
There are different kinds of run-time systems. One way to classify run-time systems is to
categorize them based on how they execute a program's instructions. For programs whose
instructions use the processor's native machine encoding, the run-time system consists of a
tightly knit collaboration between the computer's processor and the operating system. The
processor provides a mechanism for executing program instructions. The CPU does nothing
more than fetch instructions from memory, which are encoded as numeric values, and perform
the actions corresponding to those instructions. The operating system implements the policy
side of a computer's native run-time system. The CPU may execute instructions, but the
operating system decides how, when, and where things happen. Think of the operating system
as a fixed set of rules the CPU has to obey during the course of instruction execution.
Thus, for programs written in native machine instructions, the computer itself is the run-
time system. Program instructions are executed at the machine level, by the physical CPU, and
the operating system manages how the execution occurs. This type of run-time system involves
a mixture of hardware and software.
Programs whose instructions are not directly executed by the physical processor require a
run-time system that consists entirely of software. In such a case, the program's instructions are
executed by a virtual machine. A virtual machine is a software program that acts like a
computer. It fetches and executes instructions just like a normal processor. The difference is
that the processing of those instructions happens at the software level instead of the hardware
level. A virtual machine also usually contains facilities to manage the path of execution and to
offer an interface to services normally provided by the native operating system.
Definitions
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.
Virtual machines are separated into two major categories, based on their use and degree of
correspondence to any real machine. A system virtual machine provides a complete system
platform which supports the execution of a complete operating system (OS). In contrast, a
process virtual machine is designed to run a single program, which means that it supports a
single process. An essential characteristic of a virtual machine is that the software running
inside is limited to the resources and abstractions provided by the virtual machine -- it cannot
break out of its virtual world.
Example: A program written in Java receives services from the Java Runtime Environment
(JRE) software by issuing commands to, and receiving the expected results from, the Java
software. By providing these services to the program, the Java software is acting as a "virtual
machine", taking the place of the operating system or hardware for which the program would
ordinarily be tailored.
• multiple OS environments can co-exist on the same computer, in strong isolation from
each other
• the virtual machine can provide an instruction set architecture (ISA) that is somewhat
different from that of the real machine
Multiple VMs each running their own operating system (called guest operating system) are
frequently used in server consolidation, where different services that used to run on individual
machines in order to avoid interference are instead run in separate VMs on the same physical
machine. This use is frequently called quality-of-service isolation (QoS isolation).
The desire to run multiple operating systems was the original motivation for virtual
machines, as it allowed time-sharing a single computer between several single-tasking OSes.
The guest OSes do not have to be all the same, making it possible to run different OSes on
the same computer (e.g., Microsoft Windows and Linux, or older versions of an OS in order to
support software that has not yet been ported to the latest version). The use of virtual machines
to support different guest OSes is becoming popular in embedded systems; a typical use is to
support a real-time operating system at the same time as a high-level OS such as Linux or
Windows.
Another use is to sandbox an OS that is not trusted, possibly because it is a system under
development. Virtual machines have other advantages for OS development, including better
debugging access and faster reboots.[2]
Alternate techniques such as Solaris Zones provides a level of isolation within a single
operating system. This does not have isolation as complete as a VM. A kernel exploit in a
system with multiple zones will affect all zones. Achieving the same goal in a virtual machine
implementation would require exploiting a weakness in the hypervisor. A hypervisor typically
has a smaller "attack surface" than a complete operating system, making this more challenging.
Further, a kernel exploit in a VM guest would not affect other VMs on the host, just as a
successful intrusion into one zone would not necessarily affect other zones. Zones are not
virtual machines, but an example of "operating-system virtualization". This includes other
"virtual environments" (also called "virtual servers") such as Virtuozzo, FreeBSD Jails, Linux-
VServer, chroot jail, and OpenVZ. These provide some form of encapsulation of processes
within an operating system. These technologies have the advantages of being more resource-
efficient than full virtualization and having better observability into multiple guests
simultaneously; the disadvantage is that, generally, they can only run a single operating system
and a single version/patch level of that operating system - so, for example, they cannot be used
to run two applications, one of which only supports a newer OS version and the other only
supporting an older OS version on the same hardware. However, Sun Microsystems has
enhanced Solaris Zones to allow some zones to behave like Solaris 8 or Solaris 9 systems by
adding a system call translator
This type of VM has become popular with the Java programming language, which is
implemented using the Java virtual machine. Another example is the .NET Framework, which
runs on a VM called the Common Language Runtime.
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 parallel 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 parallel 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 (e.g., C and FORTRAN). Examples are PVM (Parallel Virtual Machine) and
MPI (Message Passing Interface). They are not strictly virtual machines, as the applications
running on top still have access to all OS services, and are therefore not confined to the system
model provided by the "VM".
Linux • Xen
• Virtual Processor (VP) from Tao Group • IBM POWER SYSTEMS
(UK).
• VX32 virtual machine - application- OS-level virtualization software
level virtualization for native code
• Waba - Virtual machine for small • OpenVZ
devices, similar to Java • FreeVPS
• Warren Abstract Machine - Prolog, • Linux-VServer
CSC GraphTalk • FreeBSD Jails
• Z-machine - Z-Code • Solaris Containers
VMware Architecture
All the vm app work in complete isolation from each other. The app is given the impression
that it is working on the same platform as a normal process the user does not come out to know
any diff exits in the platform or the execution.
VMware Workstation
VMware Workstation is a virtual machine software suite for x86 and x86-64 computers
from VMware, a division of EMC Corporation. This software suite allows users to set up
multiple x86 and x86-64 virtual computers and to use one or more of these virtual machines
simultaneously with the hosting operating system. Each virtual machine instance can execute
its own guest operating system, such as Windows, Linux, BSD variants, or others. In simple
terms, VMware Workstation allows one physical machine to run multiple operating systems
simultaneously. Other VMware products help manage or migrate VMware virtual machines
across multiple host machines.
Besides bridging to existing host network adapters, CD-ROM devices, hard disk drives,
and USB devices, VMware Workstation also provides the ability to simulate some hardware.
For example, it can mount an ISO file as a CD-ROM, and .vmdk files as hard disks; and can
configure its network adapter driver to use network address translation (NAT) through the host
machine rather than bridging through it (which would require an IP address for each guest
machine on the host network).
VMware Workstation also allows the testing of live CDs without first burning them onto
physical discs or rebooting the computer. One can also take multiple successive snapshots of
an operating system running under VMware Workstation. Each snapshot allows you to roll
back the virtual machine to the saved status at any time. The ability to use multiple snapshots
makes VMware Workstation useful as a tool for salespersons demonstrating complex software
products, and for developers setting up virtual development or test environments. VMware
Workstation includes the ability to designate multiple virtual machines as a team which
administrators can then power on and off, suspend, and resume as a single object — making it
particularly useful for testing client-server environments.
Known issues
Hardware support
OS support
64-bit Solaris 10 1/06 (Update 1) and Solaris 10 6/06 (Update 2) fail with a triple fault on
Core 2 generation processors (this includes processors codenamed Merom, Woodcrest, and
Conroe). A Sun Microsystems blog has published a workaround for this issue.
Network protocols
VMware Workstation can swallow CPU interrupts, making maintenance of accurate time
difficult.[13] Network Time Protocol (NTP) servers should not be run under VMware.
VMware Tools
VMware Tools is a package with drivers and other software that can be installed in guest
operating systems to increase their performance.
Virtual appliance
A virtual appliance is a minimalist virtual machine image designed to run under some sort
of virtualization technology (like VMware Workstation, Citrix XenServer, VirtualBox or many
others).
Virtual appliances are a subset of the broader class of software appliances. Like software
appliances, virtual appliances are aimed to eliminate the installation, configuration and
maintenance costs associated with running complex stacks of software.
A key concept that differentiates a virtual appliance from a virtual machine is that a virtual
appliance is a fully pre-installed and pre-configured application and operating system
environment whereas a virtual machine is, by itself, without application software.
Typically a virtual appliance will have a web interface to configure the inner workings of
the appliance. A virtual appliance is usually built to host a single application, and so represents
a new way of deploying network applications.
Computing trends indicate that the data center of the future will likely include a hardware-
level virtualization layer and a control system. Services will run in virtual machines and will be
mapped onto available hardware resources. Not only will this greatly ease the management of
data centers, it will also ease the handling of new hardware, as well as failed hardware. The
failure of a single physical box will reduce the pool of available resources, not the availability
of a particular service.
Similarly, virtual machine technology will be used to allow aggressive innovation in the
area of system software, providing the ability to maintain backward compatibility. Virtual
machines will allow for the support of old applications, as well as the current versions, and will
test the deployment of new versions that are all based on the same hardware.
One consequence of Moore’s law of semiconductor growth has been the exponential
increase in the performance of computing systems. The overhead of a well-tuned hardware
virtualization system is extremely small compared with the performance increase. This means
that the computing industry can, for only a few percentage points of performance, realize the
huge benefits of hardware-level virtualization. Such benefits include the management of both
the hardware and the software that runs in virtual machines—currently a large expense in
modern computing environments.
Conclusion
In conclusion I would like to say that Virtual Machine is the prefect tool for the 21st century
to advance and become more powerful then it was ever before. A virtual-machine system is a
perfect vehicle for operating-systems research and development. By making the applications
platform independent and having multiple Os in a single machine have made the engineers to
use the full of its resources and manage it efficiently and give faster and better performance.
Bibliography
www.google.com
www.wikipedia.com