Virtual Machine Performance on a Laptop

So, now that I’ve had an opportunity to run my virtual machines on my new E6400 laptop, I thought I’d share what I’ve learned. But, first, a bit about the other piece of hardware that I use with my virtual machines:

Because virtual machines are notoriously slow, you want to do everything you can to help them out. Probably the most important thing you can do is to host them on a different physical drive from your operating system. Less contention for the disk means faster disk access. It also helps to get the fastest drive possible, since virtual hard drives are nothing more than incredibly large files that you will inevitably want to copy and move around.

So, for years now, I’ve carried around a small (2.5”/60GB), fast (7,200RPM), USB 2.0 (440Mb/sec) drive to host my virtual machines. It has worked great: it’s portable, it’s fast, and I can plug it into virtually any computer and be up and running in minutes.

Sure, a larger drive would be better. 60GB was the largest 7200RPM 2.5” drive at the time I bought mine. Now, you can get 300GB+ at 7200RPM for just a couple hundred dollars.

A faster drive would also be nice. 7200RPM was the fastest 2.5” drive on the market at the time I was buying. Now, you can get 2.5” 10,000RPM drives. And, you can even get 15,000RPM drives, if you don’t mind lugging around a 3.5” drive and another power brick.

Finally, a faster pipe would really help. When I bought my drive, USB 2.0 was the fastest ubiquitous connector out there. Now, you can often find FireWire 800 ports (at 800Mb/sec). And, low-and-behold, my new E6400 has an eSATA port (at 3Gb/sec!).

So, needless to say, I had to try out the SATA port. Long story short: IT SCREAMS! It is easily 5-10x faster than the USB connection. In fact, it’s so fast, I defy anyone to tell me whether or not they’re running the host OS (on the metal, as they say), or the guest OS (virtually)! Don’t believe me? Come over and see for yourself!

I am a convert! I will not be going back to USB any time soon!

Virtual Machines

A professor of mine once told me that anything software could do, hardware could do faster. It turns out that anything hardware can do, software can do, too!

What is a virtual machine?

A virtual machine is a fake computer running a real operating system within a window on another real operating system running on a real computer. Confused? Think of it this way…

Imagine booting your PC, logging in, and running Microsoft Word. Word launches in a new window, just as you would expect. Now, imagine if you could run Windows in a window instead of Microsoft Word. That’s a virtual machine.

Why use virtual machines?

There are many, many reasons to run virtual machines. But, all of them boil down to the same underlying reason: Money.

For example, suppose I’m a web developer. (Imagine that! Me! A web developer! How chic!) And, suppose I’d like to test my new website in all the major browsers, starting with Internet Explorer and Firefox. I can’t configure one machine with all the different versions of all the different browsers. They’re not compatible with each other. (Actually, they’re not compatible with themselves. But, let’s not go there.)

I could go out and buy a bunch of real PCs; install one browser on each; and, run my tests on each machine. But, even with very inexpensive machines, I’d be looking at several thousand dollars just to setup my test environment. (Ouch!) Or…

I could create a bunch of virtual PCs; install one browser on each; and, run my tests on these fake machines on a single real machine. Total cost for additional hardware? ZERO DOLLARS. (Cha-ching!)

How can I get started with virtual machines?

Funny you should ask! I was just about to mention that Microsoft Virtual PC is a free product that lets you create all the virtual machines you can imagine. There are a couple of caveats, though. (There are always caveats.)

First: Each virtual machine you create will need an operating system. And, each operating system you install needs to be licensed legally. (So, now you see why Microsoft is giving away Virtual PC! It’s like the razor. Windows is the razor blade!) So, an enterprise license for Windows, or an MSDN license are probably the safest ways to ensure that your virtual machines are all legal.

And, second: If you think Windows is slow on your real computer, try running Windows on top of Windows on top of your real computer! Virtual machines are notoriously slow. It takes quite a bit of real hardware in order to brute force a virtual machine into performing like an adequate real machine. So, virtualization is only for those of us with very strong machines. My desktop (an Optiplex 7400) handles the load fine. I’ll be experimenting with my new developer laptop (an E6400) soon. I’ll let you know how that goes.

As always, ping me or comment on this post if you have questions…