Add WDS Versatility

  • Tutorial
Good afternoon, dear Habra residents!

The purpose of this article is to write a short overview of the capabilities for deploying various systems through WDS (Windows Deployment Services).
The article will provide brief instructions for deploying Windows 7 x64, Windows XP x86, Ubuntu x64 and adding such useful tools to the network boot as Memtest and Gparted .
History will tell in the order of ideas that come to my mind. And it all started with Microsoft ...

And now the story itself:
Not so long ago, it came to my mind a sensible idea to deploy a system using WDS. If someone does the work for us, it's nice. And if at the same time we learn something new - it’s nice in twins. I will not dwell on the description of the installation of the WDS role - Microsoft reduces everything to Next-Next-Next and articles on this topic - mountains. And I’ll briefly talk about working with Windows images with a stop at those points that caused me difficulties. Non-Microsoft systems will be described in more detail (for which the article was conceived).
Let's get started.
The server, which will act as the repository of images and the coordinator of actions, has Windows Server 2008 R2 on board. For this service to work correctly, roles such as DHCP and DNS are required. Well, AD - to enter machines into the domain. (All these roles do not have to be kept on the same machine, they can be spread throughout the structure. The main thing is that they work correctly)
1. WDS setup

We add the necessary roles and quickly climb into the WDS console, initialize our server and see the following:

  • Install Images - Installation images. Customized, beautiful systems that we will roll. For convenience, you can add several groups by type of system: Windows 7, XP, or by type of task - IT Dept, Client Dept, Servers
  • Boot Images - boot images. What is loaded on the car in the first place and allows you to perform all sorts of actions with it. The very first way there goes the one that is on the installation disk (for Windows 7, this is the sources folder and the install.wim or boot.wim files.
    But here you can do anything interesting from them:
    • Capture image or recording image - our main tool, allows you to make a copy of the configured system, which was pre-processed by sysprep and is our template.
    • Detection image - allows uploading images of configured systems to computers that do not support booting over the network.

  • Pending Devices - devices pending administrator approval for installation. We want to know who puts our charm on our computer.
  • Multicast Transmissions - multicast. Used to install a single image to a large number of clients.
  • Drivers - drivers. They help to add the necessary drivers to the images on the server and avoid such errors:

    After adding the drivers to the WDS server, they must be added to the desired boot image.

Yes, and yet - for each bit depth of the system you need to make your own loaders and installers. You have to pay for the variety at the zoo.
In fact, our WDS is ready. We can boot over the network from the machine and see a window of choice with our boot images.
I will not describe all the stages of preparing the ideal image, but just leave a link to an article that I myself did: Tyts for Windows 7 (for some reason I had the old version of WAIK installed - 6.1.7100.0, it was impossible to create an answer file for Windows in it 7 SP1. We need the latest at the moment - 6.1.7600.16385)
And here's another instruction for preparing Windows XP for WDS. We will not write in detail either - the most interesting part is in the second part!
2. Universal bootloader

It is great that we now have such a system. Using it is a pleasure. But is it possible to somehow make your life even easier?
I want to install Linux through it!
First of all, as many of you remember - installing parallel to Windows and ubunta does not end with anything good for a Windows bootloader. It is superseded by the universal GRUB.
It's the same here. We need a universal loader, get acquainted - this is PXELINUX
1) Download the latest version (at the time of writing this article is 5.01
We are interested in these files:
core \ pxelinux.0
com32 \ menu \ vesamenu.c32 (you can take menu.c32 for the text interface at boot time)
com32 \ chain \ chain.c32
All manuals for using this bootloader say that with these three everything works. I had to add ldlinux.c32, libcom.c32 and libutil_com.c32 as well. You can do this - copy the recommended ones and run. Which file will swear - copy to the folder.
We also need a memdisk file to download iso. Also put it in this folder
2) Put them in the folder where you have all the WDS images. Namely, here - RemoteInstall \ Boot \ x64 \ (we will only have 64 installed, for 86 put the same files in that folder too.)
3) Rename pxelinux.0 to pxelinux.com
4) Create a folder pxelinux .cfg for the configuration file, the file itself (already inside this folder is natural) - default (without extension!) with the following contents:
DEFAULT vesamenu.c32
PROMPT 0
NOESCAPE 0
ALLOWOPTIONS 0
# Timeout in units of 1/10 s
TIMEOUT 300
MENU MARGIN 10
MENU ROWS 16
MENU TABMSGROW 21
MENU TIMEOUTROW 26
MENU COLOR BORDER 30; 44 # 20ffffff # 00000000 none
MENU COLOR SCROLLBAR; # 20ffffff # 00000000 none
MENU COLOR TITLE 0 #ffffffff # 00000000 none
MENU COLOR SEL 30; 47 # 40000000 # 20ffffff
MENU BACKGROUND pxelinux.cfg / picture.jpg #picture 640x480 for background
MENU TITLE Choose your destiny!

