Tuesday, 7 July 2009

Virtualisation

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..

Home networking

When I first moved into my house, I used long (30m) patch cables to get Gigabit ethernet around the house. This was fine, and I managed to hide it quite well, however I was never quite happy with it.

I had a conversation down the pub with a friend who was lucky enough to move into a house which was pre-wired for network. His immediate question was "but why don't they do external ethernet cable?"

Good point.

I thought I'd investigate whether there was such a thing, and as it turns out, there is (although it's hard to buy in less than 100m reels). I bought some from this site (there are others) and decided to leap into the unknown of terminating network cabling myself.

A day's hole drilling, fiddling, and patching later, I have a panel in the loft which runs external cable down to each of the rooms that require ethernet connectivity. No messy wires on the inside, as the cables all run down the walls externally. A long hole is required to get the wires into the house, but then with a neat ethernet socket on the inside, it looks very tidy indeed.

On top of that it seems the throughput is far better than before, which is an added bonus. Yes, it took a bit of network know-how (follow the colour coding, don't think you know better) but it all worked perfectly. Wired might be a bit last century, but it still beats wireless for reliability and performance and homeplugs by cost.

Living with the eeeBox

Well it's been a very long time since I last posted - that must be something to do with a new family arrival I would imagine.. ;-)

I thought I'd add a few short posts about things I've been keeping an eye on, and comment on roughly a year's use of my Asus EeeBox B202s.

Firstly the only limitation that I've noticed of the B202 is its lack of full HD capability. 720p tends to playback ok, however anything greater than that is very jerky. Asus have addressed this with their new EeeBox arrivals (B204/B206). The additon of an HD compatible graphics card seems to have resolved that issue, whilst otherwise sticking with the same hardware.

Unfortunately Asus seem not to have been able to resist the temptation to increase the price of these new models. One of the key selling points in my opinion was the price of the original. The new models go for around £290 which although still not bad for an entertainment PC, for me is just a little too high.

Much like the Asus EeePC netbook however, other manufacturers are now catching up, most notably Acer with their Aspire Revo. This machine is similar in concept to the Asus, however it ships with an HD compatible card already included. There are two main specifications, one with Linux and a 20Gb SSD drive, and one with Vista (yes, the graphics hungry Vista) and a 160Gb HDD. The Linux machine was an amazing £149 when it was released, although reviewers were very critical about the SSD which performed poorly.

Subsequently, Acer have released the Linux version with a 160Gb drive (same spec as the Vista model) for £159 (at time of writing). Now that is a bargain as far as I can see. It's going to be hard to resist that to get some BluRay viewing on the main TV!