We can’t directly observe how things work, at least not with human eyes. Analogies are our best tool. The more analogies, the better. Thankfully, we have a lot of modern abstract analogies to pull from. Virtual machines are a fantastic and useful modern analogy for physical reality.
Virtual machines are the best
A virtual machine (VM or VMM) is a computer program that behaves like a separate computer. They come in different flavors (type-1, type-2, etc) but they all process computer instructions exactly like a physical computer would. Examples include the following.
- Parallels on Macs
- Hyper-V on Windows
- VMWare, VirtualBox, Xen, etc
One can install this VM software and run any number of virtual machines at the click of a button. Whatever operating system gets installed barely knows it’s not real physical hardware. Why would anybody bother? A person with a MacBook on their lap can switch between MacOS, Windows 7/10/11, and Linux at the swipe of a touchpad. Linux users can use a Windows VM whenever they need to access a flaky website or printer driver. Windows users can get real work done on a Linux VM.
The analogy
Besides the obvious productivity boost (you’re welcome), why do we care? Because it’s a useful analogy for a very familiar virtual environment.
A virtual machine will create an environment (the guest) entirely foreign to the host computer. The guest operating system (OS) can be completely incompatible with the host operating system. They have a few rules in common, like the computer architecture (e.g. Intel processor but think LOA). Beyond that, the way the intel chip is used (e.g. calling conventions, system calls, libraries) can be entirely foreign and new.
Within the host computer, one can launch any number of these guest environments with the click of a mouse and have complete control over them. We can introduce new virtual hardware, random changes to memory, hard disk, running programs, files, and directories because none of it is really real – it’s virtual. On the other hand, within the guest computer systems, it’s business as usual. The guest software follows the same strict rules as any computer system.
Because of this arbitrary control, VM software is often called a hypervisor. It does more than a mere supervisor, it creates and administers the very existence of the environment. Hyper meaning over, beyond, or above is an appropriate prefix, we think.
The connection to virtual reality
What we said above about the guest operating system barely knowing it’s on virtual hardware isn’t always true. VM software can be made to look like actual physical hardware, but there are more useful applications otherwise. More often, you have what’s called paravirtualization which is where the guest operating system is helped to understand it’s on virtual hardware. Paravirtualization is certainly more efficient as a paravirtualized guest OS knows to play nicely with its neighbors (the host computer still has limited resources).
Paravirtualization is also more useful. One can cut and paste into a paravirtualized system, set the time, share folders, shut down safely, manipulate files, start or end programs, and much more.
Paravirtualization is more complicated for VM software though. There needs to be a sequence of interconnected elements all the way from the VM software in the host down to programs running as part of the guest. Let’s call this chain the psyche.
The Psyche
- The VM software exposes paravirtualized features to be turned on/off or configured
- The VM software implements those features directly with virtual hardware modifications (like adjusting time or memory) or along some non-standard interface into the virtual hardware. This operates at the level of the hypervisor in the host operating system.
- The guest operating system needs some kind of driver(s) or operating system modification to interact with the non-standard interface. This operates at the level of the guest operating system in the traditional privileged supervisor OS code.
- The guest operating system needs some kind of guest tools installed to be run as typical programs.
Items 1 and 2 of the psyche (involving VM software features) make sense on their own. Items 3 and 4 require guest software to be installed (guest addition software is typical and can be installed by virtual CD-ROM or USB drive). Windows 10 onward is pre-built with Hyper-V awareness baked in, so maybe it doesn’t need guest software additions.
The magic of virtual reality
The guest additions software, level 4, is particularly relevant to us – think of yourself as a level 4 program. Level 4 code follows the same rigid rules as everything else in the guest, and by itself, it can’t do anything atypical or magical. Where things get cool is that purely by virtue of knowing the interface with psyche levels 2 and 3, it can work magic. It can and does request anything it can think to request. Anything within the guest software can change thanks to its connection with level 3, and anything about the guest virtual hardware can change because of its (chained) connection to level 2. Together, it seems nothing is impossible.
Can item 4 request a directory be filled with loaves and fishies? Of course, but why would it?
Can item 4 request the water.txt get turned into wine.txt? Yes, yes, we get the point.
“All these works and greater shall you do because I go to the father.”
Jesus
All the Christs and Masters say the same thing. They all say that we cannot do anything alone, but if you simply ask the next level up, then all will be given.
As total nerds, we think this is a very cool model for who we really are. Holodecks give a better analogy for physical reality, but the virtual machines analogy here inspires greater allowing by showing how much control we have once we understand the interface, that is, the actual rules.