Virtual Machine’s

Kelly Becker
4 min readOct 12, 2020

An Operating System within an Operating System

Photo by Ash from Modern Afflatus on Unsplash

Think back a decade ago to the masterful Christopher Nolan film Inception. Remember the confusion of trying to understand who was dreaming what dream and what sort of reality/limbo each individual was currently part of. Fast forward to seven days ago…and here I was, experiencing a similar level of bewilderment as I set up my first Virtual Machine (VM).

What is A Virtual Machine?
At a very basic level, a virtual machine is software that allows us to run programs or applications without being physically tied to a particular machine. In a VM instance multiple guest machines can run on a host computer. Each VM instance will have its own operating system, which allows it to function separately from other VM’s (see how this starts to feel like inception). Because of VM’s, software is separated from the host computer, allowing for multiple operating systems to be run on a single piece of hardware.

The Two Times of Virtual Machines
1. Process VM
Process VM’s, sometimes called Managed Runtime Environment (MRE), run as a normal application inside a host OS and support a single process. It provides an abstracted, platform-independent programming environment, that allows a program to execute in the same way on any platform. Some common Process VM’s are Java Virtual Machine (JVM), Parrot Virtual Machine, and Common Language Runtime (which supports the .NET Framework)

2. System VM
A System Virtual Machine is a VM that provides a complete system platform and supports the execution of a complete Operating System. According to Popek and Goldberg a System VM is “an efficient, isolated duplicate of a real computer machine.” A system VM requires the use of a hypervisor, which is a software that runs the VM’s and provides a layer of abstraction between the host machine (in this case my laptop) and the guest machine (the VM).

What Problem Does a VM Solve?
VM’s make it possible to run many different kinds of operating systems on a single piece of hardware. Additionally VM’s make it possible to run multiple applications on one server in a safe and secure manner. This allows for more efficient use of a computers physical resources. Common use cases for a VM include

  • Trying a New Operating System
    Perhaps you are a windows user, but you want to learn the Linux OS
  • Handle Potential Malware
    Because a VM is isolated from your OS, you can take security risks you might not normally take, like downloading a program that you are not sure if the site it is coming from is legitimate.
  • Clone a System to Another Machine
    As long as each user has the same hypervisor, the VM can be used on another machine allowing for flexible collaboration
  • Testing an Application
    Simplify the workflow by testing apps and websites across multiple platforms
  • Running an old Application/Operating Systems
    The VM provides us with a platform to run software thats not compatible with our current machine

Basic Set Up of a Hypervisor and VM
1. VirtualBox
First step is to install a hypervisor. If you remember from earlier a hypervisor acts as the management system for one or more VM’s. There are several different options when it comes to Hypervisors. VMware created by Dell and often used for cloud computing, Hyper-V created by Microsoft, and VirtualBox created by Oracle. We are going to use VirtualBox. VirtualBox is simple to install and for Mac users will be available in applications following install. The VirtualBox dashboard allows for easy management and a visual of what VM’s are currently running.

VirtualBox dashboard with two VM’s (one is powered off and the other is running)

2. The Virtual Machine
The next part of set up is to choose what VM you will use. I will be using Vagrant, which provides a simple and easy to use command line client for management of VM’s. Once you download Vagrant select a box from their available options. The box allows you to have a standardized development environment. From the command line you will want to cd into the project directory, run the vagrant init command with the name of your box. Then fire up the VM with the vagrant up command. Within the VM you can install any version control, languages, frameworks, and packages you will be using.

Just like that you have an operating system within an operating system, and have successfully set up a safe and efficient way to test that new OS or seamlessly collaborate on an application. All for a lot less headache than trying to decipher whose dream you are experiencing in Inception, and no chance of somehow getting caught in a strange form of limbo that you can’t escape from.

References:
Virtual Machines According to Wikipedia
Vagrant Quick Setup Guide
Hypervisors According to Wikipedia
What is a Virtual Machine by Keith Shaw

--

--

Kelly Becker

Solutions Engineer | Former Healthcare Clinician. You can often find me biking around the city in my sparkle helmet or pretending I’m a Top Chef