Tuesday, June 23, 2009

Where’s My White Shirt And Cigarette?

I’ve been getting into presentation recording and screencasting a bit recently. It’s been an interesting experience. My first pass at it used a small mike I scraped up from my musician wife, and it was a pain trying to get it sound just right. (This is besides all the logistics of trying to make a quiet recording in a home office for the amount time necessary to record an hourlong presentation – stuff the dogs in a room, generally alone in the house, not a time of day with school buses roaring past, etc. etc.)

On the recommendation of my friend Dan Holme I bought a Samson Podcasting Kit, which comes with a prosumer (professional / consumer) quality cardioid USB microphone, a professional-looking vibration eliminating suspension mount (below), a stand to put ‘em in, and a shiny silver carrying case that makes me feel like I should be handcuffed to it.

Get Camtasia set up, get the mike level right, start up a VM and microphone run the preso from it so you can run Slide Show in a contained size, capture that screen, put on your headphones so you can review the recording, open your printed notes if you’re a perfectionist like me…and be damned if I don’t feel like Edward R. Murrow or something! (With dogs barking in the background instead of bombs dropping.)

I found I even ended up holding up the notes exactly like radio announcers do, because there’s a very narrow sweet spot where your mouth is positioned at the mike correctly and you can still see the notes. The only thing Ed didn’t have is the copy of 64-bit Windows 7 in front of him :).

Saturday, June 20, 2009

Native OS Boot from VHD: The Windows 7 Way

Those of us that need to use a server OS from what’s normally perceived as a client (e.g., demonstrating a Windows Server feature or application on our notebook during a breakout session) have had to work with different ways to achieve it, and none were all that convenient.

Usually it entailed taking a SWAG* at the amount of disk space you needed for your primary OS, then splitting the volume to leave room for the second OS. In the days of small notebook disks, these estimations were precious indeed. Another option was to install a second hard drive – usually requiring you to lose the CD/DVD-ROM drive. (Hey, you usually worked rather than watched movies on the airplane anyway, yah?) The more daring of us simply installed the server OS and used it as we would a client OS, generally sacrificing device support and power management in the process. I could never quite do that; I valued the notebook-specific features too much when I traveled.

The situation has gotten a whole lot better with Windows 7. (What hasn’t?) With Windows 7 on virtualization-compliant hardware like my ThinkPad T61P, you can boot directly to a .VHD file.

What does this mean?

  • No more partition guessing. Your second (or third, or fourth) OS simply resides in a .VHD file on your primary partition.
  • It’s flexible. You can add and remove OSes as easily as moving the files around and modifying the boot menu with BCDEDIT.
  • It’s fast. I’ve not run any tests, but it sure seems to be as fast as right off the metal. I wouldn’t have known the difference from a “real” boot. (What is real any more, anyway?)
  • Your other partitions appear as  D:, E:, etc. on the VHD-booted OS. All your physical disk volume data is visible; I change the location of My Documents on the secondary OS so it points to my primary documents folder.

Steps to book a second OS from VHD

  1. Create a .VHD containing an OS of your choice. I probably wouldn’t bother with Windows XP, because if you’re running Windows 7 you can install Windows Virtual PC for free and have a bootable XP image. You can build your image on either Hyper-V or Virtual PC.
  2. Make a copy of the VHD in case something goes wrong!
  3. run SYSPREP:

    %windir%/system32/sysprep/sysprep.exe /generalize
    /shutdown

    to create an image that will customize itself according to the new hardware it finds itself on. If you don’t run SYSPREP, be sure to remove the integration add-ins from your VHD before you copy it over.
  4. Copy the VHD to your notebook.
  5. Configure your boot menu to recognize the VHD. For this, I lifted – er, “reused” -  the following from a TechNet article:

To add a native-boot VHD to an existing Windows 7 boot menu

