Month: January 2009

Script to automate creation of OS VHDs from Server 2008 R2 media

I have been working with the public beta of Windows Server 2008 R2 and have been exploring quite a few features of this new release. Of Course, native VHD boot is one of them. On my home PC, I have R2 Enterprise edition with AIK tools to capture OS in to VHDs whenever I need. However, I find this process of manually capturing VHDs a bit time consuming and repetitive task. So, decided to automate it so that I can do something else while the VHD creation is in progress. Here is the script if you are as lazy as me 🙂 What this script does is simple. You need to unzip the downloaded zip file to some location on your computer and at the command prompt, just run cscript captureVHD.vbs /src:<DVD Drive Letter>. For example, on my system, C:\> cscript c:\scripts\captureVHD.vbs /src:D: This, depending on the OS DVD (Windows 7 or Server 2008 R2 only) you have, will display a menu as shown here. All you need to do is enter the number against one …

Enabling a captured VHD to boot in a Hyper-V Virtual Machine

In an earlier post, I wrote about how you can use WAIK tools to capture OS image from install.WIM in to a VHD. However, when we connect this VHD directly to a VM in Hyper-V environment, it simply won’t boot because there is no Boot Configuration Data within the VHD. Now, to be able to use this VHD in a Hyper-V VM, we need complete a few more steps. We need to make the primary partition within the VHD “active”. To do this Open Diskpart Select vdisk file=C:\<VHDFILENAME>.VHD Attach Vdisk select part 1 active Assign letter=Z exit Now, at the command prompt, change to Z:\Windows\System32 Run, BCDboot.exe Z:\Windows /s Z:\ Run, BCDedit /store Z:\boot\BCD /set {bootmgr} device boot Run, BCDedit /store Z:\boot\BCD /set {default} device boot Run, BCDedit /store Z:\boot\BCD /set {default} osdevice boot Change directory to C:\ open Diskpart again and run Select vdisk file=C:\<VHDFILENAME>.VHD detach vDISK Exit Now, create a new virtual machine within Hyper-V and connect this VHD to it. When you start this virtual machine, Windows OS gets installed (or Configured …

Creating OS VHDs from Windows Server 2008 R2 OS media

Before we get started on this, here is a list of things you need, – Windows Automated Installation Kit (WAIK) for Widows 7. This is required to get tools like imagex, etc to create/capture OS image in to a VHD – Windows Server 2008 R2 Beta Once you have these builds, Install Windows Server 2008 R2 Beta & WAIK for Windows 7 on a test machine. WAIK, by default, gets installed at %programfiles%\Windows AIK folder. Steps to capture OS image as VHD Insert Windows Server 2008 R2 OS media in the drive Open Command-prompt and change to %programfiles%\Windows AIK\Tools\amd64 folder Run “imagex /info <CDdrive Letter>:\Sources\Install.WIM. Install.WIM contains more than one OS edition and this command displays a list of all available images within install.wim. Note down the image index number for the image you want to capture as a VHD Run “Diskpart.exe” and continue with the following commands Create vdisk file=c:\<VHDFILENAME>.VHD maximum=<SIZE in MB> Type=<TYPE of VHD; Fixed or Dynamic> select vdisk file = C:\<VHDFILENAME>.VHD Attach vdisk create partition primary format quick fs=ntfs assign letter=S exit Now, …

Windows Server 2008 R2 and HVS 2008 UI

I had quickly tested HVS2008UI on Windows Server 2008 R2 beta OS. I have tested it on both Server Core as well as full OS. And the news is, it just works fine as expected. I have not anticipated any WMI changes in this build. However, I still have to thouroghly test it. You may want to use the same tool to manage your R2 Server Core installs. Let me know if you find any issues with the tool.

Windows Server 2008 R2 beta downloads

If you have not found this link yet… Windows Server 2008 R2 beta OS download link: http://www.microsoft.com/downloads/details.aspx?FamilyID=85cfe4c9-34de-477c-b5ca-75edae3d57c5&DisplayLang=en Windows Server 2008 R2 beta resources: http://www.microsoft.com/downloads/details.aspx?familyid=85D6C1CC-14DB-4867-A740-391C62C01C1C&displaylang=en I have downloaded my copy of the OS and will start experimenting..!

Waiting to get my hands dirty…

….with Hyper-V v2 and Windows 7. As you might have already read, Microsoft is currently working on releasing Windows Server 2008 R2 a.k.a Windows 7 by some time next year. You can find more information on what is changing here. There is already lot of talk on the web about some of the features including Native VHD boot, Live Migration, etc. If you are interested to know more about Virtualization changes in Windows 7, check out this talk by Mark at TechEd 2008. Coming to my interests, I am waiting for the public beta to work on Native VHD boot and of course test HVS2008UI on Hyper-V v2. Hyper-V v2 includes support for .NET and PowerShell too. I am actually thinking of moving HVS2008UI to PowerShell or maintain both.