Thursday, June 12, 2014

Virtual Virtualization

I find it interesting and useful that we can run virtual machines inside virtual machines. I'm probably not the only one. Here's my story.

I recently bought a new PC running Windows 8. Rather than replace my older Vista-PC with it, I use the new machine over a Remote Desktop -connection, from the old machine.

That way I don't have to REPLACE the old one with the new, but can combine the processing power of both. I can use just a single keyboard and the same set of monitors for both. I also get to keep the existing applications and peripherals on the older machine, without compatibility issues, or having to buy new licenses for them.

The new machine running Windows-8  (which I use over remote-desktop-connection) runs a virtual machine running Windows-7, which I log into. From that Windows-7 session I take a VPN remote-desktop-connection to a PC on a client's site running also Windows-7. From there I take a remote connection to a physical server running a virtualized Windows -server. In that remote Windows Server -session I run a Java virtual machine.

A remote-desktop-connection is not usually considered a "virtual machine" but it kind of is, conceptually. It effectively  transforms my physical PC to look and behave like a machine that seems to virtually exist on it.  From my point of view it is a virtual machine, running on my physical (OR virtual) machine.

What about JavaVM? Is it really a virtual machine? Yes, it's name is officially Java Virtual Machine. It is one, it just doesn't typically run an OS. It just runs applications. Imagine that your PC would run just one or two applications on it's BARE METAL, no OS in between. That would make those applications  run and start fast. JavaVM is a virtual version of that scenario.  A Virtual Machine is not the same thing as an Operating System. An OS needs a machine, virtual or physical, to run on. But note, there is something called JavaOS.

If instead of Java I would develop on something like Pharo Smalltalk it would be even clearer that I was developing applications for a virtual machine ON a virtual machine. Pharo-VM runs its own virtual desktop and has the ability to save "snapshots" of the state of that VM on disk, and keep multiple copies of them around.

So, I have multiple layers of virtual machines running on virtual machines. And it all works great. Diagrammatically my configuration looks like this:

-> Windows Vista
-> Windows-8
-> Windows-7
-> Windows-7
-> Windows Server
-> Java Virtual Machine

You could think that having all those layers would affect performance negatively. But there are actually four physical machines involved whose combined processing power helps to make performance good. A fast network is needed of course as well.

One more benefit of this setup: Running different things on different machines which are more or less isolated from each other, and which can be restored to an earlier version if needed, improves security.

The main points of this article: If virtual machines are good, then it's probably also good to run them inside a virtual machine, at least in some cases. If "bare metal" is good, then it's probably also good to virtualize the good aspects of it, as exemplified by Java Virtual Machine. If something is good, then probably also a virtualized version of it is.

 © 2014 Panu Viljamaa. All rights reserved

No comments:

Post a Comment