Sider

Friday 17 June 2011

Installing Server 2008 R2 unattended


I stumbled over a post on wegotserved.com, explaining how to install Windows Server 2008 R2 on a HP WHS box. I will give the author credit for being creative but I would like to point out an alternative, the AutoUnattended.xml.

This post is a basic “how-to” and I am not going to explain the whole concept and all the tools around “Windows Automated Installation Kit”. Also i will add that i don´t own a HP whs box, the following is a general description and should work on all systems that´s capable of booting on a USB drive. (From what I understand, the HP hardware will boot on USB if no boot info is found on the hard disk)

WARNING – After creating the USB stick, booting on this stick WILL clean your hard disk, so be careful rebooting you workstation if you are not sure on the boot order.

To get started you need the following:

· A (properly licensed) Windows Server 2008 R2 DVD.
· An empty USB stick, minimum 4GB.

Let´s get started!

Step One - Prepare the USB stick

Insert the USB key in your workstation. Press “Windows Key + R” to open the run dialog, and type “diskpart” followed by “OK”. If you have UAC activated you will have to confirm. Please have in mind that you now have easy access to cleaning all disk´s in you system, so be careful.

Capture_003

In diskpart follow these steps:

Type “list disk” to get an overview over the disk attached to you system.

Capture_006

Using the size, locate the disk number of your USB drive. In my case the disk number is “4”, in the following commands please remember to replace the number with the correct number on your system. Type the following series of commands:

Select Disk 4
Clean
Create Partition Primary
Select Partition 1
Format Quick fs=ntfs label=2008R2Key (Important, no spaces in the label name)
Assign (assign the first available letter, in my case “I”)
Active (Important, if you forget this command it is not possible to boot on the USB key)

You should now have an empty USB key that can be accessed like you normal access an USB key, if that´s the case type “Exit” to close the Diskpart window. 

Step Two – Copy the Server 2008 R2 installation files to the USB key

Copy all the content from the Server 2008 R2 DVD to the root of the USB key.

Capture_017

Step Three (Optional) – Add drivers for automatic installation

If you have drivers that you would like to be injected during the installation, it can be done in a pretty simple way. Please note that it only works for drivers in .inf format.

Create a folder on the root of the USB key named “Drivers”.

Capture_018

Place all your drivers in this folder. In the AutoUnattend.xml we will add this location, including subfolders, to be searched for .inf files. Here is an example where I add Realtek NIC drivers.

Capture_020

Step Four – Edit the AutoUnattend.xml

Right now we have a bootable USB “Server 2008 R2” media. In order to make the installation “unattended” we have to add an AutoUnattend.xml file to the root of the USB key. During the installation Windows Setup will read (and cache) the file and use it during the whole installation.

I am not going to explain all the phases in the installation, but in short we will use the AutoUnattend.xml to define the following:

Regional/Language settings
Drivers to be injected
Disk Configuration
What version to install
Computer name
Remote Desktop settings, including firewall (So we can access the server after installation)
OOBE settings (Define Administrator password, and hide EULA)

You can download a “working” sample of the AutoUnattend.xml file here

In order to customize the settings to your needs I will now highlight the settings you most likely will like to change. To edit the file, open it in notepad (or what you prefer). If you are insecure about editing xml files you can skip this step and just use the file as it is. In the end of the post I will explain how to logon to the server with default values.

Regional Settings

The following settings define the regional/language settings. Please notice that the Server 2008 R2 DVD only have one UI language, so for the US edition do not change the <UILanguage> setting. You can see a list of language values here http://technet.microsoft.com/en-us/library/cc766191(WS.10).aspx

In my case (Denmark) i will change

<SetupUILanguage>
<UILanguage>en-us</UILanguage>
</SetupUILanguage>
<InputLocale>en-us</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UserLocale>en-us</UserLocale>


To

<SetupUILanguage>
<UILanguage>en-us</UILanguage>
</SetupUILanguage>
<InputLocale>da-dk</InputLocale>
<SystemLocale>da-dk</SystemLocale>
<UILanguage>en-us</UILanguage>
<UserLocale>da-dk</UserLocale>

Drivers

Because different hardware configuration can result in different drive letter assignment to the USB key, I have added three locations to look for drivers. If you have a lot of hard disk´s or a card reader or something you can add more locations.

<DriverPaths>
<PathAndCredentials wcm:action="add" wcm:keyValue="1">
<Path>D:\Drivers</Path>
</PathAndCredentials>
<PathAndCredentials wcm:action="add" wcm:keyValue="2">
<Path>E:\Drivers</Path>
</PathAndCredentials>
<PathAndCredentials wcm:action="add" wcm:keyValue="3">
<Path>F:\Drivers</Path>
</PathAndCredentials>
</DriverPaths>

Version selection

The Windows Server 2008 R2 DVD contains multiple versions. In the AutoUnattend.xml we define the version we want by the index number in the install.wim file.

On a “Server 2008 R2 SP1” you can choose between:

1 = Standard
3 = Enterprise
5 = Datacenter
7 = Web Edition

(I left out the core versions)

To change the default value (3 = Enterprise) edit the following section

<MetaData wcm:action="add">
<Key>/IMAGE/INDEX</Key>
<Value>3</Value>
</MetaData>

Computer Name

To change the computer name replace “MyServer” with a name of your choice

<ComputerName>MyServer</ComputerName>

Administrator Password

To change the Administrator password replace ”P@ssw0rd” with your own password

<AdministratorPassword>
<Value>P@ssw0rd</Value>
<PlainText>true</PlainText>
</AdministratorPassword>

Step Five – Save the AutoUnattend.xml to the USB key

If you have made changes to the AutoUnattend.xml make sure to save it with the correct name and .xml extension.

Copy the AutoUnattend.xml to the root of the USB key

Capture_021

Step Six – Install Windows Server 2008 R2 to your hardware

You should now be able to move your USB key to your server hardware. If it´s configured to boot on USB devices an installation would start automatic. The installation time depend on the hardware, but can take from 15 to 60 minutes.

To get in contact with the server when it´s installed you have to know the IP address (or use the computer name, but it´s not always a bulletproof method). In most cases you can log on your Router and look in the DHCP client list. If you don’t find it, it´s properly not installed correct.

If you used the default AutoUnattend.xml file you can log on the server with the “Remote Desktop Connection” client and use the following credentials:

User: MyServer\Administrator
Password: P@ssw0rd

Else, use the credentials you have provided in the custom AutoUnattend.xml.

Troubleshooting

I have, of course, tested the provided AutoUnattended.xml file. Please notice that a lot of thing can go wrong when working with headless devices. The most common error would properly be that hardware does not boot on the USB device. Next issue could be storage drivers. If the boot image on the Server 2008 R2 DVD does not support your storage controller, the installation fails.

If you want to test if the USB key is bootable, you can test it on your own computer but it is VERY important to remove the AutoUnattend.xml file first.

If you have any problems please leave a comment, and i would try to assist.

1 comment:

  1. Hej- kan du gøre din unattended fil available igen??

    Har fået en ex490 - som virkelig ikke vil noget som helst af det jeg beder den om.

    ReplyDelete