PXE Win Install: Installing Windows 7 over the network

We remind you that attempts to repeat the actions of the author can lead to a loss of the guarantee for the equipment and even to its failure. The material is provided for informational purposes only. If you are going to reproduce the actions described below, we strongly advise you to carefully read the article to the end at least once. The editors of 3DNews are not responsible for any possible consequences.

Earlier we already got acquainted with the process of the massive unfolding over the network of the finished image of the hard disk with Windows 7 preinstalled on many machines. We used for this a bunch of DRBL and Clonezilla. A key disadvantage of this approach is the lack of flexibility associated with the forced restriction on the use of the same type of configuration of client PCs. Developing the topic of network boot, we considered the creation of a universal PXE-resuscitator. In this case, the PC at startup loads the live image of an OS from the server into RAM and works with it.

Similarly, we can download the Windows PE (Preinstallation Environment) on the network, mount the shared folder with the installation files, and run the installer from there. In a similar way, both Microsoft RIS or WDS proprietary services work, but they require Windows Server. In the case of a small number of client machines, you can get by with free solutions. An example of a "classical" implementation of such a scheme will be considered. On one of the computers running Windows Vista / 7, a DHCP / TFTP / SMB server will be raised.

The requirements to iron have already been mentioned in previous materials. Nevertheless, let us briefly go over them. First, the BIOS of all computers must have network boot enabled. Secondly, all machines must be temporarily combined into an isolated local network, preferably a Gigabit one. Naturally, their configuration must meet the requirements of 32-bit Windows 7, since we will consider installing this particular OS. But in general, the described method is suitable for Windows Vista. About the "eight", perhaps, it's too early to say.

We will again need the Windows Automated Installation Kit (WAIK). Download the ISO image, unpack or install it and install this set of utilities. In the main menu, select Microsoft Windows AIK → Deployment Tools Command Prompt. Before you open the console, in which you must enter the following command:

 copype.cmd x86 C:  WinPE

This command copies files to the C: WinPE directory to create an image with a 32-bit Windows 7 preinstallation environment. For the 64-bit version, specify amd64 instead of x86 . Immediately create another folder C: TFTP , which will be the root of the TFTP server, and in it make the directory Boot . The latter will store the boot files. To get these, you need to mount the base wim image of Windows PE and copy them from there.

 imagex / mountrw winpe.wim 1 mount
Copy mount  Windows  Boot  PXE  *. * C:  TFTP  Boot

The imagex command just unpacks the files from the wim image to the mount subfolder. They can be edited or, for example, added their own, and then re-packed in a single archive. This will take a bit later, but for now, close and reopen Deployment Tools Command Prompt, copy another important file and unmount the image.

 copy x86  boot  boot.sdi C:  TFTP  Boot
Cd / d C:  WinPE
Imagex / unmount mount

We copy the file winpe.wim to the directory C: TFTP Boot under the name boot. wim and start creating the bootable Windows menu (BCD).

 copy winpe.wim C:  TFTP  Boot  boot.wim
Cd / d C:  TFTP  Boot
Bcdedit -createstore BCD

In the simplest case, it is sufficient for us to specify the parameters for the RAM disk.

 bcdedit -store BCD -create {ramdiskoptions} / d "Ramdisk options"
Bcdedit -store BCD -set {ramdiskoptions} ramdisksdidevice boot
Bcdedit -store BCD -set {ramdiskoptions} ramdisksdipath  boot  boot.sdi
Bcdedit -store BCD -create / d "PE Boot Image" / application osloader

Pay attention to the output of the last command executed. It contains the GUID, which must be copied and substituted in place of { guid} in the commands below.

 bcdedit -store BCD -set {guid} systemroot  Windows
Bcdedit -store BCD -set {guid} detecthal Yes
Bcdedit -store BCD -set {guid} winpe Yes
Bcdedit -store BCD -set {guid} osdevice ramdisk = [boot]  Boot  boot.wim, {ramdiskoptions}
Bcdedit -store BCD -set {guid} device ramdisk = [boot]  Boot  boot.wim, {ramdiskoptions}

