søndag 19. juli 2015

Making a generic Windows 10 Pro wim image for remote installations

One of the general big issues with deploying unattended installations with imaging is that MS wants you to create one image per PC model to make sure that the drivers are added OK.

In principle this means that you will need to create one golden image per machine model; add that image to your server, and then deploy the different images to the specific PC models that your company have.

This is a very time consuming job, and therefore I would normally do this deployment in a totally different way; using one central "brass image" with the possibility to apply any driver needed by any of the PC's.

Before you laugh about this attitude, note that I have used this method for a windows 7 rollout for 350 PC's, so it does work.
In this company it was a mixture of Dells (workstations and laptops), HP (workstations and laptops) and Acer (laptops). None of them was on a domain.
In the end we figured out that it was at least forty different models, and brand new unknown models popped up on every site. Just collecting drivers revealed a staggering 14 GB of drivers in total.

The way I got it to work was to make sure that I added any new drivers for a any newly found PC model to the original wim image (I will show how later), and figured out a way to apply the drivers to the central image, deploy the image to the PC and apply the drivers to the to the different models unattended..
After that it was just renaming by naming convention and then add to domain :-)

It did really work, and it is easier than you think :-)

For the moment there is still some kind of lack of windows 10 drivers and one attitude to solve thsi can be to add new drivers to the golden image as they becomes available. This can call for the method above.

Bugs in windows 10 unattended deployment

First of all there are two major bugs with making unattended installations with the latest preview of Windows 10
1) When you do the first installation on the technician PC (the source PC), turn off the "Apps Updates" at once. If not, you will not be able to to sysprep the machine, as it will try to update the apps on your profile automatically. As this is done for one user only, sysprep will not allow you to run a general sysprep. The "fix" is to delete the profile with another user.. or start over again. I really hope they stop doing these automatic updates of apps. At least they should give an option to turn it off during OOBE. The first thing you should do then, is to turn off Apps Update in  the Store App at once after first login.
2) You can not reuse the username you used on the machine you sysprepped. If you used the login name "admin" on the tech-computer (source computer) you will not be able to to use that username in your unattend.xml file. Fix is to use a username that you will never normally use, a swearing word works fine :-)

Create a "golden image" (or brass image in this case)

First install windows 10 on one computer, in any way you like (netboot, DVD, USB).
I used an old HP Elitebook 6930p for this and Serva32 for a PXE installation from  a preview iso.
On my Elitebook most of the HP specific drivers where missing after the installation, and I did not care much about finding them either.
What I want is that the image I get from this HP will do an unattended installation with all drivers for a much more usable Dell latitude E5540.

Make sure that you stop the "app update" by starting the windows store app, clicking on the "head icon" (I guess that means profile) on the top row and choose to disable updates.
Now install any application you want, I installed 7zip, putty, VLC and some other free stuff that I always need.
Make sure that you do all windows updates etc. too
Reboot the machine once in a while to make sure all settings and updates are applied.

Now to the interesting part -- how to get the dell drivers (or any other drivers) in to the image, without it a PC crash during setup.

1) First I put a file named setupcomplete.cmd in c:\windows\setup\scripts. What this file does is to call up a batch file in c:\temp that using a MS driver tool to check and add for drivers under the folder c:\temp\X64. The power config thing is to make sure the PC don't go to sleep if there is a lot of drivers to be scanned and installed. It is commented out for now, as I am not sure it works in Windows 10. SetupComplete runs automatically after setup, but before login.

2) Download the windows 10 drivers you need for your computers and put them in any subfolder(s) under c:\temp\X64. Since my Dell E5540 does not have any official windows 10 drivers from Dell yet I extracted the E5540-Win8 cab driver package and hoped the Windows 8 drivers might be kind of supporting the windows 10 drivers too ....

3) add these files to c:\temp

Now finish sysprep as normal by starting it from C:\windows\system32\sysprep

After shutdown, boot the PC on a winPE USB stick and run imagex.

My winPE is a bit special, so I am able to transfer my new install.wim directly to my Serva64 (the machine I do PXE against) machine, but without such luxury you can just transfer it a USB drive or something, it doesn't matter.

Now I add a new entry in Serva64 with this unattend.xml file. NB the production key is for a windows 10 preview
Notice that I have enabled the administrator account in this one. At least I can run commands without UAC errors (OK the real reason is number 2) in bugs over here)

So.. Just to connect the Dell to the network, press F12, do an unattended installation with the new image and see if it get it drivers.....

And yes... after 20 minutes, it automatically logs on as administrator with all its drivers already installed :-)
Since there is no feedback during the installation the easiest way of seeing that it works, is that it have a Dell touchpad driver installed. This driver is not to be found in the MS driver repository :-)
A good thing here is that all the drivers you add to c:\temp\x64 only takes space, but will not be added to the driver repository in windows if not the device ID is correct.
Of course the install will take longer time for each driver you add, as the system will need to scan through all drivers, but since most mass deployments are happening at nights and are unattended, it really does not matter if the installation takes 20 minutes or one hour.
Also note the Windows sometimes have device ID issues with mouses and storage devices, so it can be good to remove some of those drivers from c:\temp\X64 and add them later (I would never do that as my users is normally not using gestures on their touchpad or similar)


Of course, I don't think this is the ultimate drivers for my Dell, but this is the drivers that was available now. I hope Dell can put out some supported windows 10 drivers soon (and all the other companies too) :-)

Ingen kommentarer:

Legg inn en kommentar