If you are deploying the VHD to a computer with an existing Windows 7 or Windows Server® 2008 R2 installation, you can use the BCDedit tool to make the new VHD bootable and add it to the boot menu. For more information about using the BCDedit tool, see this Microsoft Web site.

Note : Before you begin, you can back up your BCD store using the BCDedit tool with the /export option. For example, at a command prompt, type: bcdedit /export c:\bcdbackup

  1. Copy an existing boot entry for a Windows 7 installation. You will then modify the copy for use as the VHD boot entry. At a command prompt, type:

    bcdedit /copy {default} /d "R2 VHD Boot"

    Where “R2 VHD Boot” is what will appear in the boot menu. When the BCDedit command completes successfully, it returns a {GUID} as output in the Command Prompt window.

  2. Locate the {GUID} in the command-prompt output for the previous command. Copy the GUID, including the braces, to use in the following steps. (I recommend enabling QuickEdit in the window’s properties so you can easily cut and paste the GUID. )
  3. Set the device and osdevice options for the VHD boot entry. At a command prompt, type:

    bcdedit /set {guid} device vhd=[c:]\VMs\windows7.vhd
    bcdedit /set {guid} osdevice vhd=[c:]\VMs\windows7.vhd

    or whatever you’ve named the VHD. Note the syntax for the VHD location.

  4. Set the boot entry for the VHD as the default boot entry. When the computer restarts, the boot menu will display all of the Windows installations on the computer and boot into the VHD after the operating-system selection countdown completes. At a command prompt, type:

    bcdedit /default {guid}

    (Being conservative and not familiar with BCDEDIT, I went into the System properties on my Windows 7 boot and made sure that Windows 7 was the default, in case something went horribly wrong.)

  5. Some x86-based systems require a boot configuration option for the kernel in order to detect certain hardware information and successfully native-boot from a VHD. At a command prompt, type:

    bcdedit /set {guid} detecthal on
    (I did this on my x64 system too.)




That’s it. You should now be able to shut down and reboot into your secondary OS. It will complete its installation from the sysprep, and you’ll be ready to go.



There’s one more really useful step if your secondary OS is Windows 2008 R2. Even though it’s from the same code base as Windows 7, R2 doesn’t seem to automatically recognize range of hardware. So, when you open up Device Manager (devmgmt.msc from the Run menu for the lazy like me) you’ll probably end up with a collection of yellow exclamation points for hardware that isn’t recognized. You can correct most of these errors with this trick: Right-click on them, choose Update Drivers, and point the update location to d:\windows\system32\DriverStore\FileRepository. This is where the Windows 7 drivers for your hardware are stored. If the hardware works on Windows 7 you can make it work on R2 with this trick. You can also update drivers that did load on R2 – but with the generic Microsoft drivers -  with the manufacturer-specific drivers automatically downloaded from Windows Update while you were booted in Windows 7.



* Scientific wild-assed guess.


** Update ** Boot from VHD will only be available in Windows 7 Ultimate Edition.







Wednesday, June 10, 2009

Analyzing your Windows 7 Notebook Battery Performance

One of the many nice features of Windows 7 is its increased energy efficiency. (Anything that lets me finish a movie on a long flight is goodness!) What I didn’t know until now is that you can actually generate a report that outlines your exact power usage and how to improve it (though somewhat cryptically).

Just run

powercfg -energy -output %USERPROFILE%\Desktop\Energy_Report.html

from an elevated command prompt (I created a batch file, then a PowerReportshortcut to it with the Run As Administrator option checked). It will run for 60 seconds, then drop a very detailed energy report on your desktop in HTML format. 

I haven’t analyzed the report other than to see that I’m burning electrons at a good rate. But it’s on purpose as I’m running in high performance profile at the moment. Thanks to http://www.sevenforums.com/tutorials/4569-power-efficiency-diagnostics-report.html for this tip! For more information on Windows 7 energy efficiency, please see

http://blogs.msdn.com/e7/archive/2009/01/06/windows-7-energy-efficiency.aspx