First, you should try to boot from a "clean" Windows PE image. However, some corrections in it will have to be made. First, drivers for a network card or a hard disk controller may be needed. Secondly, it would be nice to make an automatic connection to the network folder and run the installer. Again, open the WAIK console and mount the boot image.

 cd / d C:  WinPE
Imagex / mountrw winpe.wim 1 mount

To add drivers (in the form of * .inf and accompanying files, of course) the following command is used:

 dism / image: mount / add-driver / driver: Path to folder or inf file 

You also need to edit a simple text file [ C: WinPE ] mount windows system32 startnet. ] Cmd . This script will run when the PE environment starts and will mount the network folder as the logical drive from which the Windows 7 installer will run.

Net use z: \  Win7Install password / user: username
Z:  setup.exe is the IP address of the server from which the installation is made. On it you have to copy all the files from the Windows 7 installation image to a folder (in our example it is Win7 Install ) and open to it access over the network. Instead of password and username you must specify the password and the name of the local user, respectively. You can even create a separate account for this matter. Finally, do not forget to close the .wim file with the changes and copy it to the TFTP server directory. The console can be closed.

 imagex / unmounts / commit mount
Copy winpe.wim C:  TFTP  Boot  boot.wim

Previously, we already touched on the theme of the answer file to automate the installation process and the initial configuration of Windows 7. In this case, we also have every right to use its capabilities. To prepare the file, it is better to use the Windows System Image Manager utility from the WAIK package. After starting the menu choose File → New answer file, then we will be offered to choose the installation image of the system. It is in the sources directory where the OS installation will be done (in our example Win7 Install / sources ) – select the file with the extension clg And your OS edition as a name (for example, install_Windows 7 PROFESSIONAL.clg ).

The Windows Image panel contains a component tree that you can customize. To do this, right-click on any of them and select Add Setting to Pass * from the pop-up menu – it will immediately appear in the Answer File panel where you can edit various parameters. For example, add accounts, partition disks, install updates, and so on. We will not dwell on the content of the answer file – all the necessary information can be found on the Web or from the built-in help. The finished file should be kept in the same installation directory sources under the name autounattend.xml .

There is very little left. You must configure DHCP and TFTP. In principle, you can use almost any software implementation of these servers. We, for example, use the universal utility Serva32 / 64. After starting the program, click on the Settings button, go to the DHCP tab and check the DHCP server box. Just click on Bind DHCP to this address and select the IP address of the network interface on which the server will work. Naturally, the address must be static and preset.

In the field IP Pool 1 st addr we specify the initial IP-address of the range of issued addresses, and in Pool size – the number of DHCP-clients. Do not forget to also register a subnet mask (Subnet mask). Finally, in Boot File, specify the relative path to the PXE bootloader file. In our case this could be pxeboot. com or pxeboot. n12 . In the first case, to start the network boot, you will be prompted to press the F12 key, otherwise the launch from local media will continue. If F12 is missing, then you need to specify the second bootloader (you may have to rename it to pxeboot. com ).

The TFTP tab also includes the TFTP Server and Bind TFTP to this address, the root folder of the server (we have it C: TFTP ) and the option Option negotiation , And PXE Compatibility is turned off. All, now click OK, saving the settings, and restart the utility. Verify that the firewall does not block the used ports (UDP 67-69). You can try to boot over the network on one of the client machines. To identify problems, use the logs that Serva generates. If everything is OK, the Windows 7 installer will automatically start, the further work with which differs nothing from that which comes with boot from the installation USB / DVD / HDD.

That's all. We disassembled a fairly simple example of a network installation of Windows 7. How can it be improved? Well, firstly, you can add additional options to the Windows boot loader so that it is loaded by default from local media, not over the network. Secondly, the syslinux loader, mentioned last time, can be safely used with the Serva32 / 64 utility. The configuration file format ( pxelinux.cfg / default ) is the same. Thirdly, it does not hurt to explore the possibilities of the answer file and the automatic installation of Windows. In general, there is where to dig. But we will leave this for self-study and on goodbye we traditionally wish good luck in network experiments.

If you notice an error – select it with the mouse and press CTRL + ENTER.

Leave a Reply