Laptop Virtualization Best Practices – And a Contest!

Whether you’re using Windows or a Mac, if you’re thinking about using virtualization for the first time on your laptop to test out new operating systems like Windows 7 or Windows 2008 R2, there’s a few things you should know.

Get Another Hard Drive

Drive Bay

Drive Bay

Laptop drives aren’t quick to begin with, and running two operating systems simultaneously doesn’t make life any easier for your pokey drive.

Your laptop probably has a removable CD/DVD drive, and that drive bay slot is designed to hold more than just optical drives.  You can pick up a hard drive caddy that slides into that same slot.  Check your laptop’s hardware manual for the exact part number, and then search Ebay for that part number.  Drive bay caddies are usually available for around $20-$40.

Apple Macbook users can swap out their internal drives with the MCE OptiBay drive adapter too.  This voids the daylights out of your warranty, but it’s not as hard as it looks.  I just went through this process with my own Macbook Pro, and I recommend it highly – I have a review of that coming soon.

Pay close attention to the caddy bay specs, and then order a hard drive to match.  Most laptop bay caddies take either a PATA or SATA 2.5″ laptop drive.  Some high-capacity 2.5″ hard drives are a non-standard 12.5mm high instead of 9mm, so make sure you don’t get a drive that’s too thick to fit inside your caddy.  Buy the fastest (not the largest) drive you can afford.  I use the 2.5″ performance test charts at TomsHardware for reference, and the current king-of-the-hill on performance per watt is the Seagate Momentus 5400.6 for around $90.

USB Piggyback Drive

USB Piggyback Drive

If your laptop doesn’t have a drive bay adapter or if you’re not willing to give up that trusty CD/DVD drive, you can also use an external USB hard drive.  Just make sure to get one of the 2.5″ models that doesn’t require external power – the less cables you have to carry, the better.  Then mount it on the back of your laptop display using Velcro tape.  Presto, you can detach it and reattach it whenever you need to pack the laptop into a tight case.

After installation, Windows will see this as just another hard drive that you can partition and format.  When you build virtual machines, store them on this secondary hard drive.  Bonus points for backing up your important files there, too.

Get As Much Memory As Possible

The more memory you have, the better.  I’d consider 4gb the minimum to comfortably run two Windows OS’s simultaneously no matter what virtualization software you’re using.

To find out how much memory your laptop can handle, use the memory configuration tool at Crucial.com.

When It Comes to Virtual CPUs, Less Is More

When building your guest OS’s, always set them up with just one CPU.  Virtualization CPU scheduling has a gotcha: if your virtual OS is set up with two CPUs, then the hypervisor’s scheduler will wait until two cores are available before doing any work in the guest – even if the guest only needs to do one core’s worth of work.  This same concept holds true at the server-level too – don’t set up your ESX guests with 4 CPUs just because you can.

Understand Virtual Networking Modes

The various flavors of hypervisors have three basic network modes for guests:

  • Bridged Networking – aka Home Office Mode. This is the one you’re going to think you want, because each virtual machine gets its own TCP/IP address directly from your home router just like your host machine does.
  • Network Address Translation – aka Starbucks Mode. The hypervisor acts as a little router, and it assigns unique TCP/IP addresses to each guest.  The guests aren’t on the public network directly, but they can access network resources just fine.  This is my favorite because I can switch back and forth between different networks without the guest servers wigging out.  I can suspend them to disk at home, then wake them up at Starbucks and nothing changes.  I highly recommend this mode, especially since it’s easy to switch back and forth between this and…
  • Host-Only Networking – aka Tin Foil Hat Mode. Like Starbucks Mode, each guest gets its own internal TCP/IP address on your laptop’s private network, but there’s no communication with the outside.  This is good for testing software that might have conflicts with other stuff on your network, and it’s also good when you’re on a slow network.  When I’m using my aircard and I don’t have a good signal, I’ll boot up my guests in Host-Only mode so that they don’t try to connect to Microsoft to download updates or anything else that might suck up my precious bandwidth.

Back Up Your Virtual Hard Drives

Installing the Windows guest, configuring it the way you want it, and patching it takes hours.  After you’re done – but before you install any third party software – shut it down and copy the flat files to another directory.

When you want to spin up a new virtual server, just make another copy of those flat files and import them into your hypervisor.  The methods are slightly different depending on what virtualization software you’re using, but all of them are much easier than reinstalling Windows from scratch and patching it.

That’s it for my tips – if you’ve got more to share, feel free to leave ‘em in the comments for other folks to get started easier.

Hard Drives, Get Your Hard Drives Here

Hard Drives, Get Your Hard Drives Here

