Showing posts with label Windows 7. Show all posts
Showing posts with label Windows 7. Show all posts

Thursday, June 17, 2010

Test machine using boot from VHD

Another option to my last post on SharePoint test machine setup is to boot from a VHD file. A VHD is a Virtual Hard Disk, a file that is used as a hard disk on a Virtual PC or Hyper-V Virtual Machine.

I followed the instructions on Marin Frankovic's blog about it, and it was very easy to create an easy-to-rollback, boot-from-vhd test environment. That's what I did:
  1. I used Marin's post to install a fresh Windows 2008 boot.
  2. I then created a differencing vhd based on the new W2K8 boot, using diskpart and running the diskpart command create vdisk file=c:\testdiff.vhd parent=c:\test.vhd maximum=size_in_mb type=expandable (or fixed). This is nice because you can create a initial differencing VHD from a base VHD, put aside a copy of this differencing VHD, and "destroy" your new boot with tests. When you want to rollback the "destruction", just throw away the differencig file your were using, and start with a fresh new copy from the VHD you put aside before.
  3. Next I added the boot entry to this differencing vhd. On a command prompt:
    a. bcdedit /copy generates boot entry copies. There's plenty of references on this, google for some.
    b. Run the following to point the new boot entry to the differencing VHD:
    bcdedit /set {boot_identifier} device vhd=[c:]\path_to_vhd\vdhfile.vdh
    bcdedit /set {boot_identifier} osdevice vhd=[c:]\path_to_vhd\vhdfile.vhd
    bcdedit /set {boot_identifier} detecthal yes
    (the boot identifier is shown when you generate the boot copy with bcdedit /copy. It can also be seen f you run bcdedit with no params)
And that's it. Your tests boots now can use the full power of your machine, RAM & CPU, instead of sharing the (precious) hardware with the host OS, as VM's do. Just remember: boot from VHD is supported only if your OS is W7 Ultimate or Enterprise, or W2K8 R2.

Tuesday, December 29, 2009

Windows Virtual PC: Where is it?

Windows Virtual PC is Microsoft Virtual PC next version. It runs on Windows 7, but it is NOT part of it - you have to download it. The download page is http://www.microsoft.com/windows/virtual-pc/download.aspx, although the page title is "Download Windows XP Mode". You have to fill in the two dropdowns, and the page shows you two links. If you don't want Windows XP Mode, just click the second link, download and install the update to Windows 7 - it's Windows Virtual PC that's being installed.



Before you download it, you have to check if your's computer processor supports hardware virtualization technology (check out the links on Intel and AMD on the article). Most of the newer processors (post 2006-) ship with it. Some don't (for example, the T6670 on my Dell Vostro 1310 does not :-P). You can run the Hardware-Assisted Virtualization Detection Tool from Microsft to confirm that your processor supports VT (virtualization technology). If it doesn't, download Virtual PC 2007, the previous Windows Virtual PC version. It has less features, but it's disks are compatible with Windows VPC.