Table of Contents
http://www.windowsnetworking.com/articles_tutorials/Deploying-Vista-Understanding-Windows-AIK.html
Vista deployment via USB Drive
To Create an Image
Create the autounnatend.xml file, see notes below on how to do this.
Place this file on the root directory of a thumb drive
Insert the DVD and boot from it, the Vista Installer should automatically search for and find the unattended file and automatically go through the initial setup process.
When this finishes, Windows will boot (This is a clean install). This is where you can install software before calling sysprep. When you're ready, run this from a command line:
c:\windows\system32\sysprep\sysprep.exe /generalize /oobe /shutdown /unattend:path_to_ImageUnattend.xml
This is the image you should keep on the USB drive to deploy to future computers.
Boot to Windows PE and do an imagex.exe /capture option
imagex /capture c: e:\images\image_name.wim img_description /compress fast
With an Exisiting Image
Instructions for installing Vista from a thumb-drive.
I'm using a pre-built image approach rolling it out with WinPE and ImageX.
Getting the pre-built image:
Install vista in some manner. I just used our WDS server to push out an auto install.
I then patched the install and added some basic software.
Then to generalize and prep it run the following command:
c:\windows\system32\sysprep\sysprep.exe /oobe /generalize /shutdown
The image is now ready to be copied. This will be done later, don't turn the computer back on.
Make the USB Drive bootable with WinPE:
From a Vista, Windows 7, or WinPE machine execute the following commands on the USB drive:
diskpart list disk #figure out which one the usb drive is, usually 1, as in this example select disk 1 clean create partition primary select partition 1 active format fs=ntfs assign exit
Set up WinPE.
Click start->Program Files->Windows AIK->Windows PE Tools Command Prompt
Run:
copype.cmd amd64 c:\winpe_amd64 #can also do 64 bit copy c:\winpe_amd64\winpe.wim c:\winpe_amd64\iso\sources\boot.wim
Now add customizations to the win pe, such as imaging tools, put these in the winpe_x86\ISO folder.
For example:
imagex.exe
Copy winpe to the USB stick:
xcopy c:\winpe_amd64\iso\*.* /s /e /f e:\ #e: is usb drive, change them as necessary
Now plug the usb drive into the computer that you want to image and boot it to Windows PE.
Run the following commands:
e: #or whatever drive the USB stick is imagex /capture c: e:\images\image_name.wim img_description /compress fast
changing drives as appropriate, the images folder must exist on the usb drive if you choose to do it that way
compress also has 3 options, fast, max, and none. This may help the image fit on the drive if it's a large one.
Now to deploy the image:
Format the hard drive with diskpart, see above for example
Apply the image with imagex
imagex /apply e:\images\image.wim 1 c:\
Setting Up Deployment Server
First thing to do is to setup a computer with a Windows Installation (which version is not important) Download and install the Windows Automated Install Kit. This kit contains tools used to create the unattended installation files, which is what should be done first.
Mount the Vista/Server2k8/Windows7 iso using the tool of your choice.
Browse through the mount point to the Sources directory.
This directory contains the two files that will be needed by WDS later on, Install.wim and Boot.wim, so go ahead and copy them down to the desktop.
Go to Start→Microsoft Windows AIK→Windows System Image Manager
At this point, (but if it doesn't, go to New→Select Windows Image), it should ask what windows image you want to use, choose the Install.wim image that you previously got from the DVD. It will give a warning about catalog files, just tell it to create a new catalog file. Now click New→New Answer File. This will be the first unattended file, used to get through the initial setup process. Go ahead and save the answer file somewhere as Unattend.xml
It's now time to add components to the answer file. The components that can be added are in a pane on the bottom left.
Right click on the x86_Microsfot-Windows-International-Core-WINPE...->Add Setting to Pass 1 windowsPE In the Answer File pane, click on the newly add component and add the following settings: x86_Microsoft-Windows-International-Core-WinPE... InputLocale: en-us SystemLocale: en-us UILanguate: en-us UILanguageFeedback: en-us UserLocale: en-us Expand the tree for this component and click SetupUILanguage: UILanguage: en-us WillShowUI: OnError Right click on the x86_Microsoft-Windows-Setup_neutral component and add it to pass 1 winPE Go to the answer pane and set the following settings x86_Microsoft-Windows-setup_neutral no settings DiskConfiguration: WillShowUI: OnError ** Right click DiskConfiguration->InsertNewDisk Disk: Action: AddListItem DiskID: 0 WillWipeDisk: true ** Right click CreatePartition->Insert New CreatePartitio CreatePartition Action: AddListItem Extend: true Order: 1 Type: Primary ** Right click ModifyPartition->Insert New ModifyPartition Action: AddListItem Active: true Format: NTFS Label: Windows Letter: C Order: 1 PartitionID: 1 Expand the x86_Microsoft-Windows-Setup... component and right click and add WindowsDeploymentServices to pass1 In the Answer File pane set the following: Image Selection: ->InstallImage: WillShowUI: OnError Filename: install.wim (change later if you name the install images on WDS differentyl) ImageGroup: Vista SP1 Enterprise Images ImageName: Windows Vista ENTERPRISE **These settings will have to be customized based on how you set up WDS later on, but these are defaults **so set up WDS to match these and nothing has to change :) ->InstallTo: DiskID: 0 PartitionID: 1 Login->Credentials Domain: aoe username: ... password: ... *this is used to access the WDS server image store to get the install image Now if any components under the Answer File pane are light blue, just delete them out. Now click Tools->Validate Answer File and fix any errors. Save the file somewhere that the WDS server will be able to access it. Now create a new answer file using the same image and save this one as ImageUnnatend Add the x86_Microsoft-windows-Shell-Setup_netural component to Pass 4 - Specialize Click it in the Answer Pane and set: ComputerName: * ProductKey: Your product key RegisteredOrganization: Virginia Tech RegisteredOwner: Aerospace & Ocean Engineering TimeZone: Eastern Standard Time Now add x86_Microsoft-Windows-International-Core_neutral to Pass 7 - OOBE System Click it in the answer pane and set: InputLocale: en-us SystemLocale: en-us UILanguage: en-us UserLocale: en-us Add x86_Microsoft-Windows-Shell-Setup_neutral component to Pass 7 - OOBE System OOBE Settings: HideEULAPage: true NetworkLocation: Work ProtectYourPC: 1 UserAccounts->LocalAccounts (right click LocalAccounts->Insert New Account) LocalAccount: Action: AddListItem DisplayName: LocalAdmin Group: Administrators Name: LocalAdmin ->Password: Set it to the local admin password Remove any empty fields and validate the answer file and save it.
PXE Booting
Now it's time to set up PXE booting.
We need to copy the PE source files to the PXE server
First, create the PE image by:
Start->Program Files->Windows AIK->Windows PE Tools Command Prompt
This sets the local environment variables so we have access to all of the tools
Now run the copy tool:
copype.cmd x86 c:\winpe_x86
This creates the directory structure and copies the necessary files
Mount the image
imagex /mountrw c:\winpe_x86\winpe.wim 1 c:\winpe_x86\mount
Now we have to get these files up to the pxe server which is on riccioli /tftpboot which is only accessible through ssh..
So I used Core FTP (aka Coors Light :) )
- Create a folder in the root of the tftp server called Boot
- Copy all of the files from c:\winpe_x86\mount\Windows\Boot\PXE to the Boot directory on the tftp server
- Copy up c:\Program Files\Windows AIK\Tools\PETols\x86\boot\boot.sdi to the Boot directory on the tftp server
- Now copy the bootable Windows PE image to the \Boot Folder
c:\winpe_x86\winpe.wim
- Now either go to a Vista machine or a Windows PE Environment (we have a CD for this, just boot a computer into it)
- Run the following commands:
Bcdedit -createstore c:\BCD
Creates the store
Bcdedit -store c:\BCD -create {ramdiskoptions} /d "Ramdisk options"
Bcdedit -store c:\BCD -set {ramdiskoptions} ramdisksdidevice boot
Bcdedit -store c:|BCD -set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
Above commands set the ramdisk options
Bcdedit -store c:\BCD -create {dbgsettings} /d "Debugger Settings"
Bcdedit -store c:\BCD -set {dbgsettings} debugtype serial
Bcdedit -store c:\BCD -set {dbgsettings} baudrate 115200
Above commands create a kernel debugger
Bcdedit -store c:\BCD -create /d "MyWinPE Boot Image" /application osloader
Create OSLoader settings for Windows PE Image, returns a guid
The guid I got was: d37fa60c-1988-11de-94ac-9e06741932de
Bcdedit -store c:\BCD -set {d37fa60c-1988-11de-94ac-9e06741932de} systemroot \Windows
Bcdedit -store c:\BCD -set {d37fa60c-1988-11de-94ac-9e06741932de} detecthal Yes
Bcdedit -store c:\BCD -set {d37fa60c-1988-11de-94ac-9e06741932de} winpe Yes
Bcdedit -store c:\BCD -set {d37fa60c-1988-11de-94ac-9e06741932de} osdevice ramdisk=[boot]\Boot\WinPE.wim,{ramdiskoptions}
Bcdedit -store c:\BCD -set {d37fa60c-1988-11de-94ac-9e06741932de} device ramdisk=[boot]\Boot\WinPE.wim,{ramdiskoptions}
Not so sure what these do...
Bcdedit -store c:\BCD -create {bootmgr} /d "Windows Vista BootManager"
Bcdedit -store c:\BCD -set [bootmgr] timeout 30
Bcdedit -store c:\BCD -displayorder {Bcdedit -store c:\BCD -set {d37fa60c-1988-11de-94ac-9e06741932de}
Sets the bootmgr settings
* Now copy the BCD file to the server
PXE is now configured and will run WinPE from the PXE server
GUID on 2nd pass
606f09bf-198f-11de-8894-00e0b8af9ae9
Too bad that it won't work from our normal PXE server, it's running Linux..
So now we have a Windows Server 2003 virtual machine installed on the virtual host that is on the same network as the PXE server. This one has to be configured, and I will show the steps that I am taking to do this.
- Create a separate NTFS partition on the server to hold the image files
- The machine needs to be a Member Server of the Domain.
- Add the Windows Deployment Services role to the server (add/remove programs, windows components)
- Go to Start→Administrative Tools→Windows Deployment Services
- Right click Servers→Add Server and follow through the wizard for the initial setup
- Now boot images need to be added. Right click Boot Images→Add New Boot Image and follow the prompts (Image is in .wim format, and can be anywhere)
- Do the same for install images. This time create a new Image group, for example Vista Enterprise Images, the images use similar files and it reduces the file sizes on the server because it can use common components from one image.
- To allow unattended pxe installations, right click on the name of the server in the pane on the left, and click properties.
- Move the Unattend.xml and ImageUnnatend.xml files to the WDS Server. Unattend.xml goes in NTFS\Images\WdsClientUnnatend
- ImageUnnatend.xml goes in NTFS\Images
- Under PXE Response Settings tab, click Respond to all
- Under Client tab, click Allow Unattended Installation and Browse to the NTFS Partition\WdsClientUnattend\Unattend.xml
- Click “Do not create account in domain”
- You also have to allow unattended installations on each install image.
- Click Install Images below the server name on the left pane, and click the Image Group name to get a list of images in your group. Right click on the one that is to be unattended and go to properties.
- Click Allow Image to Install in Unattended Mode and browse to the ImageUnattend File that is in the NTFS Partition\Images directory.
- Right click the server name in the left pane and click All Tasks→Restart Service
- Everything should be good to go from this point, boot the client computer and press F12 to get a list of windows images to choose from, choose the Setup image and sit back and relax.
http://www.windowsnetworking.com/articles_tutorials/Deploying-Vista-Part23.html
Fix the unattended file for the initial setup to include WindowsDeploymentServices option…
To add drivers to an offline windowsPE image (may work for boot.wim as well, next thing to try)
- Mount the image using imagex
imagex /mountrw z:\vista_tools\winpe.wim 1 c:\mount
- Download the driver to an accessible point and extract it, need the .inf file
- At a command prompt type:
peimg /inf:path_to_.inf path_to_mount\Windows
- Unmount and commit the change
imagex /unmount /commit c:\mount
- Replace the image on the Deployment Services server with this one
To add drivers to the boot image…for some reason the boot.wim contains 2 image files, both must be edited.
- Mount the image using imagex
imagex /mountrw e:\Images\Boot\x86\Images\boot2.wim 1 c:\mount <--Mounts the first image
- Put the driver .inf file with peimg
peimg /inf:path_to_.inf path_to_mount\Windows
- Unmount and commit the image
imagex /unmount /commit c:\mount
- Mount image 2
imagex /mountrw e:\Images\Boot\x86\Images\boot2.wim 2 c:\mount <--Mounts the second image, still dont know why there are 2
- Put the drivers in here as well
peimg /inf:path_to_.inf path_to_mount\Windows
- Unmount and commit
imagex /unmount /commit c:\mount
–There is a tool on www.driverpacks.net that can do this, go there and browse to the Forum and look for the
vista tool, also this is the location of the vista driver packs. Follow the instructions included with that tool to integrate the drivers into the install image. This will not put drivers in the boot image! This must be done manually, but I'm working on writing a program to auto-generate the script to do such a thing.
–Additional Notes–
- IPSec had to be turned off to eliminate filtering over port 135 to the WDS server
- The WDS server can only be accessed right now by adding the MAC address of the machine to a list on pxe unattended on riccioli
–Adding Software to an Install–
Install the reference machine as usual. Install the software, in my test I installed Firefox 3.0.8 and CoreFTP Lite Sysprep the system by running: c:\windows\system32\sysprep\sysprep.exe /generalize /oobe /shutdown On the WDS server, go to Boot Images and right click on Vista Setup->Create New Capture Image Follow the prompts. After the image is created, add it to the Boot images list by right click in Boot Images->Add New Boot Image Follow the prompts. Now restart the reference computer and network boot and you should see the capture image in the list now. Boot this up. Follow the prompts and at the end select Upload to WDS server and this will place the image in the install list Associate the unattended file with this one as well and it should install smoothly with the associated applications.