Virtualisation is a cool technology. If you're not familiar with the concept, it's a way to run a complete copy of a different operating system inside a window in your existing operating system.
For example, you might want to run Linux inside Windows. In this case, Linux is called the "guest" and Windows the "host". The hard-disc that the guest writes to is laid out as a big file in the host, rather than having to allocate some space on a real hard-disc. The hardware on your host PC is exposed to the guest, allowing it to get network access, video and sound as if it were just another PC on your network.
Testing configurations
The main advantage of this technology is it lets you try out operating systems, or software on them, without affecting your existing PC. In addition, you can copy the hard-disc file and have the exact same virtual machine run on a different PC for example. Or you could back up the hard-disc file and should something go wrong with your virtual machine, just delete the bad installation and restore your backup. It's as simple as copying a file.
I use this technology all the time in my work. We have multiple virtual machines which each have a different browser version installed. We can then start each one up in turn and test some web software under multiple browsers. Similarly I can test software under different operating systems or configurations.
Finally, there's a great option of snapshots. These let you store the complete machine's state at a point in time, and then at any later point you can just revert to the snapshot you took earlier. All the changes you have made are wiped, right the way down to the disc sector level. I can install anything onto the machine, mess it up totally, and then when I'm done, just revert back to the point where it worked again.
Software virtualisation
There are two main types of virtualisation: Hardware and Software. Software virtualisation was the first, where companies wrote virtualisation applications which allowed you to run one operating system inside another. One of the first companies I was aware of that did this was VMWare. For a long time, they were the industry leaders. Microsoft then got on the bandwagon and released VirtualPC. More recently Sun bought a company and released VirtualBox.
Whilst VMWare is still a commercial product, what's particularly cool about VirtualPC and VirtualBox is that they are FREE. In addition, VirtualBox is open source too, so theoretically, that's even better.
I've used all three in the past and to be honest, any has been fine for hobbyist use. VirtualBox's support is better for different operating systems however (certainly than VirtualPC) and is being developed actively, so that's would be my recommendation.
Hardware virtualisation
Hardware virtualisation is the new direction companies are heading in. This allows you to run multiple virtual machines on a single set of hardware simultaneously, and the hardware looks after the virtualisation rather than the software on top of it. This provides better performance.
Virtualisation is advantageous when you need to run multiple legacy operating system instances on one physical (more modern) box, saving you hardware and maintenance costs.
It works because legacy applications often don't require much processing to keep them ticking along. It's quite possible therefore to have multiple virtual machines running on a single box, without straining the modern CPU too much. With virtualisation built into the hardware, it's utterly transparent to the operating system that it's sharing hardware with other machines, and the single physical box simply looks like multiple machines connected to the network.
Virtual TV?
What the heck does this have to do with TV and entertainment PCs I hear you ask?
Well not a lot to be honest, except that this technology helped me to solve a problem which I faced recently to do with my TV streaming server.
It goes back to the software testing model I explained above. My server has MediaPortal's TV Server running on it 24-7. Unfortunately I was running an old version and I wanted to update it. The problem is that these things never go smoothly - how could I guarantee that taking the server down, upgrading the software, and getting it back up would work first time? How could I know how long this would take - would I have to leave the server down for some time? How would my wife watch Neighbours? All of these questions can be answered using virtualisation, and in particular VirtualBox.
VirtualBox provides a high level of hardware support. Not only are sound and video supported for example, but also USB2.0. So any of your USB devices can be passed through to the virtual machine for it to use as if they were plugged into the machine physically.
What this allowed me to do was to set up a fresh Windows XP virtual machine away from the server, get all the software installed, including the new TV server version, and then when I was ready, copy this virtual machine disc image onto the server. On the server, I redirected the TV cards connected to the server's USB ports into the virtual machine. This allowed me to test the new version using my real TV hardware but without affecting my working installation on the server. I could even connect to the virtual machine from my other PCs and watch TV streamed by the new version.
Once I'd proven that everything was working as expected, and that the new version of the software would work, I pulled down the physical server, made the upgrade and got it back up and running in around an hour. There's nothing like knowing that it's going to work before you start making changes like these!
In an ideal world, I would actually run the TV server permanently in a virtual machine, facilitating future upgrades. I could isolate my server's other functions into virtual machines too, providing a similar hot-pluggable infrastructure, however the USB support (or the power of my server) is not quite good enough to do this full time yet.
It's very likely that with a modern server and hardware virtualisation, this would absolutely be possible. One day, I might just set it up like that..
Tuesday, 7 July 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment