The easiest way to think of a virtual machine (VM) would be as a computer within a computer. Current technology and processing power now allow for easy creation of virtual computing environments within a “host” computer. Read on to learn what this means and how you can take advantage of this technology.
Operating systems run off of a kernel (a program that controls the necessary functions and access to hardware) and a file structure full of binary programs and data.
With current technology, it is now possible for a computer to share its resources in order to run a separate kernel and operating system. In some enterprise networks, virtual machine hosting can save costs by making better use of hardware.
Or, on a smaller scale, a host computer can emulate alternative software for the purposes of testing, development, research, or recreation.
A physical server that creates and manages virtual machines is called a hypervisor. A hypervisor can slice (or, “partition”) a portion of drive space and allocate memory so that, in essence, a separate computer can run within a computer.
But why use multiple virtual machines instead of using a separate computer? Virtualization software can save costs, depending on how your server’s resources are allocated.
For example, imagine you have a dedicated (or, a dedicated bare metal server) physical computer but you’re only using a fraction of the resources for your main applications. With a VM architecture, you could divide one bare metal server into multiple servers and thus save costs over the long term.
Are VMs slower than a real computer? Speed optimization depends on how the engineer or system administrator has allocated resources. Proper use of a hypervisor means that all resources are allocated properly to ensure adequate performance in all VMs.
There are many different types of VMs but two major types of hypervisors. In this article, we’re referencing hypervisors of the first type, in which a host computer is segmented to host multiple virtual machines. For most enterprise “cloud computing” functions, like the OpenStack project, this is the type of hypervisor being used. Real hardware costs may outweigh the costs of multiple VMs.
But this is not always the case. Sometimes, the hypervisor (host computer) is just an ordinary desktop computer running virtual software. To take an easy example, software emulation is often used for gaming; with a VM, a gamer can install and run games that were written only to work on a different platform. For example, if you run a Linux operating system but want to run Windows games, software emulation via a VM application, VMware Workstation, or VirtualBox for example, can help you.
What Is The Use of a VM?
VMs help out with a variety of real-world applications.
Virtual machines are often employed for software development, data recovery, and cloud computing.
By creating and managing a virtual environment, developers are able to recreate precise conditions on multiple workstations. This way, a piece of software can be easily tested and complied in reproducible circumstances.
In the most basic sense, this kind of compliance can help developers avoid a scenario in which software runs great on one workstation but not on a different workstation.
Basically, with a VM you can match your development area to your production environment exactly.
With VMs, any host OS can run any guest OS.
Docker and Ansible
Programs like Docker and Ansible let you create reproducible container environments that are open/closed and shared across your network or with other users on separate workstations.
Ansible provides a platform for creating and maintaining server or VM specifications. Docker handles various software containers that can be deployed in various environments. Used together, you can automate the provisioning of VMs and software containers.
In an example scenario, Ansible uses an “inventory” to track what kind of server stack you want to replicate. For example, if you want an inventory that consists of everything you’ll need for a basic web server (Linux, MySQL, PHP, Apache, and perhaps Nginx) you can use the Ansible inventory to reflect these packages. Ansible uses the YAML programming language to build the inventory.
All you need to do in this instance is add these pieces of software to your inventory and Ansible can spin them up in a virtual environment. Likewise, the same inventory could be used within one physical server to spin up multiple virtual machines.
On a smaller scale, you can use Docker locally to quickly spin up virtual software containers. For example, if you want to test something in a fresh Linux installation you can use Docker to create the necessary dependencies. This is, in essence, a virtual instance because it’s not an independent computer system, but rather it requires the host computer in order to run.
VMs and Data Recovery
VMs can be used to recover data by acting as virtual storage containers. Applications like VMware, VirtualBox, and Virtuozzo, can be used to launch and manage virtual environments across a network of physical hardware.
Using a VM as a backup disk can provide an extra layer of security by separating the data recovery system from the live production environment. This also reduces the impact of any compromised software or system exploits.
Cloud Computing on VM Platforms
Virtual machines play a key role in what has become known as “cloud computing.”
Large-scale data services can now manage a massive fleet of computers and sell space on their infrastructure for virtual computer. (This is what you may hear referred to as “Infrastructure as a service,” or, “IAAS.”)
Since virtual machines are basically containers on a computer that run software, there are too many types of virtual machines to list.
Most often, the hypervisor computer will run open source software like OpenStack to manage the VMs.
As far as VMs themselves, the possibilities are limitless. It all depends on the operating system and your custom configuration.
For example, you could install a virtual machine running a popular Linux operating system like Ubuntu. Then there may be variations beyond that.
Likewise, you could have a custom installation of Ubuntu with a laundry list of favorite software packages pre-installed. Check out our guides on Ansible and Docker for more information about how to accomplish this.
The level of customization is unlimited, thus VMs are essentially limited only to the resources available on the host computer.