I’m taking a breather from re-recording the voice track for a Video on Live Migration in Hyper-V. When it’s done it will end up on YouTube.
Now YouTube is giving me pause right now: it is certainly the easiest way to put up videos so that people can find them. I’m viewing it as an experiment because anecdotal evidence suggests that the audience I’m trying to reach (IT Professionals) don’t really think of it as a good source of content. And also because you-tube is all very well for bits of fun (like this one or these ) but if you have a serious message isn’t it a bit needy ?
Consider the case, for example, that you have had things pretty much your own way for years, but now it seems everyone who hasn’t deserted you yet is flirting with the other side, the people who pay your wages are even beginning to question the money they pay you. This may sound like Gordon Brown’s attempts to woo the public – although derided by his colleagues* at least he has some more control over YouTube than press photos - but in fact I was referring to VMware.
There’s a video on You tube which starts with a factual error about Technet and MSDN. First off, Technet and MSDN themselves didn’t fail, the failure was in the download site for Windows 7, Server 2008 R2 and Hyper-V Server R2. Demand for these greatly outstripped predictions – there just wasn’t enough hardware capacity, as explained here. I don’t have the stats on how many of the downloads were for Hyper-V server R2 or people wanting to test Hyper-V on Windows Server 2008 R2, we’d been averaging in excess of 100,000 downloads per month of the first release of Hyper-V. Live migration was missing from that release (the main reason that customers chose VMware) but its in R2 - even with the free Hyper-V server product (hence my video). These must be scary times at VMware… but I digress.
Last year I ripped a hole in VMware’s dishonest pricing examples, this year one someone thought it would be a wheeze to post footage of Hyper-V blue screening on YouTube. He kept quiet about who he was, but it didn’t take long for Virtualization Review to reveal “the root cause of the VMware FUD: Scott Drummonds.” as they go on to say “his job basically is to look at the competition and spread the word about VMware superiority. Unfortunately, Drummonds doesn't identify himself on the Hyper-V crashing video. Why not? Cynics might say because the video would have less impact if they knew it came from Microsoft's chief virtualization competitor”.
Drummonds confesses he made the post and gives some blather about using two virtual disks (in VMware IDE performance isn’t much good, so they run the test from SCSI disks. In Hyper-V IDE performance matches SCSI yet they wanted to run the test from SCSI disks, which conveys a degree of ignorance of hyper-V and a lack of scientific method - what effect does doubling the number of disks have on the validity of the tests ?).
Jeff Woolsey demolishes the Video – since it showed the STOP error at the blue screen he went digging and found from our 750,000 downloads of hyper-v “we've had 3 reports of crashes under stress and with the same error code as seen in the video bugcheck (0x00020001). The solution in all three cases was to upgrade the server BIOS which solved the problem”. VMware have seen similar things incidentally. I love a good demolition, so Jeff’s follow-up post makes good reading; in particular he points out that to have any merit a test has to be repeatable, there’s no published methodology, no statement of what is in the VMs being tested, what the hardware was etc. Jeff points out that VMware prohibit publication of benchmarks unless they have approved the way in which they are carried out, because as they put it Benchmarking is a difficult process fraught with error and complexity at every turn. It's important for those attempting to analyze performance of systems to understand what they're doing to avoid drawing the wrong conclusions or allowing their readers to do so."
As the question of disks made clear they don’t understand they are doing with hyper-v and anyone doing a serious test for publication would put in a call to Microsoft support and get a problem like this solved. Who says “A-ha ! a problem with the competitor let’s not try to fix, just video it and put it on YouTube.” … well Scott Drummonds, obviously. But you can decide for yourself if VMware – at least Scott – were allowing their readers to draw the wrong conclusions or deliberately leading them astray.
Oh and Scott, if you’re reading, anyone with a good knowledge of testing windows will tell you that SlMgr.vbs –rearm will stop that “You may a victim of counterfeiting” message spoiling your videos.
SlMgr.vbs –rearm
* I had to go to the source of Hazel Blears’ comment “You tube if you want to” because it sounded like there was something missing it’s obviously meant to echo the famous Thatcher quote “To those expecting a u-turn I say You turn if you want to … the lady’s not for turning”. The full quote is actually “I’m not against new media. YouTube if you want to. But it’s not substitute for knocking on doors”.
Update. Fixed some typos and bad edits.
A few of people have noticed that I’m running Windows 7 with a customized logon screen, and a couple of them asked me if I used “logon studio” which (as I understand it) rummages round inside some of the image resources buried in DLL files.
In Windows 7 we have provided a registry key for OEMS to turn on custom backgrounds it’s under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background and the name is OEMBackground, you can add it if it isn’t there – it’s a DWORD 1 indicates use the custom backgrounds and 0 means don’t. Beware, if you change Windows themes this gets reset – which implies the theme covers the background as well.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background
Once the option is enabled you need to create files in the %windir%\system32\oobe\info\backgrounds folder, the names are BackgroundHeightxWidth.JPG and BackgroundDefault.jpg so for this laptop I have a default and Background1920x1400.You can use this make your corporate Machine all more corporate or your personal machine that bit more personal. According the Windows 7 center where (I think) I first saw the tip the file size need to be under 256KB. If you want to customize the original background you find it’s named background.bmp in the OOBE folder (oobe for those who don’t know is Out Of Box Experience in Microsoft speak).
%windir%\system32\oobe\info\backgrounds
There is an interview with Scott Woodgate, published as press release on press pass entitled Helping Small Businesses With Windows 7 Professional and Windows XP Mode. After starting to speculate about this a little too soon, I want to clarify what the bits are. Because XP mode allows something which was previously only in MED-V, the term “Med-V Lite” has been used but this is an over simplification – perhaps misleadingly so. MED-V and Windows XP Mode service different audiences and solve different business problems:
Windows Virtual PC
Windows XP Mode
MED-V
Talking to people about Windows 7 one of the frequent things we mention is it works better on low end hardware. The major difference is the smaller memory foot print – using 100MB less memory makes little difference to a machine like my 4GB laptop, but on a 1GB netbook it’s a big difference. I’ve been thinking I might put it on my home machine (perhaps using boot from VHD to test it). So I was interest to come across a piece on NeoWin which picks up a video on YouTube , which shows a 1.3GHz machine with 512MB running 7 pretty happily. [In the interest of transparency, I haven’t researched anything about the poster of this video, I don’t have any reason not to take it at face value.]
Like Neowin, I’d be interested to know what the lowest people have gone to is… I might have to try 7 in a VM when I have built the VHD and see how low I can turn down the memory.
I’ve been updating two of my machines from the Beta to the RC of Server 2008 R2. It’s been quite a learning experience, and I’ve put together a video to show some of the things that Windows 7 and Server 2008 R2 can do with VHDs which should be posted soon. Along the way I’ve found some of the pitfalls and climbed out of them so let me share what happened.
The idea was simple enough. Install the new OS into a VHD, at the first reboot copy the VHD and use it to bring a second machine up at the same “mostly installed” point. That is quite simple 3 commands using BCD edit. In Windows NT from 3.1 all the way through to server 2003 the bootstap loader used a file named boot.ini to tell it what to do. Boot.ini made way for the boot configuration database, very clever it is too, unfortunately you can’t work on it in a text editor – instead of being an XML file or similar it it’s edited with BCD edit. The database contains a number of sections. One named “Windows Boot Manager” describes the menu which appears at boot time, another “Windows Boot Loader” describes the settings for the OS to boot and other sections can describe things like the RAMdisk windows Hyper-V boots from. If you run BCDEDIT /enum all from an elevated command prompt you can see what’s in it.
Windows 7 and Server R2 have some new bits in their boot loader to allow them to boot from a VHD file instead of a hard disk, and to the OSes themselves have some logic to cope with this. If you update the boot sector on a Windows Server 2008 or Vista machine (using BootSect in the boot folder of the Windows 7 / Server 2008 R2 install disk) you can make a machine which boots into Server 2008 (say) from the hard disk and Server 2008 from a VHD. No repartitioning disks or dealing with two sets of Windows on 1 partition. And that’s what I was running before.
It seemed like a good idea to re-create the entry in the BCD for my copied hard disk, so I deleted it and recreated a boot loader section.
BCDEDIT /copy {current} /D “Windows Server 2008 R2 RC on VHD”
This returns a GUID which you need to copy and use in two further commands: I got these wrong… not that I realized it.
While I was copying 10 gigs of VHD file to the second machine I finished the setup on the first enabling Hyper-V, Audio, the Windows Desktop experience, the PowerShell interactive environment and so on. Then it was time to boot machine 2. It failed. I tried fixing the BCD. No joy. It wasn’t clear to me if the problem was the BCD or VHD file so I copied the one I’d just finished configuring… which didn’t work either. I briefly made that machine totally unbootable by exporting the BCD from the working machine and importing it. BCDs aren’t portable, and it makes me think there is more information in there than you can see – so that it hooks the information up with the right disk. Fortunately I’d also exported the BCD I overwrote so I got back to where I had been. Over on the Virtualization blog my friend Mike Kolitz has a recent post about boot from VHD and wondering if I might something out of date or just wrong I checked the syntax he was using and it was completely different from mine. His went
bcdedit /set {GUID} osdevice vhd=[locate]\folder\filename.vhd bcdedit /set {GUID} device vhd=[locate]\folder\filename.vhd
This worked. The Set command in BCD edit takes 3 parts, the identifier of the section, the name of the Value being set in that section, and what that value should be set to . So VHD=[locate] isn’t telling the command about a VHD parameter the = sign is literal text. So I now I had a duplicate machine and to avoid problems with the domain I syspreped it, gave it a new name, set its IP address and joined it to the domain. All fine I tried to connect between the machines. No luck. I quickly eliminated the firewall as an issue, and both could talk to the domain controller, IP addresses were getting resolved. Time to check the arp cache. I can never remember the switches for arp.exe but it’s arp –a to dump out the cache (Oh yes a change from / to – for switches … I was already grinding my teeth missing the consistency and tab-expansion of switches the we have in Powershell). This led me to the discovery that I had duplicate MAC addresses on both machines – or strictly on both Virtual NICs which I had created in Hyper-V before duplicating the VHD. I’d ended up working at Machine 1 and deleting and recreating the network connection did no good at all. So, as if to prove that mistakes come in bunches, I set about re-installing machine 1. Had I thought about I would have reinstalled the copy, not the original. You see, when the MAC address is chosen for a virtual NIC it is based on the MAC address of the physical NIC (with the first few digits changed): recreating the virtual network on Machine 2 fixed the problem.
This gave me a chance to test some other PowerShell I have been writing to configure the machine, and I thought I would try doing the whole configuration from the command line. This lead me into the new “Deployment Image Servicing and Management tool” DISM.EXE which deserves a week of blog posts by itself. Notice how command line uses a colon rather than a space to separate the name of a parameter from its value.
DISM.exe /online /Enable-Feature /FeatureName:Microsoft-Hyper-V DISM.exe /online /Enable-Feature /FeatureName:Microsoft-Hyper-V-Management-Clients installs Hyper-V itself, then the management tools and hey presto it doesn’t work …. what ? Installing these parts doesn’t tell the hypervisor to load at boot time, that needs an entry in BCDEdit.
bcdedit /set "{default}" hypervisorlaunchtype auto
OK I had hyper-v working. I had the components I wanted installed, I used some my PowerShell Library for Hyper-v to set up the Virtual network and some other bits of Powershell that I’m getting ready to release to Set the IP address and patch the machine via windows update. PowerShell has a command to add a machine to a Domain so that was that taken care of – strangely there is no rename-machine, so that’s on my Powershell to-do list. The final step before creating my cluster was to hook up to ISCSI disks. I knew Dave Northey had posted about this so I copied the commands he used.
iscsicli QAddTargetPortal daven-2008 iscsicli QAddTarget iqn.1991-05.com.microsoft:daven-2008-daven-2008-target daven-2008 iscsicli QloginTarget iqn.1991-05.com.microsoft:daven-2008-daven-2008-target iscsicli PersistentLoginTarget iqn.1991-05.com.microsoft:daven-2008-daven-2008-target T * * * * * * * * * * * * * * * 0 iscsicli BindPersistentVolumes iscsicli ListPersistentTargets iscsicli ReportTargetMappings
And the 4th one down really does have 17 parameters of which 15 are “*” Notice also how the commands don’t use / or – ; if nothing else I might wrap these up in PowerShell to make them easier to call.
I might drill a little deeper into the way these work for future posts, but right now I want to finish my PowerShell “Configurator” script which I referred to above. And I have a video in the works for uses of VHDs.
Do you have lots of icons on your windows desktop ? I do. And sometimes when I’m giving a presentation I think not only do they look untidy, there might be something given away by the icon and file name. The fix for that is to create a folder named “my stuff” or “everything else” and drag everything into it. Bringing the files back means rearranging them so I know where they are and there’s a few minutes wasted.
As of RC windows 7 has two options on the desktop’s “Context” menu (the right click menu as most people call it) under View
“Show desktop icons” and “show desktop gadgets”,
So if you have “Dastardly plans.docx” and a “Dastardly plans progress” gadget you can hide them in a couple of clicks and bring them back exactly as they were .
Obviously I don’t have anything like that in my screen shot : I do like like the gadget which now comes with media center, but I don’t want to start presentations with a distraction on Dr Who. I think media center needs a good“what’s on TV right-now gadget” the only ones I saw on Vista were flakey
Update: Someone in the audience for a presentation told me that this was not new in Windows 7. I told him it most certainly was. Then I fired up XP in a Virtual Machine and found the option is there - though the menu isn't as easy to use, and checked on Vista and it is there too. It's not unusual for me to forget when a feature was introduced, but I'd missed this one altogether. At least I did it in time to say to the audience I had got my facts wrong.
ComputerWorld have an interesting piece up about XP Mode for Windows 7. Saying that it “could create support nightmares, analysts said today”
They quote Michael Cherry, an analyst at Directions on Microsoft as saying “I think that this will help the uptake for Windows 7, because it removes one more 'gotcha,' and that's never a bad thing to do”.Well indeed, as computerworld goes on to say: The idea of using virtualization to provide backward compatibility for older applications is neither novel nor surprising, Cherry continued. He called it a nice "safety net" for users concerned about abandoning XP who don't have access to centrally managed MED-V”
If you have more than 5 machines you can get Software Assurance and add the Microsoft desktop optimization pack (MDOP): so you get Microsoft Enterprise Desktop Virtualization (MED-V). I’m surprised that no one has yet portrayed XP Mode as a way of raising the profile of MED-V to sell more MDOP packages. XP mode is managed locally with users “owning” the VM; anything deployed to hundreds or thousands of desktops without central management can earn the label of “support nightmare”. MED-V provides that central management. Computerworld have a quote from a Gartner analyst, Michael Silver: “You'll have to support two versions of Windows, each needs to be secured, antivirused, firewalled and patched. Businesses don't want to support two instances of Windows on each machine. If a company has 10,000 PCs, that's 20,000 instances of Windows”
I think he’s wrong on that point. You don’t have to support the whole of the legacy OS in this situation – for example you don’t need to provide all the drivers for it. You just have to support configuring the legacy app on it – which is what you have been doing for the life of that OS anyway. For many of these applications you can use the simplest firewall ever – disconnect the network. We won’t surf the internet from the VM, read mail on it or do most things that risk introducing malware: this smaller attack surface means a “compatibility VM” can get away with a lower level of security. When he says “If a company has 10,000 PCs” the rest of the sentence should be “they should be using MED-V”. In an organization of that size 10,000 user controlled / unaudited machines (physical or virtual) is not an option.
I agree with him on a different point in the Computerworld article: “Companies need to heal their applications," Silver said. "They'll be doing themselves a disservice if, because of XPM, they're not making sure that all their apps support Windows 7." If these apps need to be “healed” does that make them “sick” ? Whatever label we use, there are organizations that depend on outdated applications which they didn’t write. For some reason a new version which supports Vista/Windows 7 can’t be deployed – not least because Software vendors go bust. Silver makes the point “What happens in 2014, when XP isn't supported anymore ?”. XP is out of mainstream support now: customers can buy into extended support, but those running XP mode won’t. The applications are probably out of support too. But we have people running NT4 virtualized (but unsupported) in their data centres for some ancient-but-critical apps: the same will happen on the desktop.
As well as the known “sick” apps, there are organizations who don’t have a complete list of applications deployed at user or departmental level: they can’t say “everything we have works on Vista/Windows 7” because they can’t define “everything”: so XP mode is a useful safety net Michael Cherry put it ‘It removes one more “Gotcha”’.
I wouldn’t dream of arguing with the notion that “companies will be much better off if they make all their applications run on Windows 7.” as Silver put it. An application which was written properly in the 1990’s will run on 7 (I still like paintshop pro 5 and it has a copyright date of 1999): there isn’t a kind way to say it, but excluding drivers and utilities which need to get into the guts of the OS (anti-virus being the classic case) if an Application doesn’t work on an updated OS, it wasn’t written properly in the first place, so you have to ask what else is wrong with it. Sooner or later the cost of keeping it going (whether that is lost productivity from staying on an old OS , or the cost of supporting it under virtualization) outweighs the cost of getting rid of it. Since developers have had access to Vista since early 2006 if there isn’t a fixed version now there probably never will be. It’s very easy to say that such applications should be thrown out and replaced, it’s just turns out to be hard to do in practice.
So the message should be clear
One final thought not all current Intel Processors have the VT technology that Windows Virtual PC needs. If you are thinking about buying a new PC or if advise small business buyers, make sure VT Support is checked for. Ed Bott has a good post with the details of the chips.
Windows Virtual PC is on Technet for people to download, the Windows Virtual PC page says it will be available to everyone on May 5th, but the evaluation guide is available already
I’ve installed it and started to play. I’ve only got one application which won’t work under 64 bit (Vista / Windows7 or XP) – which is the remote control application for my Pentax digital SLR camera, which seems to be a good way to test the USB integration: frankly I’ll be astonished if it works. Although the software is only useful if you own a Pentax camera, it still requires you to insert the CD which came with the camera before it will install. Grrr. So I’ve been through the setup – I have a little video in the pipeline to show it but it’s described in the eval guide. There are two parts to install Virtual PC, which is packaged as a KB update file,and (unless you want to build your Virtual Machine) the pre-built XP VM, which is just a large installation file. They can be installed in either order : and with a coupe of bits of user input the VM churns away to itself configuring all the necessary bits.
The integration of Virtualized applications has a simplicity and elegance to it –add something to the start menu in the Virtual machine and it shows up on the start menu in the host. So I copied the IE shortcut and it appeared on the Windows 7 start menu.
I recently read a summary of a Forester report on the number of businesses still on IE6. As the author put it “While the tech press spends a lot of time talking about Web 2.0 and even 3.0 Corporate America is on Web 0.5.” That might sound a bit harsh but were but 3 years ago now I wrote here that “If IE6 were a vegetable it would be a plain boiled potato; ubiquitous, reliable, but not exactly exciting.”. It’s been around since 2000 and in the last 8 and a bit years there has been a lot of innovation in browsers (the better the competitors in the market the more innovations in the everyone’s products).
So here is IE6 running as a Virtual Windows XP application, with a modern browser in the back ground
You’ll need to open the full size version to see it but there are a few things to see in the screen shot.
(1) Virtualized apps use the “furniture” of the OS they running in – so no aero glass and Windows XP minimize/maximize/close Icons
(2) The Icon for a virtualized app (the rightmost one) is looks similar to the one for the remote desktop connection.
(3) Notice how “My Documents” on the Host computer is mapped through to “My Documents” in the virtual app.
What I like about most about this is the lack of fuss and bother… Now to find that Pentax CD.
Virtual Hard Disk (VHD) files have been given greater importance in Windows 7 and Server 2008 R2. They’ve always been used for hosting virtual machines (from the earliest Virtual PC through to Hyper-V) , and in Vista the complete image backup began to use VHD format, the iSCSI target software in Storage server – which is now available to TechNet subscribers. But in the new OSes we can boot from a VHD, mount VHDs and create VHDs in the standard OS.
In the library I created for Hyper-V, one of the first things I wanted to do was to be able to create VHDs and Mount and Unmount them. In fact when Hyper-V mounts the disk it doesn’t bring it on-line and flags it read only, so the PowerShell code I wrote not only had to call the WMI functions provided by hyper-V’s Image Management Service, but it also needed to invoke DiskPart.exe with a script to get the disk to a useful state. If the Index of the mounted VHD is stored in $diskIndex this line of PowerShell does that for me:
@("select disk $diskIndex", "online disk" , "attributes disk clear readonly", "exit") | Diskpart | Out-Null }
In Windows 7 and Server 2008 R2 you don’t need a script to call WMI objects to create and attach a VHD (note that Hyper-Vs image management service calls it Mounting/unmounting, and the newer Windows calls it attaching/detaching: it’s the same thing): it can be done from diskpart.exe – perhaps automating it as above – or from the storage part of the management console. Of course the MMC isn’t available if you are running on server Core, and the command line versions are also available when booting into Windows-PE to set up a machine so it useful to know what they are. DiskPart needs to be run elevated (unless you are signed in as the account named administrator, or running Windows PE), it’s just as happy running from PowerShell as from CMD, provided you run as administrator. The following DiskPart commands will setup a VHD.
create vdisk file=<path>.vhd maximum=<size in MB> type=fixed select vdisk file=<path>.vhd attach vdiskcreate partition primaryactiveassign letter=Vformat quick fs=ntfs label=<OS Name>exit
select vdisk file=<path>.vhd
attach vdisk
create partition primary
active
assign letter=V
format quick fs=ntfs label=<OS Name>
exit
By default Create Vdisk makes a fixed VHD, you can also use type=Expandable; a fixed VHD takes quite a bit longer as the file system creates a file the size specified by maximum and writes zero-filled blocks to the file (HELP CREATE VDISK will show you more options) To mount a VHD , you select the virtual disk, and then attach it. Initially this disk won’t have any partitions on it (just like a freshly unwrapped hard disk), so the next step is to create a primary partition, make it active, give it a drive letter (I like to use V for VHD) and put a file system on it. Now you have a working drive V: of the specified size with an NTFS file system on it. You can unmount it by going back into diskpart and entering
select vdisk file=<path>.vhd detach vdisk exit
detach vdisk
and re-attach it with
select vdisk file=<path>.vhd detach vdiskexit
In a later post I’ll cover how we can put an OS onto the VHD and how that OS can be customized, and also put up a link to a video of VHDs in action.
In the initial release of Windows Server 2008 one of the the questions which always came up was “how do I add X” – the answer was we had tools named OCSETUP and OCLIST. These have been superseded in Windows 7 and Server 2008 R2 with the new Deployment Image Servicing and Management tool (DISM.EXE). The major thing of note about DISM is that it works with both the current running windows image and with offline images. So
DISM.exe /online /enable-feature /featurename=FailoverCluster-Core
adds failover clustering to a running edition of Server Core,but you can add it to a mounted VHD file (see previous post) on drive V
DISM.exe /image:V:\ /enable-feature /featurename=FailoverCluster-Core
DISM has some of the functions of ImageX (which is in the Windows Auto Installation Kit) – the ability to list the Images in a WIM (Windows Image) file, and to mount an image into the file system, and commit the changes made to it.
DISM.exe /mount-wim /wimfile:C:\dump\install.wim /index:1 /mountdir:c:\dump\mountDISM.exe /image:c:\dump\install.wim /enable-feature /featurename=FailoverCluster-Core DISM.exe /unmount-wim /mountdir:c:\dump\mount /commit
DISM.exe /image:c:\dump\install.wim /enable-feature /featurename=FailoverCluster-Core
DISM.exe /unmount-wim /mountdir:c:\dump\mount /commit
I thought I would have a go at reducing foot print of hyper-V server R2 (note that I’m working with the Release candidate and what is included may change before release) so I used DISM to remove the language packs, and configure the exact features I want. The following command gets a list if packeges
dism /image:c:\dump\mount /get-packages Package Identity : Microsoft-Windows-Server-LanguagePack-Package~31bf3856ad364e35~amd64~de-DE~6.1.7100.0 Package Identity : Microsoft-Windows-Server-LanguagePack-Package~31bf3856ad364e35~amd64~en-US~6.1.7100.0 Package Identity : Microsoft-Windows-Server-LanguagePack-Package~31bf3856ad364e35~amd64~es-ES~6.1.7100.0 Package Identity : Microsoft-Windows-Server-LanguagePack-Package~31bf3856ad364e35~amd64~fr-FR~6.1.7100.0 Package Identity : Microsoft-Windows-Server-LanguagePack-Package~31bf3856ad364e35~amd64~ja-JP~6.1.7100.0 Package Identity : Microsoft-Windows-ServerCore-Package~31bf3856ad364e35~amd64~~6.1.7100.0
I want to keep the English pack and base features, and remove all the others with the remove-package option
dism /image:c:\dump\mount /remove-Package /packageName:Microsoft-Windows-Server-LanguagePack-Package~31bf3856ad364e35~amd64~ja-JP~6.1.7100.0 dism /image:c:\dump\mount /remove-Package /packageName:Microsoft-Windows-Server-LanguagePack-Package~31bf3856ad364e35~amd64~fr-FR~6.1.7100.0 dism /image:c:\dump\mount /remove-Package /packageName:Microsoft-Windows-Server-LanguagePack-Package~31bf3856ad364e35~amd64~es-ES~6.1.7100.0 dism /image:c:\dump\mount /remove-Package /packageName:Microsoft-Windows-Server-LanguagePack-Packagyue~31bf3856ad364e35~amd64~de-DE~6.1.7100.0
Next I took a look at the installed features. This list has been trimmed down to save space, and when used in the later commands the names are case sensitive
dism /image:c:\dump\mount /get-features Feature Name : Microsoft-Hyper-V State : Enabled Feature Name : Microsoft-Hyper-V-Configuration State : Enabled Feature Name : ServerCore-WOW64 State : Enabled Feature Name : ServerCore-EA-IME State : Enabled Feature Name : NetFx2-ServerCore State : Disabled Feature Name : MicrosoftWindowsPowerShell State : Disabled Feature Name : ServerManager-PSH-Cmdlets State : Disabled Feature Name : WindowsServerBackup State : Disabled
Feature Name : Microsoft-Hyper-V State : Enabled Feature Name : Microsoft-Hyper-V-Configuration State : Enabled Feature Name : ServerCore-WOW64 State : Enabled Feature Name : ServerCore-EA-IME State : Enabled Feature Name : NetFx2-ServerCore State : Disabled Feature Name : MicrosoftWindowsPowerShell State : Disabled Feature Name : ServerManager-PSH-Cmdlets State : Disabled Feature Name : WindowsServerBackup State : Disabled
You can use Get-packageInfo and Get-Feature info to get more information about the features and packages. I decided to remove the 32 bit support (WOW64) and the East Asian Language support (EA-IME), and then put in the PowerShell support.
dism /image:c:\dump\mount /disable-feature /featureName:ServerCore-EA-IME dism /image:c:\dump\mount /disable-feature /featureName:ServerCore-WOW64 dism /image:c:\dump\mount /enable-feature /featureName:NetFx2-ServerCore dism /image:c:\dump\mount /enable-feature /featureName:MicrosoftWindowsPowerShell dism /image:c:\dump\mount /enable-feature /featureName:ServerManager-PSH-Cmdlets dism /image:c:\dump\mount /enable-feature /featureName:BestPractices-PSH-Cmdlets
With the WIM file mounted it is also possible to copy files into it or to mount the registry hives and tweak registry settings such as allowing PowerShell scripts to run.
reg load HKLM\MyTemp C:\Dump\mount\windows\system32\config\SOFTWAREreg add "HKLM\MyTemp\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" /V ExecutionPolicy /t REG_SZ /d "RemoteSigned" reg Unload HKLM\MyTemp
reg add "HKLM\MyTemp\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" /V ExecutionPolicy /t REG_SZ /d "RemoteSigned"
reg Unload HKLM\MyTemp
And Finally unmount the WIM fiile
That’s done little more than scratch the surface, DISM can add drivers or patches (.MSU files) to an image, it can bring it into line with an Unattend.INF file, set input locales and timezones, even change the machine name. Now, the amount that you customize an existing WIM depends on whether or not you expect to install it enough times to make it worthwhile. It might be useful to update VHD files and of course it is the way to add features to server-Core or hyper-V installations.
Since the last post was about creating VHD files, you can guess that the next one will be about applying the images in WIM files to a VHD.
The last post I made talked about customizing windows image (.WIM) files, and the post before that talked about creating Virtual hard disk (.VHD) files. So the last step is to look at putting an image onto a VHD and making it bootable
So the steps are
Step 3, applying the image can be done using image X if you have installed the Windows Automated Installation Kit using the command
"<path to AIK>\tools\<architecture>\Imagex.exe" /apply <path to wim> <image number> V:
I mentioned a post by Mike Kolitz, Mike has also got a script on the MSDN code site which goes by the name of WIM2VHD this will create the VHD, apply the WIM file,and patches you provide and copy files into the VHD. Unless you want to customize the registry or turn components on or off this is the ideal tool* but it depends on having the tools from the Automated Installation kit. Mike, to prove what an all-round good chap he is has a PowerShell script on the same site named Install_windowsImage (this script also shows how other languages can be embedded in PowerShell scripts) which removes that dependency so the alternative is to download this and run
<path>\Install-WindowsImage.ps1 -WIM <path to wim> -Apply -Index <image number> -Destination V:
This process takes a few minutes but at the end you have an image which is ready to boot for the first time. Then you’re ready for step 4: making sure the windows boot loader will work.
If the VHD is going to appear as the System disk in a virtual machine the VM will use the boot loader and BCD on the that disk – i.e. we need a boot configuration database inside the VHD. Windows 7 and Server 2008 R2 now have a tool in the \windows\system32 directory named BCDBOOT which recreates the BCD. If you run
<Path\>bcdboot V:\windows V:
It will create a BCD inside the VHD file and when a VM comes to boot from it all will be well.
I’ve discussed adding an entry to the BCD on a machine which is already running Windows Vista/7 /Server 2008 / Server 2008R2 , which needs an entry in the BCD on the physical hard disk which points to the VHD. An alternative way to create the entry uses BCDboot. If you run it with a /M switch it merges the boot information into an existing BCD. So if you are adding a VHD to boot an alternate OS from, then you can use that command. If you’re doing something odd like running windows PE to setup a new machine to boot from a VHD on a newly formatted drive you can use the same bcdboot V:\windows C: to create the store. If you are adding a Windows 7 / Server R2 VHD to a machine with a Vista / Server 2008 installation on it, don’t forget to update the machine to support the new features with bootsect from the windows Install disk.
* I’m assuming you want to know what the steps are and how you could take them manually, rather than just going straight to Wim2VHD.
IE 8 just locked up on me. This in and of itself is a Bad Thing. I’ve got into the habit of having lots of tabs open in IE - I checked it’s currently 70 (why … ? because I can, it’s a pile off stuff I’m thinking about, going back to or what ever). IE 8 will recover from being killed off in task manager. But 70 pages to re-open ? I’d rather not. Then this box popped up
Ooh. Now that’s rather clever. I’ve popped the offending site into compatibility mode and it’s behaving. Chalk another one up for IE
Live writer is one of those tools which I don’t know how I managed without. Word has a blogging template and it works, but … I wouldn’t try to write a book in Live Writer, or a business plan, or even a letter. Writer is optimized for a single task in a way that word can’t be. It works against most blog services (including community server, which powers technet blogs, plus Wordpress, Blogger and various others which follow the standard APIs).
One nice thing is that it supports various plug-ins to make it easier to make your blog posts, the plug-ins are just .net DLL files and although most of the come as MSI files you can simply place the DLL in the \program files\windows Live writer\plugins folder and the next time writer starts it “understands” the extension. Jas, who runs the MVP Awards blog let us know that one of our MVPs, Scott Lovegrove, had created a plug-in to add a link to Tweetmeme. The idea of Tweetmeme seems simple enough posts on twitter are directed @tweetmeme and the service gathers them up and looks for a URL – expanding the various shortening services. It then looks at which pages are being tweeted most. Scott’s plug-in adds a button to a blog post to make make it easy for you or your readers to tell tweetmeme about it (or just tweet a link). You need to copy the DLL file he has posted here to the program files\windows Live writer\plugins (or program files (x86)\windows Live writer\plugins if you are on 64 bit) and restart Live writer for it to take effect. Scott has posted the source code to the same folder if you want to see how it to write your own add in.
Someone gave me a definition of insanity as “trying the same thing over and over again expecting different results”. I guess trying something you expect to fail is somewhere between insanity and scientific thoroughness. Anyhow, that’s how I came to be trying the test you see below. I didn’t expect it to work, but it did.
As I mentioned yesterday I wanted to try out the tethered shooting ability of my Digital SLR. In fact I have two Pentax digital SLRs, a 2003 Vintage *ist-D and a 2006 K10D. Pentax have only ever done 32 bit versions of the Remote Assistant software the *ist-D works with V1 and the K10D needs V3, which demands the CD which came with the camera (even if the old software is installed or the Camera is plugged in). The cable to connect the *ist D was in the loft – along with the K10D’s disk. So I couldn’t try either last night: this morning I got out the ladder and retrieved both.
I had installed the Remote Assistant 1.0 into the VM, mainly to see if version 3 would upgrade in place without the CD, and it showed up on my Windows 7 Start menu, so I figured I’d plug in *Ist-D. Windows 7 installed the drivers for it. I fired up the VM and pulled down the USB menu, the camera showed as shared, I clicked it and after a warning that the it would no longer be usable in the host OS it became“Attached” so the option changed to goes to “Release”. Attaching the device to the VM is just like plugging a USB device into a physical machine, so the Virtualized instance of XP installed the drivers for the camera. It’s a standard device and doesn’t need anything downloaded or provided from a disk, so it was all done in 3 clicks.
I fired up remote assistant. It gives a representation of what you can see through the view finder (not a live preview, but the camera settings – under the picture on the left you can see it is telling me 1/80th of a second shutter speed, aperture of f/2.4. It was getting data from the camera, so there was nothing for it at this stage but to press the shutter button, so I aimed the camera at my son and ….
.. it worked! It only went and worked !! The picture on the left is the assistant running in the VM, and on the right it’s working as a remote application without the whole desktop. The old camera is a USB 1.1 device so the transfer speed is pretty poor: which is why I never got into tethered shooting with it; there’s a motivation to get the newer software working to use the other camera – I’ve never used it because by the time Pentax had the software out I was running 64 bit vista and wasn’t going to change for one program. [Update. Done that, identical process, much faster transfer]
I found the whole VM bogged down terribly if I asked it to save the file it was acquiring from the camera the host computer. So I decided to cheat and add a shortcut on the start menu to link to the folder in the VM where it stores the files. (This also turns out to be a useful backdoor to launch anything which isn’t set up on the host’s start menu).
The only other fault I can find with the whole process is that you have to reconnect the USB device by starting the VM and only then can you launch the Virtual Application. I don’t know if the Virtual PC team plan to do anything about this by release.
As a Hyper-V person through and through I tend to think of Virtual PC is a bit of an old dog – in the the best of all worlds this would be underpinned by Hyper-V technology - but here I am applauding VPCs new trick. There could be a whole new lease of life in this old dog yet.
Someone from the office (no names, no pack drill) told me they had read my post from yesterday where I mentioned Windows Easy Transfer. They felt that it might not be quite the done thing for a technical person to use it but since I was using it , then it was probably OK. I’ve now switched over to Windows 7 Release candidate and I used easy transfer to move almost everything: I had a a huge block of RAW photos and decided I’d back them up to an additional drive and then use easy transfer for everything else, otherwise it wouldn’t all fit on one disk. I blasted the partitions off the hard disk and did the install from my NTFS formatted bootable USB stick (also in my post from yesterday). The whole thing worked like a charm ; actually better than quite a few charms I’ve seen. 30GB of stuff takes a while to move off to disk and back, but Mail signatures, recent files lists, my IE customizations, IE History… all of them popped back into place. The only thing which seemed not to was my Outlook offline store file, and that probably benefitted from being rebuilt.
I love the fact that Easy transfer lets me see what I had installed before and it cross checks them against what installed NOW, notice the bit that says “to see this information later”, well now when I go back it shows Foxit’s PDF reader is installed.
Half a dozen things things I like so far about the release candidate
1. Tim Hueur’s PDF preview works again ! This is one of those “can’t do without” apps for me. Designed for Vista it broke in beta of 7 and is now working again. Result !
2 It’s faster. I didn’t bother to benchmark the beta, but I’m convinced this is just snappier. The beta was faster than vista – although my 4GB machine it was fine with Vista, the people with less memory saw bigger gains
3. The pictures. Sorry that is a bit lame, but the pictures are stunning, and I love the idea of having national pictures, the UK ones are superb.
4. IE8 is now the release version, so In Private Filtering works. [I must write about that]
5. Windows handles my habit of having 60 Windows Open in IE more gracefully.
6. Jump list items have been though through better – like this one for PowerShell