Oh, And the Contest! Want a Free 120GB 2.5″ USB Drive?

I’m moving to Chicago soon, and I need your help.  I need to clean out my home office, but I hate throwing gadgets away.  Time to give away some of my extra goodies.

Today, since we’re talkin’ USB drives, let’s give those away.  I’ve got two self-powered USB 2.5″ hard drives, both 120 gigs, both exceedingly stylish.  One is a speaker’s gift from the PASS Summit last year, and one is a leather-bound hard drive.  (I have very strange tastes in USB devices.)

To win, just leave a comment here.  Only one comment per person, please.  I’ll draw two comments at random on Saturday Sept 12th at 7AM EST and announce ‘em here.  Good luck!

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

84 Responses to Laptop Virtualization Best Practices – And a Contest!
  1. Rafal
    September 8, 2009 | 5:04 AM

    Do you ship to Poland ;) ??

    • Brent Ozar
      September 8, 2009 | 8:08 AM

      Ha! Good question – I guess so. I might ask you to help with the payment though. :-D

  2. Thomas Pullen
    September 8, 2009 | 5:53 AM

    Brent, you’re wasted on SQL Server. You should be on TV!

    • Brent Ozar
      September 8, 2009 | 8:39 AM

      Ha! Well, there’s always my podcasts. ;-)

  3. Mike Wells
    September 8, 2009 | 8:32 AM

    Great tip on replacing the optical drive – I’m going to look up the part number for my Dell now!

    Do you have a favorite virtualization program for Windows? I have been using Virtual Server with VMRC+ to access VMs across a network, but have considered trying Virtual Box.

    • Brent Ozar
      September 8, 2009 | 8:39 AM

      Mike – if you’re a pure Windows shop, I’d probably go with Hyper-V since it’s “free”, depending on your OS. If you’re running Windows Server, then you can upgrade to the latest 2008 R2 and get Hyper-V in there for free. If you’re using workstation-based OS’s though (XP, Vista, 7) then I’d stick with Virtual Server.

  4. Jean
    September 8, 2009 | 8:58 AM

    Great article! Thanks for this. What a wonderful idea.

  5. Rocky C
    September 8, 2009 | 9:11 AM

    I’m glad I happened upon your blog. I was reading another somewhere and an entry you wrote was linked to it. I’ve been receiving your rss feed and twitter feed for about 5 months now and am happy to see someone who actually knows what he’s talking about when I get to my computer in the morning! I’m a fan of virtual box myself, but I’ve yet to try anything other than that and Virtual PC so I’m sure Hyper-V does that job just as well (I’ve heard good things). Right now I’m just running the virtual OS on C: so one of these handy USB HDDs would do me good!

  6. Mufasa
    September 8, 2009 | 9:30 AM

    The CPU tip was new to me.

  7. BradC
    September 8, 2009 | 9:32 AM

    Free hard drive?? Sign me up!

  8. Paul Sligar
    September 8, 2009 | 9:43 AM

    Excellent article – but I’ve come to expect that from you. Great idea on the caddie DVD-to-HDswap – sure to get better performance compared to USB drive.

    We boot into 64-bit Win7 OS, but run 32-bit VMs (XP) for desktop dev stuff, and 64-bit VMs for the server side. Haven’t tried the boot into VHD option in Win7 yet.

    • Brent Ozar
      September 8, 2009 | 9:44 AM

      I gotta say, that boot-into-VHD thing looks like the slickest thing since sliced bread. That one feature alone tempts me to come back to the Windows side.

  9. Brian Tkatch
    September 8, 2009 | 9:43 AM

    I feel “dirty” comments for a free drive. But, it would be mighty convenient to have one (and not have to pay for it).

    • Brent Ozar
      September 8, 2009 | 9:45 AM

      Yeah, I felt dirty running the contest this way too at first, hahaha! It was the easiest way to run a contest quickly though. It was either this or set up an email box where people could send emails, but then that ended up a hassle too. I’ve seen Engadget run contests this way pretty often, and now I see why – it’s so easy for me to run it.

  10. David Stein
    September 8, 2009 | 10:06 AM

    Mmmmmmm… Leather. :)

  11. Joel Coehoorn
    September 8, 2009 | 10:20 AM

    > “the current king-of-the-hill on performance per watt is the Seagate Momentus 5400.6 for around $90.”

    Is 5400RPM still the state of the art for laptop disks? Or is it the “per-watt” part that holds that back?

    • Brent Ozar
      September 8, 2009 | 10:36 AM

      It’s the per-watt part. If you check those charts from Tom’s Hardware, they list different metrics too without the power constraints, and the latest Momentus 7200rpm drives edge out the 5400 ones, but it’s not night and day better. I picked up a 500gb 7200rpm Momentus last week. (Arrived defective, but hey…)

  12. Ryan Anthony
    September 8, 2009 | 11:04 AM

    I didn’t know you could replace the optical drive with another hard drive, that’s pretty awesome. I do use a number of virtual machines, from running a subversion repository on little Ubuntu install to a Windows XP machine when I have to do some VB6 code maintenance (and I don’t want to get VB6 all over my main install…).

  13. Dean Willson
    September 8, 2009 | 11:06 AM

    Another great post! A small self powered drive would definately beat carting around my ginormous powered external drive. If you ever decide to venture over to Fort Wayne, IN, we would be happy/honored to have you as a guest presenter at fwPASS.

  14. David Hay
    September 8, 2009 | 11:26 AM

    Thanks again for another informative post. Looking forward to seeing who the winners are!

    David

  15. Sheldon McGee
    September 8, 2009 | 12:38 PM

    I don’t use my laptop much now that I’ve used a netbook (it’s just so much easier to travel with . . . I don’t even need a special case for it) though I doubt any netbook would be good enough to do serious work with virtualization. But that was good advice for virtualization on the desktop too.

  16. Sheron
    September 8, 2009 | 12:59 PM

    The free drive sounds too good to be true… ;-)

  17. Andrew Harrison
    September 8, 2009 | 1:11 PM

    Seriously, a free harddrive for commenting? I’m in!

  18. Pinal Dave
    September 8, 2009 | 1:35 PM

    I can pick up those HD from you when I am at PASS :)

  19. Tim Benninghoff
    September 8, 2009 | 1:37 PM

    I like free things.

  20. Jen McCOwn
    September 8, 2009 | 1:43 PM

    Clever…now I must win a hard drive and follow suit…

  21. Thanks for the swag Quest | DEVHermit
    September 8, 2009 | 2:31 PM

    [...] and retain customers, followers, people that like you, etc. is to occasionally give away goodies. Brent Ozar is doing this as we speak, offering up a couple of 120 GB hard drives that he had hanging around in [...]

  22. Klaus Jensen
    September 9, 2009 | 6:05 AM

    Very cool article, that taught me a couple of new things. I had never heard about these caddies for the dvd-drive – I will go find one right away.

  23. Guillermo Salas
    September 9, 2009 | 8:40 AM

    Thanks Brent! I just wish I could be so generous with my extra gadgetry, but I am so the opposite… a total circuitry pack rat.

    Love the blog, great variety and always keeping it interesting. Now its off to work before I am late!

  24. Todd Williamson
    September 9, 2009 | 10:06 AM

    Do you have any opinion on going the extra mile to get a laptop that has an eSATA port or getting an expansion card to provide one? I cannot seem to find a clear pro/con on doing that versus using a straight USB 2.0 external drive.

    • Brent Ozar
      September 9, 2009 | 1:24 PM

      The problem is that eSATA doesn’t carry power, so if you plan to use an eSATA drive on a plane or on the road, you would be out of luck.

    • Mike Chabot
      September 10, 2009 | 5:37 PM

      eSATA is much faster than USB 2. If you use a program where the hard drive is the bottleneck, such as a VM, the speed difference will be noticeable. Firewire 800 is also faster than USB 2. eSATA is as fast as an internally-connected hard drive. The main downside is that the option requires an add-in card and power adapter for most laptops and, from my experience, it is less stable than using the built-in USB or Firewire connections. I suspect the instability has more to do with the use of an add-in card than the underlying technology. Some newer laptops now come with powered eSATA ports. Powering eSATA using a USB port instead of a power adapter is likely possible with 2.5 inch SSD drives. If you are getting an external enclosure, you might as well get one that has both USB2 and eSATA ports since the cost difference is minor and it opens up that faster option if you want to take advantage of it later.

      • Todd Williamson
        September 10, 2009 | 9:26 PM

        @Mike That was what I’d read is that eSATA can be 3x faster than USB. Some Dells I’d seen had integrated eSATA ports, but could not determine if they were powered, nor even if eSATA is available with power on the same cord. There is a dearth of information on it. As you say, I think my best move would be to buy an enclosure that supports both USB and eSATA and take it from there.

  25. BigJimSlade
    September 9, 2009 | 1:39 PM

    Give me the hard drive and no VM’s gets hurt…

    • Brent Ozar
      September 9, 2009 | 3:18 PM

      HAHAHA, I like that approach.

Leave a Reply

Wanting to leave an <em>phasis on your comment?

Notify me of followup comments via e-mail. You can also subscribe without commenting.