LABEL wds
MENU LABEL Windows Deployment Services (7, XP, Boot images)
KERNEL pxeboot. 0

LABEL local
MENU DEFAULT
MENU LABEL Boot from Harddisk
LOCALBOOT 0
Type 0x80

5) Make a copy of the pxeboot.n12 file and call it pxeboot.0
6) After that, you need to teach our WDS to boot from the universal bootloader. In 2008, this was done through the GUI, in 2008 R2 through the command line. Open and enter:
  • wdsutil / set-server /bootprogram:boot\x64\pxelinux.com / architecture: x64
  • wdsutil / set-server /N12bootprogram:boot\x64\pxelinux.com / architecture: x64

Command line output:

Everything, boot and see the desired screen:

This is the basic config, it can be adjusted to your requirements (company logo, boot order, etc. So far, it can only transfer control to WDS and boot from the hard drive again. Let's teach it to load Ubuntu !
3. We teach the eaglet to fly

What did we need there? Ubuntu, Gparted? Add memtest for order.
Let's start with the simplest:
Memtest

Create a separate folder for Linux files in the Boot / x64 WDS folder, for example Distr. And the subfolders in it for our respective systems:

Download iso mtmtest and add the following lines to our download config (default file):
label MemTest
menu label MemTest86 +
Kernel memdisk iso raw
initrd Linux / mt420.iso

This will load our small image into memory and run it from there. Unfortunately, with large images, this did not work for me.

Gaprted

Download the latest version , unpack the iso image and take three files - / live / vmlinuz, /live/initrd.img and /live/filesystem.squashfs
What are these files? ( I may be mistaken in the wording, a big request to the readers to correct if I make a mistake )
  • vmlinuz (you can often see vmlinux) - a compressed kernel file
  • initrd.img - image of the root file system (minimum required to boot)
  • filesystem.squashfs - the files themselves used in the process

We put the first two files in the download folder (in my case, it is Boot \ x64 \ Distr \ Gparted) and the third one on the IIS server (since it has already been raised for WSUSa).
Lyrical digression - unfortunately, the reception with loading the iso image in memdisk with large distributions failed. If suddenly you know the secret to success - this will be a great solution that will allow you to quickly load any system from an iso image. We add
filesystem.squashfs on IIS so that it can be read over the network (do not forget to add a MIME label for this extension.

Now we add an entry to our pxelinux.cfg / default:
LABEL GParted Live
MENU LABEL GParted Live
KERNEL Distr / Gparted / vmlinuz
APPEND initrd = Distr / Gparted / initrg.img boot = live config union = aufs noswap nopromt vga = 788 fetch = http: //192.168.10.10/Distr/Gparted/filesystem .squashfs

Check - it works!
Ubuntu 12.04

I added two possible installation options - fully automatic (thanks to Malamut for the article and in manual mode)
Download the file with the alternate installation and tear out two files (initrd.gz and linux) from there (as before) and put them in Distr / Ubuntu
Add to our pxelinux.cfg / default lines
for fully manual installation
LABEL Ubuntu
KERNEL Distr / Ubuntu / linux
APPEND priority = low vga = normal initrd = Distr / Ubuntu / initrd.gz

But for automatic installation you need a file with response settings (you can read here ) and we will put it on our web-server. My line in the bootloader looks like this:
LABEL Ubuntu Auto Install
KERNEL Distr / Ubuntu / linux
APPEND initrd = Distr / Ubuntu / initrd.gz ksdevice = eth0 locale = ru_RU.UTF-8 console-setup / layoutcode = ru url = http: //192.168.10.10/Distr/Ubuntu /preseed.txt

Utility for the future

Looking through the material on the topic and looking for answers to my questions, a wonderful article from Alexander_Erofeev was discovered with a description of downloading Kaspersky Rescue Disk over the network. Unfortunately, it didn’t take off from me. But the tool is really useful (no, no, yes, especially zealous users will grab something like that ... It is useful to have such a tool at hand)

Conclusion

This article is an overview of the features that the Microsoft WDS role provides for you. When I started this article, the plans were grandiose: the most detailed HOWTO about all aspects of loading the systems presented above ... But when the material began to accumulate only according to WDS itself - the story’s thread took me to some depths that no one would encounter, probably ... Therefore it was decided to share brief information about what is possible and, if possible, links to good articles. If readers will be interested in reading, or if I suddenly want fame and money to replenish Habrahabr’s piggy bank with articles, you can dwell on each of the stages of setting up a multi-purpose WDS server.
I would like to once again thank the authors of Alexander_Erofeevand Malamut for their material that will be interesting to everyone without exception.
Naturally, there were already articles on the same topic on Habré, I tried to cover the issue from a different point of view or supplement it: Once or twice, but it was not published
Thank you for your attention.
Glory to the robots!

Also popular now: