Introduction
Images in
WIM format prepared in the
MDT system, Microsoft offers to deploy over the network using a
WDS server , or
integrate into SCCM .
SCCM is quite expensive, but the WDS server is free if you are a happy owner of a license for Windows Server 2008/2012. But not everyone is happy with the capabilities of the WDS server.
The method offered by me will be useful to those:
- who does not have a license for Windows Server, or all the resources on existing servers are already involved and there is no possibility to purchase another license;
- who does not like the Windows PE boot speed via the TFTP protocol used by the WDS server;
- who needs to combine the deployment of Windows and Linux across a network on the same server.
I want to offer readers a solution based on Ubuntu Linux OS, using syslinux and iPXE.
In the future, the use of Ubuntu 14.04 LTS will be implied.
The services listed below do not have to run on the same server.
Installing and configuring the tftp server
A
tftpd-hpa server will be used to organize data transfer using the TFTP protocol. It has the necessary capabilities, and also supports remapping.
Install the appropriate package:
aptitude install tftpd-hpa
Settings are in the configuration file.
/ etc / default / tftpd-hpa RUN_DAEMON="yes" TFTP_USERNAME="tftp" TFTP_DIRECTORY="/var/lib/tftpboot" TFTP_ADDRESS="0.0.0.0:69" TFTP_OPTIONS="--secure --listen --verbose --verbosity 10 --map-file /etc/tftpd.remap --refuse blksize"
We also need a file with rules for remapping.
/etc/tftpd.remap rg \\ / ri (.*)ÿ$ \1 ri (.*)M-\^\?$ \1 ri (pxelinux\.0).*$ \1
The first line overrides the slashes for Windows OS, the following warns of possible problems with loading on some network adapters when the client tries to request the tftp server for the file pxelinux.0M- ^ or pxelinux.0ÿ instead of pxelinux.0.
')
Set up an http server
What do we need an http server for, because a tftp server is enough to load WIM images over the network?
It so happened that Trivial FTP, although it provides basic functions for transferring files over the network, cannot provide high reliability and data transfer speed.
As practice shows, images from Windows PE about 250MB in size are downloaded over the 1Gbps network using the http protocol several times faster (5-10 seconds, against 30-60 seconds, respectively).
You can also download preseed files for the debian-installer installer using the http protocol.
You can use apache, nginx or any other server that you like as the http server. No special settings are required. The main thing is that the * .ipxe, * .wim and other files listed on the http-server listed below are available for reading.
Configure dhcp server
According to
RFC1232, you must configure option 66 TFTP server name, where you can specify the IP address of your tftp server, for example, 192.168.1.1; and option 67 Bootfile name, where you specify the file name to load “pxelinux.0”;
If you use, for example, isc-dhcp-server running Ubuntu, you will need to add something like this to the file
/etc/dhcp/dhcpd.conf shared-network PXE-Netwotk { subnet 192.168.1.0 netmask 255.255.255.0 {
Install and configure the syslinux bootloader
Install the bootloader
We will need
syslinux version 5.03 or higher.
I would recommend building a bootloader from source codes, there’s nothing scary and complicated about it.To build from source you need to install make, gcc, nasm, uuid-dev, and execute the commands:
Setup loader menu
Create a directory for the syslinux menu files:
mkdir -p /var/lib/tftpboot/pxelinux.cfg/
And create a file with the default menu
/var/lib/tftpboot/pxelinux.cfg/default ui vesamenu.c32 PROMPT 0 menu background background.jpg menu title PXE boot menu
And now create a submenu directly to boot the OS:
/var/lib/tftpboot/pxelinux.cfg/CentralOffice PROMPT 0 UI vesamenu.c32 MENU BACKGROUND background.jpg MENU TITLE Central Office # LABEL <- Main Menu KERNEL vesamenu.c32 APPEND pxelinux.cfg/default # http LABEL PE via http KERNEL ipxe.lkrn APPEND dhcp && chain http://192.168.2.1/winpe.ipxe # tftp LABEL PE via tftp KERNEL ipxe.lkrn APPEND dhcp && chain tftp://192.168.2.1/winpe.ipxe # debian-installer LABEL Ubuntu KERNEL ubuntu-installer/i386/linux APPEND initrd=ubuntu-installer/i386/initrd.gz preseed/url=http://192.168.1.1/preseed/custom.seed debconf/priority=high auto-install/enable=true debian-installer/language=ru debian-installer/locale=ru_RU.UTF-8 debian-installer/country=RU ipv6.disable=1 netcfg/hostname=testname DEBCONF_DEBUG=5 --
where winpe.ipxe is the configuration file with settings for ipxe, which we will examine below in the appropriate section.
Do not forget that the tftp server cannot work with symbolic links, so you will need to make a separate copy of the winpe.ipxe file in the tftp server directory if you want to compare download speeds on http and tftp.
Some network cards do not have time to raise the link the first time, so you can make a second download attempt in case of failure, using the operator "||". If, after the second attempt, we fail again, we can display the interface statistics and open the command line to diagnose the problem:
APPEND dhcp && chain http://192.168.2.1/winpe.ipxe || dhcp && chain http://192.168.2.1/winpe.ipxe || ifstat && shell
iPXE
IPXE installation
iPXE, I also propose to collect from source codes, besides, it is also very simple:
git clone git://git.ipxe.org/ipxe.git cd ipxe/src make cp bin/ipxe.lkrn /var/lib/tftpboot
If any network card refuses to raise the link with any attempt, then the problem is most likely in the iPXE driver.
Especially this problem concerns new network cards from Intel. I have problems with i218lm cards and with i218v-2, with a forced speed of 1 Gbit on the switch.
Before building, you need to fix ipxe / src / drivers / net / intel.c: for i218lm and i218v-2 set the flag INTEL_NO_PHY_RST:
PCI_ROM ( 0x8086, 0x155a, "i218lm", "I218-LM", INTEL_NO_PHY_RST), PCI_ROM ( 0x8086, 0x15a1, "i218v-2", "I218-V", INTEL_NO_PHY_RST ),
Install wimboot
To download WIM images via iPXE, you need the
wimboot utility.
Installing this utility is also very simple:
wget http://git.ipxe.org/releases/wimboot/wimboot-latest.zip unzip wimboot-latest.zip cp wimboot-2.5.1-signed/wimboot /var/lib/tftpboot/
Creating .ipxe configuration files
The configuration files .ipxe (the extension can be any, but it is more convenient) contain instructions for the ipxe kernel: what exactly to load next.
We will load the wimboot utility, and pass it to the parameters in the path to the BCD boot configuration data file, the boot disk RAM configuration file and to the boot.wim image. It is not necessary to save the directory structure; wimboot will take care of this. All files can be folded into one directory.
winpe.ipxe #!ipxe kernel http:
In this example, a symbolic link is made on the http server for 192.168.1.1/boot/DeploymentShare right to the root of MDT DeploymentShare. This method is not suitable as the main working option. Since if you suddenly create a “curve” wim-image, then immediately spoil the download on the network for those who work with it. But this method is well suited for testing new wim images.
Those who wish can replace the http protocol on the tftp in the .ipxe file - it will also work, but slowly.
Everything. Now you can boot and install the OS.