Category: Technology

  • Building a low-power server for 24×7 infrastructure at home: Part 1 (hardware selection)

    A couple of years back, I bought myself a small server with the intention that it would replace many of the various PCs I was using at home.  As a result, I did decommission some older hardware and it allowed me to consolidate the infrastructure I use for my home office network, testing and development onto one Hyper-V host, supplemented by an assortment of client devices (my netbook, my kids’ netbook, my wife’s laptop, the living room Mac, my MacBook, my work notebook) and a couple of Netgear ReadyNAS Duos (one as always-on storage, the other as an iSCSI target).  The trouble is that, even though the clients may be shutdown or in a low-power state when not in use, the server runs 24×7 consuming something in the region of 100W of power – generally just so that one virtual machine is available with my DHCP, DNS, TFTP (for IP phone configuration) and basic web services (e.g. phone directory).

    I decided to build a low-cost, low-power, PC to run as a small server and provide these services, along with Active Directory.  After reading Jeff Atwood’s post on ultra-low-power PCs, I was inspired; however I wasn’t sure that I’d get Windows Server running on a non-Intel chip (it might be possible, but I wasn’t going to risk it) and even though Linux could potentially offer the rest of the services I needed, a lot of my work uses Microsoft software, and I wanted to run Active Directory.

    I tweeted to see if anyone had any advice for me – and there were some good suggestions – including Garry Martin’s identification of an Asus Aspire Revo nettop for around £144 at eBuyer.  That got me thinking: I wasn’t sure about the Revo’s form factor – but if I could get myself a Mini-ITX wall-mountable case and suitable motherboard, then use a spare disk and memory from my “box of PC bits”, I could probably build something for a similar price.

    I should explain that I haven’t “built” a PC for about 10 years (maybe more) because there are so many decent OEM deals around but I started to look at what was available at mini-itx.com (as highlighted in Jeff’s post).  I did also consider a Fit PC 2 (low power and Intel-based) but it uses the Z-series Atom processors, which provide Intel VT (great for Windows Virtual PC) but are not 64-bit so are not suitable for Windows Server 2008 R2 (or for Hyper-V – although virtualisation is not something I’m looking to do with this server).  Eventually, I settled on a Travla C158 case coupled with an Intel D945GCLF2 board which has an Intel Atom 330 giving me a dual-core x64 CPU (actually it’s like two Atom N270s on the same socket) with hardware DEP (but not VT).Intel Atom inside  There were other options with lower power consumption, but they would have involved using non-Intel CPUs (and I was unable to confirm that Windows Server will run on a Via Eden (for example); however this Atom 330/Intel D945GCLF2 board combination is still providing plenty of computing power for my purposes (William Henning’s review on neoseeker is worth a read).

    I ordered the equipment yesterday evening at 19:00 (the mini-itx.com site says “place UK orders before 7.30PM GMT for same-day despatch”) and a courier delivered it to me before 11 today; however I did end up buying some power connectors because it wasn’t clear whether they would be required or not (I left a comment in the order notes to remove them if not required but that was ignored) and there was some confusion because I received order and stock confirmations last night but the dispatch notice wasn’t sent until today (making me think I’d missed the next-day slot).  Even with the communications issues, that sort of turnaround is fantastic – many online stores need orders by mid-afternoon for same-day dispatch.

    With the hardware in place, the next step was assembly – I’ll save that for a future blog post (along with some real values for power consumption) whilst I turn my attention to configuring the software…

  • Native VHD boot Windows 7 or Server 2008 R2 from an external USB drive

    Guest Post
    Are you excited about Native VHD Boot for Windows 7 (Enterprise or Ultimate) and Windows Server 2008 R2 but wish you could use an external USB drive to store the .VHD files? Well unfortunately it isn’t officially supported but, if that doesn’t worry you too much, you might find this post interesting…

    Background

    In order to get Native VHD Boot working from an external USB Disk, there are a few things we need to understand about device drivers and their load orders.

    Setup and the PnP manager configure devices starting with the system root device, followed by the child devices of the root device, the children of those devices, and so on. To influence the driver load order outside of this sequence, we need to change the .INF files for the USB related drivers, specifying relevant values in the service-install-section, specifically the StartType and the LoadOrderGroup entries.

    A PnP driver should have a start type of SERVICE_DEMAND_START (0x3), specifying that the PnP manager can load the driver whenever it finds a device that the driver services. USB drivers normally behave in this manner and have this start type.

    However, if a driver is required to boot the machine (such as when, oh I don’t know, maybe attempting something like native VHD boot from an external USB drive), the drivers for the device should have a start type of SERVICE_BOOT_START (0x0).

    On system boot, the operating system loader loads drivers of type SERVICE_BOOT_START before it transfers control to the kernel. These drivers are in memory when the kernel gets control. Boot-start drivers can use the .INF LoadOrderGroup entries to order their loading. You can see the List order at HKLM/SYSTEM/CurrentControlSet/Control/ServiceGroupOrder.

    For Native VHD Boot from an external USB drive to work, we need to modify the behaviour of six device drivers:

    • usbccgp – Microsoft USB Generic Parent Driver
    • usbehci – Microsoft USB 2.0 Enhanced Host Controller Miniport Driver
    • usbohci – Microsoft USB Open Host Controller Miniport Driver
    • usbuhci – Microsoft Universal Host Controller Miniport Driver
    • usbhub – Microsoft USB Standard Hub Driver
    • usbstor – USB Mass Storage Driver

    The USB drivers have a LoadOrderGroup entry of Base, which is considerably down the list, and critically much later than we need to use them as a boot device. We therefore need to modify the LoadOrderGroup to something more appropriate that will be processed earlier in the boot cycle. There is some debate about the best entries to use for this purpose, and whilst it seems the below is technically most appropriate, I began this journey with all entries set to use Boot Bus Extender and have continued to use that without issue. However, you may want to try the settings below as an alternative:

    • usbccgp – Boot Bus Extender
    • usbehci – Boot Bus Extender
    • usbohci – Boot Bus Extender
    • usbuhci – Boot Bus Extender
    • usbhub – System Bus Extender
    • usbstor – SCSI Miniport

    So, to enable Native VHD Boot from an external USB drive, we need to modify the StartType and LoadOrderGroup of each of those drivers, and critically, ensure that they don’t get reset to their defaults.

    Requirements

    You’ll need a computer running Windows 7 or Windows Server 2008 R2 and a suitable external USB drive to store your .VHD files and to create the necessary bootloader. You’ll also need the following tools:

    Process

    Disclaimer: This is close to a step-by-step guide, but it assumes a certain level of technical knowledge and understanding. Hopefully I’ve made it as easy to follow and as painless as possible but tread carefully. To quote Scott Hanselman:

    “This is some advanced stuff and you may lose a finger. No warranty express or implied.”

    To begin with, we need to create our .VHD file. Mike Kolitz has created a fantastic script called WIM2VHD that takes much of the hard work out of this task for us. The example below uses a Windows Server 2008 R2 WIM file as source, and creates a 49GB Enterprise edition dynamically expanding .VHD file from it.

    From an elevated command prompt, run the following command:

    CSCRIPT WIM2VHD.WSF /WIM:”M:\Sources\SERVER\install.wim” /SKU:SERVERENTERPRISE /VHD:”M:\BootVHDs\W2K8R2ENT.vhd” /SIZE:50176 /DISKTYPE:DYNAMIC

    Now that we have created the .VHD file, we need to make some changes to the operating system contained within it. From the same elevated command prompt used for the previous command, we’ll use diskpart.exe to mount the .VHD. Note the use of LIST VOLUME so that we can see the correct volume number, select it, and assign a drive letter to it – you’ll need to change the number in SELECT VOLUME to match your environment:

    DISKPART
    SELECT VDISK FILE=”M:\BootVHDs\W2K8R2ENT.vhd”
    ATTACH VDISK
    LIST VOLUME
    SELECT VOLUME 8
    ASSIGN LETTER=R
    EXIT

    At this stage, I use the offline servicing tool, dism.exe, to change the default language, keyboard layout and timezone to something more appropriate for the United Kingdom. You can obviously make other changes too if necessary:

    DISM /IMAGE:R: /Set-SysLocale:en-GB
    DISM /IMAGE:R: /Set-UserLocale:en-GB
    DISM /IMAGE:R: /Set-InputLocale:409:00000409
    DISM /IMAGE:R: /Set-TimeZone:”GMT Standard Time”

    Next, we need to make changes to the registry for each of the six USB device drivers. We’ll use the built in reg.exe command to do this. By default, when an operating system is launched from a dynamically expanding .VHD file using native VHD boot, it expands to its maximum size, reverting to its dynamic size when it is shutdown. I also modify the VirtualDiskExpandOnMount registry value to prevent this:

    REG LOAD HKLM\TEMP R:\WINDOWS\SYSTEM32\CONFIG\SYSTEM
    REG ADD HKLM\TEMP\ControlSet001\services\usbccgp /v Group /t REG_SZ /d “Boot Bus Extender” /f
    REG ADD HKLM\TEMP\ControlSet001\services\usbccgp /v Start /t REG_DWORD /d 0 /f
    REG ADD HKLM\TEMP\ControlSet001\services\usbehci /v Group /t REG_SZ /d “Boot Bus Extender” /f
    REG ADD HKLM\TEMP\ControlSet001\services\usbehci /v Start /t REG_DWORD /d 0 /f
    REG ADD HKLM\TEMP\ControlSet001\services\usbhub /v Group /t REG_SZ /d “Boot Bus Extender” /f
    REG ADD HKLM\TEMP\ControlSet001\services\usbhub /v Start /t REG_DWORD /d 0 /f
    REG ADD HKLM\TEMP\ControlSet001\services\usbohci /v Group /t REG_SZ /d “Boot Bus Extender” /f
    REG ADD HKLM\TEMP\ControlSet001\services\usbohci /v Start /t REG_DWORD /d 0 /f
    REG ADD HKLM\TEMP\ControlSet001\services\USBSTOR /v Group /t REG_SZ /d “Boot Bus Extender” /f
    REG ADD HKLM\TEMP\ControlSet001\services\USBSTOR /v Start /t REG_DWORD /d 0 /f
    REG ADD HKLM\TEMP\ControlSet001\services\usbuhci /v Group /t REG_SZ /d “Boot Bus Extender” /f
    REG ADD HKLM\TEMP\ControlSet001\services\usbuhci /v Start /t REG_DWORD /d 0 /f
    REG ADD HKLM\TEMP\ControlSet001\services\FsDepends\Parameters /v VirtualDiskExpandOnMount /t REG_DWORD /d 4 /f
    REG UNLOAD HKLM\TEMP

    The next step is to modify the .INF files so that the operating system does not reset these values to their defaults at any point. As some of the files require SYSTEM permissions to modify them, we use the excellent SysInternals psexec.exe command to launch a command prompt in the SYSTEM security context.

    PSEXEC –i –d –s C:\Windows\System32\cmd.exe

    From the resultant command window, we use Horst Schaeffer’s INI File Tool to modify any .INF files that might reset the device driver values to their defaults:

    INIFILE R:\Windows\inf\usb.inf [StandardHub.AddService] StartType = 0 ; SERVICE_BOOT_START
    INIFILE R:\Windows\inf\usb.inf [StandardHub.AddService] LoadOrderGroup = Boot Bus Extender
    INIFILE R:\Windows\inf\usb.inf [CommonClassParent.AddService] StartType = 0 ; SERVICE_BOOT_START
    INIFILE R:\Windows\inf\usb.inf [CommonClassParent.AddService] LoadOrderGroup = Boot Bus Extender
    INIFILE R:\Windows\inf\usbport.inf [EHCI.AddService] StartType = 0 ; SERVICE_BOOT_START
    INIFILE R:\Windows\inf\usbport.inf [EHCI.AddService] LoadOrderGroup = Boot Bus Extender
    INIFILE R:\Windows\inf\usbport.inf [OHCI.AddService] StartType = 0 ; SERVICE_BOOT_START
    INIFILE R:\Windows\inf\usbport.inf [OHCI.AddService] LoadOrderGroup = Boot Bus Extender
    INIFILE R:\Windows\inf\usbport.inf [UHCI.AddService] StartType = 0 ; SERVICE_BOOT_START
    INIFILE R:\Windows\inf\usbport.inf [UHCI.AddService] LoadOrderGroup = Boot Bus Extender
    INIFILE R:\Windows\inf\usbport.inf [ROOTHUB.AddService] StartType = 0 ; SERVICE_BOOT_START
    INIFILE R:\Windows\inf\usbport.inf [ROOTHUB.AddService] LoadOrderGroup = Boot Bus Extender
    INIFILE R:\Windows\inf\usbstor.inf [USBSTOR.AddService] StartType = 0 ; SERVICE_BOOT_START
    INIFILE R:\Windows\inf\usbstor.inf [USBSTOR.AddService] LoadOrderGroup = Boot Bus Extender
    INIFILE R:\Windows\inf\brmfcsto.inf [USBSTOR.AddService] StartType = 0 ; SERVICE_BOOT_START
    INIFILE R:\Windows\inf\brmfcsto.inf [USBSTOR.AddService] LoadOrderGroup = Boot Bus Extender

    Now we delete the precompiled INF files, and copy our modified INF files to appropriate locations. Note that the file locations differ for x64 and x86 builds.

    For x64 builds only:
    DEL /Q R:\Windows\inf\usb.pnf
    DEL /Q R:\Windows\System32\DriverStore\FileRepository\usb.inf_amd64_neutral_e2b28ecac19a29af\usb.pnf
    DEL /Q R:\Windows\winsxs\amd64_usb.inf_31bf3856ad364e35_6.1.7600.16385_none_26ed589d28235a16\usb.pnf
    DEL /Q R:\Windows\inf\usbport.pnf
    DEL /Q R:\Windows\System32\DriverStore\FileRepository\usbport.inf_amd64_neutral_5a41ca742f7973cc\usbport.pnf
    DEL /Q R:\Windows\winsxs\amd64_usbport.inf_31bf3856ad364e35_6.1.7600.16385_none_19b7511a1d3ea7fd\usbport.pnf
    DEL /Q R:\Windows\inf\usbstor.pnf
    DEL /Q R:\Windows\System32\DriverStore\FileRepository\usbstor.inf_amd64_neutral_c301b770e0bfb179\usbstor.pnf
    DEL /Q R:\Windows\winsxs\amd64_usbstor.inf_31bf3856ad364e35_6.1.7600.16385_none_a47b405db18421ea\usbstor.pnf
    DEL /Q R:\Windows\inf\brmfcsto.pnf
    DEL /Q R:\Windows\System32\DriverStore\FileRepository\brmfcsto.inf_amd64_neutral_2d7208355536945e\brmfcsto.pnf
    DEL /Q R:\Windows\winsxs\amd64_brmfcsto.inf_31bf3856ad364e35_6.1.7600.16385_none_7fe64f7a6167bcf6\brmfcsto.pnf
    COPY /Y R:\Windows\inf\usb.inf R:\Windows\System32\DriverStore\FileRepository\usb.inf_amd64_neutral_e2b28ecac19a29af
    COPY /Y R:\Windows\inf\usb.inf R:\Windows\winsxs\amd64_usb.inf_31bf3856ad364e35_6.1.7600.16385_none_26ed589d28235a16
    COPY /Y R:\Windows\inf\usbport.inf R:\Windows\System32\DriverStore\FileRepository\usbport.inf_amd64_neutral_5a41ca742f7973cc
    COPY /Y R:\Windows\inf\usbport.inf R:\Windows\winsxs\amd64_usbport.inf_31bf3856ad364e35_6.1.7600.16385_none_19b7511a1d3ea7fd
    COPY /Y R:\Windows\inf\usbstor.inf R:\Windows\System32\DriverStore\FileRepository\usbstor.inf_amd64_neutral_c301b770e0bfb179
    COPY /Y R:\Windows\inf\usbstor.inf R:\Windows\winsxs\amd64_usbstor.inf_31bf3856ad364e35_6.1.7600.16385_none_a47b405db18421ea
    COPY /Y R:\Windows\inf\brmfcsto.inf R:\Windows\System32\DriverStore\FileRepository\brmfcsto.inf_amd64_neutral_2d7208355536945e
    COPY /Y R:\Windows\inf\brmfcsto.inf R:\Windows\winsxs\amd64_brmfcsto.inf_31bf3856ad364e35_6.1.7600.16385_none_7fe64f7a6167bcf6
    EXIT

    For x86 builds only:
    DEL /Q R:\Windows\inf\usb.pnf
    DEL /Q R:\Windows\System32\DriverStore\FileRepository\usb.inf_x86_neutral_e24d8d3fec6e4567\usb.pnf
    DEL /Q R:\Windows\winsxs\x86_usb.inf_31bf3856ad364e35_6.1.7600.16385_none_cacebd196fc5e8e0\usb.pnf
    DEL /Q R:\Windows\inf\usbport.pnf
    DEL /Q R:\Windows\System32\DriverStore\FileRepository\usbport.inf_x86_neutral_ba59fa32fc6a596d\usbport.pnf
    DEL /Q R:\Windows\winsxs\x86_usbport.inf_31bf3856ad364e35_6.1.7600.16385_none_bd98b59664e136c7\usbport.pnf
    DEL /Q R:\Windows\inf\usbstor.pnf
    DEL /Q R:\Windows\System32\DriverStore\FileRepository\usbstor.inf_x86_neutral_83027f5d5b2468d3\usbstor.pnf
    DEL /Q R:\Windows\winsxs\x86_usbstor.inf_31bf3856ad364e35_6.1.7600.16385_none_485ca4d9f926b0b4\usbstor.pnf
    DEL /Q R:\Windows\inf\brmfcsto.pnf
    DEL /Q R:\Windows\System32\DriverStore\FileRepository\brmfcsto.inf_x86_neutral_39ae61431a44cded\brmfcsto.pnf
    DEL /Q R:\Windows\winsxs\x86_brmfcsto.inf_31bf3856ad364e35_6.1.7600.16385_none_23c7b3f6a90a4bc0\brmfcsto.pnf
    COPY /Y R:\Windows\inf\usb.inf R:\Windows\System32\DriverStore\FileRepository\usb.inf_x86_neutral_e24d8d3fec6e4567
    COPY /Y R:\Windows\inf\usb.inf R:\Windows\winsxs\x86_usb.inf_31bf3856ad364e35_6.1.7600.16385_none_cacebd196fc5e8e0
    COPY /Y R:\Windows\inf\usbport.inf R:\Windows\System32\DriverStore\FileRepository\usbport.inf_x86_neutral_ba59fa32fc6a596d
    COPY /Y R:\Windows\inf\usbport.inf R:\Windows\winsxs\x86_usbport.inf_31bf3856ad364e35_6.1.7600.16385_none_bd98b59664e136c7
    COPY /Y R:\Windows\inf\usbstor.inf R:\Windows\System32\DriverStore\FileRepository\usbstor.inf_x86_neutral_83027f5d5b2468d3
    COPY /Y R:\Windows\inf\usbstor.inf R:\Windows\winsxs\x86_usbstor.inf_31bf3856ad364e35_6.1.7600.16385_none_485ca4d9f926b0b4
    COPY /Y R:\Windows\inf\brmfcsto.inf R:\Windows\System32\DriverStore\FileRepository\brmfcsto.inf_x86_neutral_39ae61431a44cded
    COPY /Y R:\Windows\inf\brmfcsto.inf R:\Windows\winsxs\x86_brmfcsto.inf_31bf3856ad364e35_6.1.7600.16385_none_23c7b3f6a90a4bc0
    EXIT

    The next part is optional. It creates a differencing .VHD from the original file. The allows you to leave the base .VHD file intact and make all subsequent changes to the differencing .VHD instead. It’s a great way of building a base operating system image and then branching it for development work or testing. Once again, make sure you note the correct volume number when doing this. So, from the original elevated command prompt:

    DISKPART
    SELECT VDISK FILE=”M:\BootVHDs\W2K8R2ENT.vhd”
    DETACH VDISK
    CREATE VDISK FILE=”M:\BootVHDs\W2K8R2ENT_DIFF.vhd” PARENT=”M:\BootVHDs\W2K8R2ENT.vhd”
    SELECT VDISK FILE=”M:\BootVHDs\W2K8R2ENT_DIFF.vhd”
    ATTACH VDISK
    LIST VOLUME
    SELECT VOLUME 8
    ASSIGN LETTER=R
    EXIT

    Now all that is left to do is to create a bootloader on the external USB disk and create an entry for our Native VHD Boot. When you BCDEDIT /COPY {default} below, note the resultant GUID that you are given and use that instead of the {5aaa2c7a-a627-11de-83c7-001372bf1815} listed in the example. So, continuing from the same command window:

    BOOTSECT /NT60 M: /FORCE /MBR
    BCDBOOT R:\WINDOWS /S M:
    BCDEDIT /STORE M:\BOOT\BCD /COPY {default} /d “Windows Server 2008 R2 Enterprise”
    BCDEDIT /STORE M:\BOOT\BCD /SET {5aaa2c7a-a627-11de-83c7-001372bf1815} DEVICE VHD=[LOCATE]\BootVHDs\W2K8R2ENT_DIFF.vhd
    BCDEDIT /STORE M:\BOOT\BCD /SET {5aaa2c7a-a627-11de-83c7-001372bf1815} OSDEVICE VHD=[LOCATE]\BootVHDs\W2K8R2ENT_DIFF.vhd
    BCDEDIT /STORE M:\BOOT\BCD /SET {5aaa2c7a-a627-11de-83c7-001372bf1815} DETECTHAL ON

    And that’s it. Reboot your computer, select your external USB disk as your boot device, and you should see the entry you created above. Windows will start, perform the final stages of setup (rebooting a couple of times in the process) and you will be done.

    I have personally used this method to store a large number of .VHD files (fixed, dynamic and differencing) and to use them to boot Windows 7 Enterprise and Ultimate in both x64 and x86 platform versions, and the various Windows Server 2008 R2 editions, and found it to be an extremely flexible option.

    I’ve even had some success swapping the external USB disk between machines. It doesn’t always work (and to be honest, I haven’t had the time to look any deeper into why) but I’ve used the same native VHD boot instance on a Fujitsu Siemens Celsius H240, Lifebook T4210 and Lifebook S7220, swapping it backwards and forwards between machines and letting Windows manage the driver changes each time without issue.

    I’ve also had success with native VHD boot using .VHD files created from Windows Backup and have recently started looking at using the files created from the SysInternals Disk2vhd tool too. Pop back sometime soon and you may even find another guest post documenting those particular adventures…

    [MW: Sounds great Garry! Looking forward to it]

  • Native boot from VHD on a Windows XP computer

    Guest PostLike almost every other corporate in the world, where Mark and I work there is a standard build deployed to everyone. The default in our particular organisation is a 32-bit Windows XP OS regardless of the capabilities of the laptop or desktop it is deployed to. Over the years, this has caused a number of problems that have required an increasing number of “exemptions” from standard policy to allow people to run a different Windows version or platform.

    Whilst this hasn’t been too much of a problem for the majority of the Architects that Mark and I work with – after all, we’re fairly self-sufficient when it comes to supporting our environments and are infinitely capable of collectively dreaming up ever more creative workarounds for the things that don’t work – it isn’t a solution that’s manageable at scale.

    Then, along came Windows 7 and Windows Server 2008 R2 and with them came the introduction of a great new feature – Native Boot from VHD. With a little configuration, this has enabled us to leave the existing Windows XP corporate build in place, and to deploy a 32-bit or 64-bit Windows 7 (Enterprise or Ultimate) or 64-bit Windows Server 2008 R2 build side-by-side, crucially without having to make any changes to the Windows XP build or the existing disk partitioning scheme.

    To achieve this, we created a new Windows 7 or Windows Server 2008 R2 bootloader, and “chained” the original Windows XP bootloader from it. At boot, this allows us to select a Native Boot from VHD into, for example, a 64-bit Windows Server 2008 R2 Enterprise build, or to select the chained bootloader which allows us to boot into the corporate Windows XP build.

    Of course, you’ll need to create your VHD-contained Windows 7 or Windows Server 2008 R2 OS build and put it to your local disk, and this post doesn’t go into that detail, but once you have done that, the steps below will allow you to create a new bootloader and chain your existing Windows XP corporate build from it.

    To begin, boot your computer using your Windows 7 or Windows Server 2008 R2 installation media.

    When you reach the Install Windows screen, select your preferences in the Language to installTime and currency format, and Keyboard or input method boxes, and then click Next.

    Do not click Install now. Instead, click Repair your computer.

    The search for supported operating systems will fail, and the System Recovery Options dialog box appears with the Restore your computer using a system image that you created earlier option selected. Click Next.

    The Re-image your computer tool will fail to find a system image and will display a dialog informing you of this. Click Cancel on the dialog, and then Cancel again on the main tool window.

    The System Recovery Options menu appears. Click Command Prompt.

    To write the new Windows 7 or Windows Server 2008 R2 bootloader:

    BOOTSECT /NT60 C: /FORCE /MBR

    To create a BCD store from the Windows VHD:

    DISKPART
    SELECT VDISK FILE=C:\BOOTVHDS\W2K8R2ENTX64.VHD
    ATTACH VDISK
    ASSIGN LETTER=X
    EXIT
    BCDBOOT X:\WINDOWS /S C:

    Set up the VHD native boot:

    BCDEDIT /SET {default} DEVICE VHD=[LOCATE]\BOOTVHDS\W2K8R2ENTX64.VHD
    BCDEDIT /SET {default} OSDEVICE VHD=[LOCATE]\BOOTVHDS\W2K8R2ENTX64.VHD
    BCDEDIT /SET {default} DETECTHAL ON

    Set up the legacy boot:

    BCDEDIT /CREATE {ntldr} /d "Chain Legacy Bootloader"
    BCDEDIT /SET {ntldr} DEVICE PARTITION=C:
    BCDEDIT /SET {ntldr} PATH \ntldr
    BCDEDIT /DISPLAYORDER {ntldr} -ADDLAST

    To put things back to normal, should you ever need to:

    BOOTSECT /NT52 C: /FORCE /MBR

  • SharedView: Free desktop sharing across the ‘net

    My friend and colleague Garry Martin just dropped me a mail to see if I’d help him test a new Microsoft application called SharedView.

    I say “new” because it only went to version 1.0 yesterday, but SharedView (formerly code named Tahiti) has been around for a while now – Scott Hanselman wrote about it last year and Mary Jo Foley covered it back in 2007.  So what is it?  Basically, think Live Meeting, then strip out the VoIP bit, and the hassle.  What you’re left with is SharedView.  This application lets me share my desktop (or selected applications) with up to 15 other users on an ad-hoc basis.  It works through firewalls with no configuration and, whilst a Windows Live ID is required to set up a session, connecting should be as easy as clicking a link to navigate to a web page.  Because of this architecture though, it does need a working Internet connection (i.e. it won’t work between two computers on a private network).  It seems to cope pretty well with disparate screen resolutions too – I’m running 1280 x768 and Garry was on a higher-resolution display but the downscaling was still readable.

    And I haven’t mentioned the best bit yet.  It’s free (and available from the Microsoft Download Center).

  • Adventures with Intel Virtualization Technology (VT)

    A couple of weeks ago, David Saxon and I ran a Windows 7 Skills Update workshop for some of our colleagues, based on a course obtained from the Microsoft Partner Training and Readiness Resource Center.  My plan was to use David’s excellent training skills to deliver the course (which I recorded), before he left the organisation to take up a new challenge.  Ironically, working for an IT company means that it’s not always easy to get hold of kit for labs and David called in a number of favours in order to get hold of 8 brand new PCs and monitors for us to run the labs.  Each machine was supplied with a quad core CPU and 8GB of RAM but, when we tried to enable the Hyper-V role in Windows Server 2008 R2, it failed because these computers didn’t support Intel’s Virtualization Technology (VT).

    “No VT?”, I said “But these are Intel Core2Quad processors… ah…” – I remembered seeing something about how some Core2Quads don’t provide Intel VT support, even though the Core2Duos do.  These were the Q8300 2.5GHz chips and, according to an Intel document, the specification was changed in June to correct this and enable the VT.

    I should have known better – after all, I’m an MVP in Virtual Machine technology – but I put my hands up, I didn’t check the specifications of the machines that David had ordered (and anyway, I would have expected modern CPUs to include VT).  Mea Culpa.

    As the PCs had been manufactured in August, I thought there was a chance that they used the new CPUs but did not have BIOS support for VT.  If that was the case, it may have been possible to enable it (more on that in a moment) but running both CPU-Z and Securable confirmed that these processors definitely didn’t support VT.

    In this case, it really was a case of the CPU not providing the necessary features but there are also documented cases of PCs with VT not allowing it to be enabled in the BIOS.  Typically the OEM (most notably Sony) claims that they are consumer models and that VT is an enterprise feature but with Windows 7’s XP Mode relying on Virtual PC 7, which has a dependency on Intel VT or AMD-v, that argument no longer holds water (XP Mode is definitely a consumer feature – as it’s certainly not suitable for enterprise deployment, regardless of Microsoft’s Windows 7 marketing message around application compatibility).

    However, with a little bit of perseverance, it may be possible to force VT support on PCs where the functionality is there but not exposed in the BIOS.  Another friend and colleague, Garry Martin, alerted me to a forum post he found where a utility was posted to enable VT on certain Fujitsu machines that have been restricted in this way.  I should say that if you try this, then you do so at your own risk and I will not accept any responsibility for the consequences.  Indeed, I decided not to try it on my problem machines because they were a different model and also, I didn’t fancy explaining to our Equipment Management team how the brand new PCs that we’d borrowed for a couple of days had been “bricked”.  In fact, I’d think it highly unlikely that this tool works on anything other than the model described in the forum post (and almost certainly not with a different OEM’s equipment or with a different BIOS).

    Incidentally, Ed Bott has reasearched which Intel desktop and mobile CPUs support VT and which do not.  As far as I know, all recent server CPUs (i.e. Xeon processors) support VT.

  • A quick guide to Microsoft .NET Framework versions

    Microsoft .NET logoI’ve never really understood why certain applications require installation of the Microsoft .NET Framework, even though there’s already a version included within the operating system. Surely each version of the framework includes previous versions? Well, it seems not – as David Allen from the Microsoft UK ISV Developer Evangelism Team explained to me recently:

    • The original version of the Microsoft .NET Framework (v1.0.3705.0) was released in 2002. Version 1.1.4322.573 updated both the framework and the common language runtime (CLR) and was included within Windows Server 2003.
    • With version 2.0.50727.42, Microsoft again updated both the framework (classes) and the CLR but this version was incompatible with v1.x and the two could be run side by side on the same system.
    • It’s logical to think that v3.x (a major release) would also include a new CLR but 3.0.4506.30 (which shipped with Windows Vista and Windows Server 2008) and 3.5.21022.8 (shipping with Windows 7 and Windows Server 2008 R2) add new framework classes but use the existing v2.0 CLR.
    • The next version will be 4.0 and is currently in beta. This will include a new CLR and will run side by side with v1.x and v2.x/3.x installations on the same system.

    It’s no wonder I was confused – it’s a complete mess! A .NET Framework application that requires v2.0 will happily run on a system with v3.5 but a v1.x application needs v1.1 to be installed, and a v4.x application will require v4.0. It’s entirely feasible that, in the near future, a Windows 7 machine may need v1.1, v3.5 SP1 and v4.0 to all be installed to support different applications.

    To find out which versions are installed on a given system, take a look in the %systemroot%\Microsoft.NET\Framework folder. Futher information on the various releases of the Microsoft .NET Framework (including service packs) is available on MSDN.

  • Windows 8 predictions

    Just in case you were wondering if the Windows client has a future after Windows 7 (it does), several Internet news sites are reporting that a Microsoft employee accidentally leaked details of his work on future Windows versions on his LinkedIn profile.  According to Gizmodo, Microsoft Research employee Robert Morgan carelessly left the following details in full public view:

    “Working in high security department for research and development involving strategic planning for medium and longterm projects. Research & Development projects including 128bit architecture compatibility with the Windows 8 kernel and Windows 9 project plan. Forming relationships with major partners: Intel, AMD, HP, and IBM.

    Robert Morgan is working to get IA-128 working backwards with full binary compatibility on the existing IA-64 instructions in the hardware simulation to work for Windows 8 and definitely Windows 9.”

    It’s no secret that there will be a Windows 8 – Microsoft has already publicly committed to a new release in 3 years’ time; however anyone working in a “high security” role would be unwise to leave details of their work on a social networking site!

    For what it’s worth (I know nothing at this time… but when I do, I’m sure it will be under NDA so I should write it down now!), I would expect 64-bit computing to be mainstream on the client in the Windows 8 timeframe (and if you’re not considering it for Windows 7, then you should), and would only expect 128-bit to be relevant for high-end server versions (note that the quote above refers to IA-64 and IA-128 – so that’s Itanium rather than some new “x128” desktop hardware).  I’d also expect tighter integration with the cloud, and further developments in the area of boot from VHD, to further decouple the operating system from the hardware.

    Of course, all of this is pure speculation on my part.

  • Microsoft’s New Efficency comes to Wembley

    As I opened the curtains in my hotel room this morning, I was greeted with a very wet and grey view of North London. Wembley Stadium looks far less impressive on a day like today than it did in the night-time shot that graced the front page of Bing here in the UK yesterday but still it’s hard not to be in awe of this place.

    I’ve been to a couple of events at the new Wembley Stadium before: last year’s Google Developer Day (sadly there was no UK event this year); and the recent U2 concert – but this time I’m here courtesy of Microsoft for their UK Technical Launch event and the main products on show are Windows 7, Windows Server 2008 R2 and Exchange Server 2010 in what Microsoft is calling “The New Efficiency”.

    I was twittering throughout the event @markwilsonit but this post highlights some of the key messages from the main sessions today, although I’ve skipped over the details of the standard technical product demonstrations as I hope to cover these in future posts:

    • There are more than 7100 applications tested and working on Windows 7 today and there should be more than 8000 certified by the time that the product hits general availability.
    • Windows 7 was beta tested by more than 8 million people, with 700,000 in the UK.
    • The Windows Optimised Desktop is represented by a layered model of products including:
      • Management infrastructure: System Center and Forefront for deployment, application management, PC monitoring and security management.
      • Server infrastructure: Windows Server 2008 R2 for Active Directory, Group Policy, network services and server-based client infrastructure.
      • Client infrastructure: Windows 7 and the Microsoft Desktop Optimisation Pack for the Asset Inventory Service, AppLocker and BitLocker.
    • Windows is easier than ever to deploy, using freely available tools such as the Microsoft Deployment Toolkit (MDT) 2010 to engineer, service and deploy images – whether they are thin, thick or a hybrid.
    • System Center Configuration Manager (SCCM) 2007 provides a deployment engine for zero-touch installations, hooking into standard tools such as MDT, the User State Migration Tool (USMT), WinPE, etc.
    • PowerShell is becoming central to Windows IT administration.
    • Windows Server 2008 R2’s new brokering capability presents new opportunities for server based computing.

    For me, the highlight of the event was Ward Ralston’s appearance for the closing keynote. Ward used to implement Microsoft infrastructure but these days he is a Product Manager for Windows Server 2008 R2 (I’ve spoken to him previously, although today was my first chance to meet him face to face). Whilst some delegates were critical of the customer interviews, his New Efficiency presentation nicely summarised the day as he explained that:

    • Many organisations are struggling with decreasing IT budgets.
    • Meanwhile IT departments are trying to meet the demands of: IT consumerisation (as a generation that has grown up with computers enters the workforce); security and compliance (the last few years have brought a huge surge in compliance regulations – and the global “economic reset” is sure to bring more); and an ever-more mobile and distributed workforce (where we need to ensure confidentiality and non-repudiation wherever the users are).
    • IT departments have to cut costs – but that’s only part of the solution as productivity and innovation are just as important to increase efficiency.
    • In short (productivity + innovation)/cost = doing more with less
    • Managing more with less is about: reducing IT complexity; improving control and reducing helpdesk costs; increasing automation; and consolidating server resources.
      Doing more is about: enabling new services, efficiently connecting people to information, optimising business processes, and allowing employees to securely work from anywhere
    • Microsoft’s New Efficiency is where cost savings, productivity and innovation come together.

    It would be easy to criticise today’s event, for instance to pick out certain presenters who that could have benefited from the use of Windows Magnifier, but I know just how much work went into making today’s event run as smoothly as it did and, on balance, I felt it was a good day. For those who have never been to a Microsoft launch, they may have expected something more but I’ve been to more of these events than I care to remember and so this was exactly what I expected: lots of marketing rhetoric delivered via PowerPoint; some demos, most of which worked; and, I think, something for everyone to take away and consider as their organisation looks at meeting the challenges that we all face in our day jobs – even if that was just the free copy of Windows 7 Ultimate Edition… (full disclosure: I accepted this offer and it in no way influences the contents of this blog post).

    I’ll be back at Wembley again tomorrow, this time for the Microsoft Partner Network 2009 – and expect to see more Windows 7 and Server 2008 R2 related posts on this site over the coming weeks and months.

  • Technology actually saved me some time this morning!

    I’ll be spending the next couple of days at Fujitsu Laboratories’ European Technology Forum listening to presentations on some of the new and upcoming technological advances that could well be making their way into our daily lives (disclosure: I work for Fujitsu but that has no bearing on the contents of this blog post). I had considered driving to London (and leaving the car at my hotel) but, in the end, I decided to take the train. As the state of our railways is something that us Brits spend a lot of time complaining about (since long before privatisation), it’s nice to have something positive to write about my journey this morning.

    A few years ago, catching the train meant a weekly trip to the bank to obtain sufficient coinage to feed the parking machines at the station (even when credit card payment was introduced, not all of the machines could accept cards), getting up stupidly early to make the 12 mile trip from the small town where I live to my nearest station, parking the car (if there were any spaces left) and joining a queue to buy a ticket. All of this meant that, in order to ensure I was able to catch a particular train, I needed to allow 45 minutes to an hour.

    This time, I used the online booking system to buy my tickets in advance (although, because it was only a few hours in advance, there was no option to have a ticket mailed to me but I did have the collection reference sent over by SMS). Then, when I got to the station, I found a parking space and, instead of feeding money or a credit card into the machine, I used the pay by phone service to enter my location code, confirm my car registration, the length of my stay and my credit card details. I then collected my tickets from a machine and, around 30 minutes after leaving my house, was on the platform waiting for the 07:28 to arrive. Meanwhile, the parking system had e-mailed me a receipt ready for my expenses claim.

    None of this is exactly rocket science, but it’s a step in the right direction and a huge timesaver. Looking to the future, there is no reason why the parking payment system couldn’t identify my location using GPS (as more and more mobile phone handsets become GPS enabled) and why I couldn’t print my own rail tickets from home (albeit without the magnetic stripe to operate the barriers at the station – although these could use an alternative access control technology).

    Now, the fact that I had to pay £13 for parking my car on top of my £40 travel (when there was no public transport alternative to get to and from the station)… that’s an entirely separate issue about which I’m less happy…

  • Creating an iSCSI target on a Netgear ReadyNAS

    A few months ago, I wrote that I was looking for an iSCSI target add-on for my Netgear ReadyNAS Duo. I asked if such an add-on was available on Netgear’s ReadyNAS community forums; however it seems that these are not really a true indication of what is available and the moderators are heavily biased by what Netgear supports, rather than what can be done. Thanks to Garry Martin, who pointed me in the direction of Stefan Rubner’s ReadyNAS port of the iSCSI Enterprise Target Project, I now have a ReadyNAS acting as an iSCSI target.

    I have a lot of data on my first ReadyNAS and, even though I backed it all up to a new 1.5TB drive in my server (which will eventually be swapped into the the ReadyNAS as part of the next X-RAID upgrade), I wasn’t prepared to risk losing it so I bought a second ReadyNAS to act as an iSCSI target for serving virtual machine images. In short, don’t run this on your ReadyNAS unless you are reasonably confident at a Linux command prompt and you have a backup of your data. This worked for me but your mileage may vary – and, if it all goes wrong and takes your data with it, please don’t blame me.

    First up, I updated my ReadyNAS to the latest software release (at the time of writing, that’s RAIDiator version 4.1.6). Next, I enabled SSH access using the Updates page in FrontView with the EnableRootSSH and ToggleSSH addons (note that these do not actually install any user interface elements: EnableRootSSH does exactly what it says, and when it’s complete the root password will be set to match the admin password; ToggleSSH will enable/disable SSH each time the update is run).

    The next step was to install the latest stable version (v0.4.17-1.0.1) of Stefan Rubner’s iSCSI target add-on for ReadyNAS (as for EnableRootSSH and ToggleSSH, it is simply applied as an update in FrontView).

    With SSH enabled on the ReadyNAS, I switched to using a Mac (as it has a Unix command prompt which includes an SSH client) but any Unix/Linux PC, or a Windows PC running something like PuTTY will work too:

    ssh root@ipaddress

    After changing directory to /etc (cd /etc), I checked for an existing ietd.conf file and found that there was an empty one there as ls-al ie* returned:

    -rw-r–r–    1 admin    admin           0 Dec  3  2008 ietd.conf

    I renamed this (mv ietd.conf ietd.conf.original) and downloaded a pre-configured version with wget http://readynasfreeware.org/gf/download/docmanfileversion/3/81/ietd.conf before editing the first line (vi ietd.conf) to change the IQN for the iSCSI target (a vi cheat sheet might come in useful here).

    As noted in the installation instructions, the most important part of this file is the Lun 0 Path=/c/iscsi_0,Type=fileio entry. I was happy with this filename, but it can be edited if required. Next, I created a 250GB file to act as this iSCSI LUN using dd if=/dev/zero of=/c/iscsi_0 bs=10485760 count=25600. Beware, this takes a long time (I went to the pub, came back, wrote a good chunk of this blog post and it was still chugging away for just over 4 hours; however it’s possible to get some idea of progress by watching the amount of free space reported in FrontView).

    At this point, I began to deviate from the installation notes – attempting to run /etc/init.d/rfw-iscsi-target start failed so I rebooted the ReadyNAS but when I checked the Installed Add-ons page in FrontView I saw that the iSCSI target was already running although the target was listed as NOT_FOUND and clicking the Configure Targets button seemed to have no effect (I later found that was an IE8 issue – the button produced a pop-up when I ran it from Safari over on my Mac and presumably would have worked in another browser on Windows too).

    I changed the target name to /c/iscsi_0, saved the changes, and restarted the ReadyNAS again (just to be sure, although I could have restarted the service from the command line), checking that there was a green light next to the iSCSI target service in FrontView (also running /etc/init.d/rfw-iscsi-target status on the command line).

    ReadyNAS iSCSI Target add-on configuration

    With the target running, I switched to my client (a Windows Server 2008 computer) and ran the iSCSI initiator, adding a portal on the Discovery tab (using the IP address of the ReadyNAS box and the default port of 3260), then switching to the Targets tab and clicking the Refresh button. I selected my target and clicked Log On… waiting with baited breath.

    Windows iSCSI initiator Discovery tabWindows iSCSI initiator Discovery tab

    iSCSI target exposed in Disk Management

    No error messages indicated that everything was working so I switched to Server Manager and saw a new 250GB unallocated disk in Disk Management, which I then brought online and initialised.

    Finally, I updated /etc/rc6.d/S99reboot to include /etc/init.d/rfw-iscsi-target stop just before the line that says # Save the last 5 ecounters by date.