Adding WDS Versatility

Good afternoon, dear habra-residents!

The purpose of this article is to write a short overview of the possibilities for deploying various systems via 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 network boot as Memtest and Gparted.
The story will tell in the order of the ideas that come to my mind. And it all started with Microsoft...

And now the story itself:
Not so long ago, I came up with the sensible idea to deploy systems at work using WDS. If someone does the work for us, it's nice. And if at the same time we learn something new, it is doubly pleasant. I will not dwell in great detail on the description of the installation of the WDS role - Microsoft reduces everything to Next-Next-Next and articles on this topic are mountains. And I will briefly talk about working with Windows images, stopping at those moments that caused me difficulties. Systems not from Microsoft will be described in more detail (for the sake of which the article was started).
Let's get started.
The server that will act as the image repository and action coordinator has Windows Server 2008 R2 on board. For this service to work correctly, roles such as DHCP and DNS are required. Well, AD - for entering machines into the domain. (All these roles do not have to be kept on one machine, they can be spread over the entire 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:
Adding WDS Versatility

  • Install Images - installation images. Customized, beautiful systems that we will roll. For convenience, you can add several groups by system type: Windows 7, XP or by task type - IT Dept, Client Dept, Servers
  • boot images - boot images. What is loaded on the machine in the first place and allows you to perform all sorts of actions with it. The very first way there is the one that is on the installation disk (for Windows 7, this is the sources folder and install.wim or boot.wim files.
    But then you can do all sorts of interesting things from them:

    • Capture image or record image - our main tool, allows you to make a copy of the configured system, which was pre-processed by sysprep and is our template.
    • Image detection - allows you to upload to computers that do not support booting over the network, images of configured systems.

  • Pending Devices β€” Devices awaiting administrator approval for installation. We want to know who puts our beauty on their computer.
  • multicast transmissions - multicast. Used to install one 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:
    Adding WDS Versatility
    Once the drivers have been added to the WDS server, they must be added to the correct boot image.

Yes, and one more thing - for each bit depth of the system, you need to make your own loaders and installers. You have to pay for diversity in the zoo.
In fact, our WDS is already ready. We can boot over the network from the machine and see a selection box with our boot images.
I will not describe all the stages of preparing the ideal image, but I will only leave a link to the article, according to which I did it myself: Tyts for Windows 7 (For some reason, I had an old version of WAIK installed - 6.1.7100.0, it was impossible to create an answer file for Windows 7 SP1 in it. I need the latest one at the moment - 6.1.7600.16385)
And so more instructions for preparing Windows XP for WDS. We will not write in detail either - the most interesting thing is in the second part!

2. Universal bootloader

It's great that we now have such a system. Using it is a pleasure. But is it possible to somehow make life easier for yourself?
I want to install Linux through it!
First of all, as many of you remember, installing Windows and Ubuntu in parallel does not end with anything good for the Windows bootloader. It is supplanted by the universal GRUB.
It's the same here. We need a universal bootloader, get acquainted - this is PXELINUX
1) Download the latest version (at the time of this writing, this 5.01
We are interested in these files:
corepxelinux.0
com32menuvesamenu.c32 (you can take menu.c32 for text interface on boot)
com32chainchain.c32
All manuals for using this bootloader say that everything works with these three. I had to add ldlinux.c32, libcom.c32 and libutil_com.c32 as well. You can do this - copy the recommended and run. On which file will swear - that is copied to the folder.
We also need a memdisk file to download the iso. We also put it in this folder
2) We put them in the folder where you store all the WDS images. Namely, here - RemoteInstallBootx64 (we will only install only 64, for 86 place the same files in that folder too.)
3) Rename pxelinux.0 to pxelinux.com
4) Create folder pxelinux.cfg for the file with the configuration and the file itself (already inside this folder of course) - default (without extension!) with the following content:

DEFAULT weightmenu.c32
PROMPT 0
NOESCAPE 0
ALLOWOPTIONS 0
# Timeout in units of 1/10 s
TIMEOUT 300
MENU MARGIN 10
MENU ROW 16
MENU TABMSGROW 21
MENU TIMEOUTROW 26
MENU COLOR BORDER 30;44 #20ffffff #00000000 none
MENU COLOR SCROLLBAR 30;44 #20ffffff #00000000 none
MENU COLOR TITLE 0 #ffffffff #00000000 none
MENU COLOR SEL 30;47 #40000000 #20ffffff
MENU BACKGROUND pxelinux.cfg/picture.jpg #picture 640Γ—480 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 name 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:bootx64pxelinux.com /architecture:x64
  • wdsutil /set-server /N12bootprogram:bootx64pxelinux.com /architecture:x64

Command line output:
Adding WDS Versatility
That's it, we boot up and see the coveted screen:
Adding WDS Versatility
This is a basic config, you can customize it to suit your requirements (company logo, boot order, etc. For now, it can only transfer control to WDS and boot from the hard drive again. Let's teach it to boot Ubuntu!

3. Teaching the eaglet to fly

What did we need there? ubuntu gparted? Let's add another memtest for order.
Let's start with the simplest:
memtest
Let's create a separate folder for Linux files in the Boot/x64 WDS folder, for example, Distr. And subfolders in it for our respective systems:
Adding WDS Versatility
Download the iso mtmtest and add the following lines to our boot 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 launch it from there. Unfortunately, this did not work for me with large images.

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 can be wrong in the wording, a big request to the readers to correct if I'm wrong)

  • vmlinuz (more commonly seen vmlinux) - compressed kernel file
  • initrd.img - image of the root file system (required minimum for loading)
  • filesystem.squashfs - the files themselves used in the process

We place the first two files in the download folder (in my case, this is Bootx64DistrGparted) and the third one on the IIS server (fortunately, it has already been raised for WSUSa).
A lyrical digression - unfortunately, the method of loading the iso image into memdisk with large distributions did not work out for me. If suddenly you know the secret of success, this will be a great solution that will allow you to quickly load any system from an iso image.
Add filesystem.squashfs to IIS so it can be read over the network (don't forget to add a MIME tag for this extension
Adding WDS Versatility
Now 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

We check - it works!
Ubuntu 12.04
I added two possible installation options - fully automatic (thanks to the user malamutes behind Article and in manual mode)
We download the file with the alternate installation and tear out (as before) two files from there - initrd.gz and linux and put them in Distr/Ubuntu
Add lines to our pxelinux.cfg/default
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 put it on our web server. My loader line 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

Usefulness for the future
Looking through the material on the topic and looking for answers to my questions, I found wonderful article from Alexander_Erofeev with a description of downloading Kaspersky Rescue Disk over the network. Unfortunately, it didn't take off for me. But the tool is really useful (no, no, yes, especially zealous users will grab something like that ... It's 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 on the WDS itself, the thread of the story led me into some depths that no one would ever encounter, probably ... Therefore it was decided to share brief information about what is possible and, if possible, links to good articles. If it will be interesting for readers to read, or I suddenly want fame and money to replenish Habrahabr's piggy bank with articles, you can dwell in more detail on each of the stages of setting up a multi-purpose WDS server.
I would like to once again thank the authors Alexander_Erofeev ΠΈ malamutes for their material, which will be of interest to everyone without exception.
Naturally, HabrΓ© already had articles on the same topic, I tried to highlight the issue from a different point of view or supplement it: Time ΠΈ two but not published
Thank you for attention.
Glory robots!

Source: habr.com

Add a comment