📜 ⬆️ ⬇️

Add WDS universality

Good afternoon, dear habras-residents!

The purpose of this article is to write a brief 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 useful tools to the network download such as Memtest and Gparted.
The story will be told in the order of the ideas that come to my mind. And it all began with Microsoft ...

And now the story itself:
Not so long ago, I came up with the sensible idea of ​​deploying a system using WDS. If someone does work for us, it’s nice. And if at the same time we learn something new - it is pleasant in twins. I will not dwell on the description of the installation of the role of WDS - Microsoft reduces everything to Next-Next-Next and articles on this topic - mountains. And I will briefly tell you about working with Windows images with a halt at those moments that caused me difficulty. More systems from Microsoft will be described in detail (for 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 correct operation of this service, roles such as DHCP and DNS are required. Well, and AD - to enter the machines in the domain. (All these roles need not be kept on one machine; they can be spread throughout the structure. The main thing is to work correctly)
1. Configure WDS

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


Yes, and also - for each bit of the system you need to make your own bootloaders and installers. For diversity in the zoo have to pay.
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 an ideal image, but just leave a link to the article I used to do: 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. Need the latest at the moment - 6.1.7600.16385)
And here is another instruction for preparing Windows XP for WDS. Also, we will not write in detail - the most interesting is in the second part!
2. Universal loader

It's great that we now have such a system. To use it is a pleasure. But is it not possible to 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 ubunt does not end with anything good for the Windows bootloader. It is supplanted by the universal GRUB.
Here as well. We need a universal bootloader, meet - this is PXELINUX
1) Download the latest version (at the time of writing this is 5.01
We are interested in these files:
core \ pxelinux.0
com32 \ menu \ vesamenu.c32 (you can take the menu.c32 for the text interface when loading)
com32 \ chain \ chain.c32
All the manuals for using this bootloader say that everything works with these three. I had to add more ldlinux.c32, libcom.c32 and libutil_com.c32. You can do this - copy the recommended and run. On which file will swear - that copy to the folder.
We also need the memdisk file to load iso. Also put it in this folder
2) We put them in the folder where you have all the images of WDS. 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 pxelinux .cfg folder for the configuration file and the file itself (already inside this folder naturally) - default (without the extension!) With the following content:
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 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 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 name it pxeboot.0
6) After that, you need to teach our WDS to boot from the universal loader. In 2008 this was done through the GUI, in 2008 R2 - through the command line. Open and enter:

Command line output:

All loaded and see the desired screen:

This is the basic config, it can be corrected to fit your requirements (company logo, boot order, etc.). As long as it can only transfer control to WDS and boot from the hard disk again. Let's teach it to load Ubuntu!
3. We teach the eaglet to fly

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

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

Download iso mtmtest and add the following lines to our confi download (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, it didn’t 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 make a mistake )

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

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

Check - works!
Ubuntu 12.04

I added two possible installation options - fully automatic (thanks to the Malamut user for the article and in manual mode)
Download the file with the alternate installation and tear out two files from there (as before) - 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 the settings of the answers (you can read here ) and we will put it on our web-server. My line in the loader looks like this:
LABEL Ubuntu Auto Install
KERNEL Distr / Ubuntu / linux
APPEND initrd = Distr / Ubuntu / initrd.gz ksdevice = eth0 locale = en_RU.UTF-8 console-setup / layoutcode = en 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 their questions, a wonderful article from Alexander_Erofeev was found describing the download of Kaspersky Rescue Disk over the network. Unfortunately, I did not take off. But the tool is really useful (no, no, yes, they will be grasped by especially zealous users of something such ... It is useful to have such a tool at hand)

Conclusion

This article is an overview of the possibilities that the WDS role of Microsoft provides for you. When I started this article - the plans were ambitious: the most detailed HOWTO about all aspects of loading the systems presented above ... But when the material began to accumulate only on WDS itself - the thread of the narrative led 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 are interested in reading, or I suddenly want fame and money to replenish the Habrahabr piggy bank with articles, you can dwell on each of the stages of setting up a multipurpose WDS server.
I would like to thank once again the authors Alexander_Erofeev and Malamut for their material, which will be of interest to everyone without exception.
On Habré, there were naturally already articles on the same subject, I tried to highlight the question from another point of view or to add it: Once and twice, but it was not published
Thanks for attention.
Glory to the robots!

Source: https://habr.com/ru/post/171329/


All Articles