Ipxe установка windows 10

Booting Windows Installation from iPXE

This gave me so much trouble to figure it out, but it works. My issue in the end was finding out that WinPE «Windows Preinstallation Environment» (the component that in the end loads the setup.exe for installation) by default do not have many network drivers in it. So you get it to boot, but then you can’t load the installation files from SAMBA share, it then proceeds to crash.

This is the flow:

graph LR
A(iPXE) —> B(wimboot) —> C(WinPE) —> E(Windows setup.exe)
F(SAMBA) —> C

Get Windows 10 ISO

I’m going for Windows 10 in this guide, but it should work the same way for other versions as well. Apart the very old ones.

You can download official ISO from Media Creation Tool or google Media Creation Tool for Windows 10. Click through the program and made it to save ISO file to your drive. Once done, rename it to something more simple like Windows10.iso

Get Wimboot

This is another step to load windows install environment. We will refer to this file soon, but if you want to have some more information, read here about what it can do.

Taken from their site:

📝

wimboot is a bootloader for Windows Imaging Format (.wim) files. It enables you to boot into a Windows PE (WinPE) deployment or recovery environment.

On your Ubuntu PXE server:

cd /pxe-boot
wget https://github.com/ipxe/wimboot/releases/latest/download/wimboot

Create boot.wim file

Now the pain begins… some Windows black magic is required. Also, a Windows 10 PC on which you are going to do this. There is a very high chance that boot.wim file distributed on Windows 10 ISO does not have network drivers for the motherboard you’re going to netboot on. But give it a try, skip this whole section and extract boot.wim from the ISO you downloaded before. It is located in: sources\boot.wim in the ISO. If the machine does boot up to a part where it should mount samba share, but it crashes… come back, and we need to create our own boot.wim file, with embedded drivers we need.

Creating custom boot.wim

I assume you are back here because the original boot.wim did not work. To be honest I have only seen it work on VMware virtual machines with e1000 network card and nothing else :)

So the task of the day is to create our own.

  • Get Windows 10 PC you’re going to do this on.
  • Download network drivers for Windows10 for your motherboard / network card.
  • Burn some incense praying candles and pray to the silicon gods. 🙂

You need to download and install two packages from Microsoft.

  • ADK for Windows
  • Win PE Optional Components for Windows ADK

Look HERE and scroll down for Download the Windows ADK for Windows 10, version 2004 download it. Then on the same page right under is Download the Windows PE add-on for the ADK, version 2004

I believe we can use the latest version of Windows 11 versions to install win 10 and lower, possibly. But I did not test it. If anybody had, please write me in comments below.

Install the ADK first, click next and leave all to default. Then install the Win PE, same as before… next, next, next and leave default everything.

Click on start and begin typing Deployment and Imaging Tools Environment and run it as root.

It should open the console window already in C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools

Create a new folder on your C:\ drive called WinPE

Then run in the opened console following command.

copype amd64 C:\WinPE

This should generate a bunch of files in that folder.

Adding drivers

Create new folders.

C:\mount
C:\mount\drivers
C:\mount\BootWim

Copy the drivers you wish to inject into the C:\Mount\Drivers folder. It does not matter if they are in another subfolder in there, just make sure they are the .cat. .sys .inf variation… not the setup.exe that would not work. You can put as many as you want, if you’re planing to use different hardware…

💡

You can put 32bit and 64bit drivers if you want. If your motherboard or network card driver package contain drivers for WinPE use that ones.

Copy C:\WinPE\media\sources\boot.wim to C:\mount

Here is example of how my folder structure looks like, with WinPE Network drivers I took from Asus NUC driver CD.

C:\
└─ mount\
   ├─ boot.wim
   ├─ BootWim\
   └─ drivers\
      └─ WinPE\
         ├─ 32\
         │  ├─ rt640x86.cat
         │  ├─ rt640x86.sys
         │  └─ ws640x86.inf
         └─ 64\
            ├─ rt640x64.cat
            ├─ rt640x64.sys
            └─ ws640x64.inf

Next open CMD as Administrator.

Execute following commands

::Switch to C:\Mount
cd C:\mount
::Mount boot.wim to folder BootWim
DISM /Mount-Wim /WimFile:C:\mount\boot.wim /Index:1 /MountDir:C:\mount\BootWim
::Add the drivers
DISM /Image:C:\mount\BootWim /Add-Driver /Driver:C:\mount\drivers /recurse
::Commit the changes and umount the .wim file
DISM /Unmount-Wim /MountDir:C:\mount\BootWim /Commit

Link where I got how to add the drivers is HERE.

Back to PXE server

We are going back to our Ubuntu PXE server, and we need to take the modified C:\mount\boot.wim with us.

Copy the boot.wim into your /pxe-boot directory.

Your /pxe-boot should look like this as of now.

/pxe-boot
├─ boot.wim  # Our WinPE (Windows Preinstallation Environment)
├─ ipxe.efi  # UEFI ROM that is server first through PXE boot
├─ main.ipxe # Our main menu file
└─ wimboot   # Windows loader

Edit main.ipxe

We are going to change our main menu that iPXE will offer us to include Win10 install.

#!ipxe

set boot-url http://10.0.30.15

menu
item --gap -- ---------------- iPXE boot menu ----------------
item shell iPXE shell
item windows Win10 Install
item exit  Exit to BIOS

choose --default exit --timeout 10000 option && goto ${option}

:shell
shell

:windows
chain ${boot-url}/winboot.ipxe

:exit
exit

You can get very fancy with the menus, but this is the most basic stuff to get it to work, and you can build on it later on.

Maybe some explanation of the config file

  • set boot-url http://10.0.30.15set will basically define variable. In our case we told iPXE that boot-url (later in script called with ${boot-ulr}) equals http://10.0.30.15 which is my Ubuntu PXE server IP. Careful with slashes. Also, the variable persist between menu «files».
  • menu and itemsmenu define start of menu, where we use item to define items of the menu… make sense, right.

💡

item have specific structure as well, you can see there are 2 parameters after it. item <menu> <label>. The menu name is referring to :<menu> later in the script.

  • chain ${boot-url}/winboot.ipxe — chain will load next config file and execute it… this can be used to switch to another sub menu or so on, we will use it to separate our windows iPXE configuration.

winboot.ipxe

Since in our menu above it will load this file next. Let’s create it.

Create file: /pxe-boot/winboot.ipxe

#!ipxe

kernel ${boot-url}/wimboot gui
initrd ${boot-url}/winpeshl.ini     winpeshl.ini
initrd ${boot-url}/install.bat      install.bat
initrd ${boot-url}/installs/windows/win10/boot/bcd         BCD
initrd ${boot-url}/installs/windows/win10/boot/boot.sdi    boot.sdi
initrd ${boot-url}/boot.wim boot.wim
#initrd ${boot-url}/installs/windows/win10/sources/boot.wim boot.wim

boot || goto failed

I know we just referenced a bunch of files we do not have yet. But we will setup them next. One thing to note, is that we basically load all of them via HTTP, if you followed this guide that’s the Apache2 we setup before.

winpeshl.ini

winpeshl.ini is special file that when it’s on the same folder as boot.wim (WinPE — Windows Preinstallation Environment) its «pulled in» and executed.

All we put in this file is:

  [LaunchApps]
  "install.bat"

Basically telling it, when you load your self, let’s start install.bat

install.bat

Lunched by winpeshl.ini, it’s a script for windows to tell WinPE to:

  • Initialize network — wpeinit
  • Load SAMBA share — net use \\10.0.0.2\isos
  • Execute setup.exe — \\10.0.0.2\isos\pxe-boot\installs\windows\win10\setup.exe

So the inside of the file looks like this:

wpeinit
net use \\10.0.0.2\isos
\\10.0.0.2\isos\pxe-boot\installs\windows\win10\setup.exe

💡

The IP 10.0.0.2 is my Unraid server serving the share isos as a samba share. If you’re sharing from PXE server itself, use its IP and directly share pxe-boot. It would look like this probably \\<IP>\\pxe-boot\installs\windows\win10\setup.exe

Install files / ISOs

I have created a folder structure in /pxe-boot to house my installation files and ISOs. For the purpose of this exercise, we need to extract Windows ISO files from Windows Install ISO we downloaded.

To understand what files are referenced in /pxe-boot/winboot.ipxe my folder structure looks like this.

/pxe-boot
└─ installs/
   ├─ linux/     #Prepareation for Linux
   └─ windows/
      └─ win10/  #Extracted ISO files here
         ├─ boot/
         ├─ efi/
         ├─ sources/
         ├─ autorun.inf
         ├─ bootmgr
         ├─ bootmgr.efi
         └─ setup.exe #We call this one in install.bat

We also refer to two files that come from the installation ISO in /pxe-boot/winboot.ipxe

  • initrd ${boot-url}/installs/windows/win10/boot/bcd         BCD
  • initrd ${boot-url}/installs/windows/win10/boot/boot.sdi    boot.sdi

These come with the boot CD.

Copy your downloaded Windows 10 Install ISO to your Ubuntu PXE server.

Put it in /tmp (or some other place, but we will refer to it in /tmp/Windows.iso)

mkdir /mnt/iso
mount -o loop /tmp/Windows.iso /mnt/iso
mkdir -p /pxe-boot/installs/win10
cp -r /mnt/iso /pxe-boot/installs/win10

Done !

When you now boot via UEFI PXE boot, a menu with Windows Install should pop up. It will load wimboot loader, loads a bunch of stuff from HTTP. Hopefully starts WinPE (It looks like the initial installation screen of windows), then load SAMBA share with installation files and start the actual installation calling setup.exe. Pfew! I promise that for Linux, this is so much easier… !

we have the hardest and longest part behind us, you deserve a drink, and if you found this useful, help me to get one too. I would appreciate that a lot.

В этой статье мы рассмотрим, как установить Windows 10 или 11 по сети без использования загрузочной USB флешки (установочного DVD диска). Для загрузки компьютера по сети через PXE мы будем использовать небольшой Tiny PXE Server. Инструкция применима для установки Windows на устройствах как с UEFI, так и с BIOS прошивкой.

В корпоративных сетях для разливки образов Windows по сети используются более функциональные Windows Deployment Services (WDS) и Microsoft Deployment Toolkit (MDT). В этой статье мы покажем, как быстро запустить PXE сервер на любом имеющемся компьютере (будь то устройство с Windows или Linux) и использовать его для сетевой установки Windows на компьютеры в этой же LAN с помощью простых средств.

Нам понадобятся:

  • Установочный ISO образ с Windows 10 или 11 (проще всего создать его с помощью Windows Media Creation Tool согласно инструкции https://winitpro.ru/index.php/2013/12/31/sozdaem-zagruzochnuyu-fleshku-s-windows-7-dlya-uefi-sistemy/ )
  • Образ Windows PE — можно использовать свой образ WinPE, извлечь его из образа восстановления MS DART, получить оригинальный WinPE с помощью Windows Assessment and Deployment Kit (Windows ADK), или использовать готовый образ типа Hiren’s BootCD PE.
  • Сервер Tiny PXE (http://reboot.pro/files/file/303-tiny-pxe-server/ )

Содержание:

  • Создаем загрузочный образ Windows PE с помощью ADK
  • Подготовка сервера сетевой установки TinyPXE
  • Сетевая установка Windows 10 и 11 с PXE сервера

Создаем загрузочный образ Windows PE с помощью ADK

Скачайте Windows ADK для Windows 11 и Windows PE add-on for the Windows ADK по ссылкам на странице https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install .

скачать ADK для Windows

При установке Windows ADK выберите минимальную установку Deployment Tools.

установка ADK Deployment Tools

Затем аналогично установите Windows PE add-on for Windows ADK.

установка Windows PE add-on for Windows ADK

После окончания установки запустите Deployment and Imaging Tool из стартового меню Windows. Или запустите вручную команду:

"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat"

запуск Deployment and Imaging Tool

Теперь скопируйте файлы для среды WinPE в указанный каталог (создавать не нужно):

copype amd64 C:\tools\winpe

В данном случае я создаю файлы для среды WinPE x64. Можно использовать другие опции в зависимости от архитектуры: x86, arm или arm64.

генерация файлов для среды WinPE copype amd64

Теперь можно создать загрузочный ISO образ с WinPE:

MakeWinPEMedia /ISO C:\tools\winpe c:\tools\WinPE.iso

MakeWinPEMedia: создать ISO образ WINPE

Подготовка сервера сетевой установки TinyPXE

Теперь нужно настроить ваш PXE сервер:

  1. Распакуйте архив pxesrv.zip в каталог C:\tools\pxesrv;
  2. Перейдите в каталог C:\tools\pxesrv и создайте текстовый файл pxe_menu.txt со следующим содержимым:
    #!ipxe
    set boot-url http://${dhcp-server}
     #================ Main Menu =================
    menu iPXE boot menu
    item WinPEISO WindowsPE ISO
    choose target && goto ${target}
    #============ Main Menu Options =============
    :WinPEISO
    sanboot ${boot-url}/iso/WinPE.iso
    boot

    конфигурационный файл меню для pxe сервера

  3. Скопируйте полученный ранее файл WinPE.iso в каталог C:\tools\pxesrv\files\iso;
  4. Смонтируйте установочный ISO образ в виртуальный привод Windows и откройте общий сетевой доступ к нему (если хотите, можете открыть к нему анонимный доступ, но это не обязательно);
    общий доступ к каталогу с установочным образом Windows

  5. Запустите файл pxesrv.exe с правами администратора;
  6. Включите опцию HTTPd;
  7. Если ваш компьютер сам будет раздавать IP адреса по DHCP (Tiny PXE это умеет), отключите опцию ProxyDHCP. Убедитесь, что в полях Option 54 DHCP Server и Next-Server указан IP адрес вашего компьютера. В поле IP Pool start указано начало диапазона DHCP, убедитесь что этот диапазон не занят в вашей сети;
  8. В разделе Boot File укажите ipxe.pxe (для загрузки на BIOS устройствах) или ipxe-x86_64.efi (для UEFI устройств);
  9. В поле Filename if user-class=gPXE or IPXE укажите имя файла меню, который вы создали ранее pxe_menu.txt;
  10. Запустите PXE сервер, нажав кнопку Online;
    настройки Tiny PXE сервера для загрузки Windows PE по сети

Итак, ваш PXE сервер запущен и готов к работе. Если в Windows включен брандмауэр (проще), отключите его или разрешите входящий трафик для процесса pxesrv.exe по протоколам DHCP, PXE, HTTP, TFTPS и SMB.

Сетевая установка Windows 10 и 11 с PXE сервера

Теперь вам нужно загрузить ваш компьютер, на который вы хотите установить Windows, с PXE сервера. Компьютер должен находится в той же локальной сети (VLAN), что и компьютер с PXE сервером.

В настройках BIOS/UEFI компьютера выберите в качестве первичного устройства загрузки PXE.

загрузка компьютера по сети через PXE (EFI network)

При запуске среды PXE компьютер обнаружит в сети DHCP сервер, получит IP адрес и получит доступных опции в меню iPXE.

загрузочное меню PXE сервера

Компьютер загрузится по сети в среде WinPE.

В моем случае при тестировании загрузки с PXE сервера виртуальной машины VMWare с UEFI прошивкой появилась ошибка:

Could not describe SAN devices: Operation not supported
Could not boot image: Operation not supported https://ipxe.org/err/3c2220


Как оказалось, в UEFI прошивки виртуальной машины на моем хосте VMware ESXi есть баг:

This error indicates that your UEFI firmware has a bug that prevents the installation of the iSCSI boot firmware table (iBFT). Switch to booting in “legacy” BIOS mode rather than UEFI mode.

Пришлось переключить ВМ в режим BIOS и запускать PXE сервер с опцией ipxe.pxe. После этого пошла нормальная установка Windows по сети.

Вам осталось подключить по SMB сетевой каталог, в котором хранится ваш установочный ISO образ Windows 11.

После инициализации среды командой
wpeinit
подключите ваш сетевой каталог, в который смонтирован установочный образ Windows. Выполните команду:

Net use E: \\192.168.13.202\e

Где
192.168.13.202
– имя компьютера на котором хранится установочный образ, а
E
– название общей папки.
Введите имя пользователя, с правами доступа к вашей Windows с PXE сервером.

подключение сетевого каталог с установочным образом Windows в WinPE

Запустите знакомый мастер установки Windows.

установка windows 11 по сети через pxe

Install Windows 10 from iSCSI using iPXE

This assumes that you already have (and know) the following:

  1. iPXE
  2. HTTP server (or a TFTP server)
  3. iSCSI target
  4. Windows 10 ISO file
  5. A client that can boot via PXE

Prepare your iSCSI Target

  1. Mount your iSCSI target to either Windows using ISCSI Initiator or Linux using open-iscsi
  2. Format the drive as NTFS
  3. Copy the content of Windows 10 ISO file to the iSCSI target drive

Booting Instructions

using wimboot + WinPE

  1. Download wimboot an and upload it to your HTTP server
  2. Create windows_winpe_wimboot.ipxe and upload it to your HTTP server (Don’t forget to replace iscsi-host, iscsi-url and http-url)
  3. Create startnet.cmd and upload it to your HTTP server
  4. For testing, you can chain load this file directly via iPXE shell otherwise add this to your existing iPXE menu
  5. Once booted you should be able to see the Windows Setup

without using wimboot

  1. Create windows_no_wimboot.ipxe and upload it to your HTTP server (Don’t forget to replace iscsi-host and iscsi-url)
  2. For testing, you can chain load this file directly via iPXE shell otherwise add this to your existing iPXE menu
  3. Once booted you should be able to see the Windows Setup

Most information here are base from https://gist.github.com/robinsmidsrod/2234639


This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters

Show hidden characters

@echo off
@REM Initialize and wait for the network to be available
wpeinit
wpeutil WaitForNetwork
net start dnscache
@REM Mount the iSCSI drive as Drive W. Modify this part as needed.
echo rescan > «%SYSTEMROOT%\system32\diskpart.txt«
echo select disk 0 >> «%SYSTEMROOT%\system32\diskpart.txt«
echo select volume 0 >> «%SYSTEMROOT%\system32\diskpart.txt«
echo assign letter=W >> «%SYSTEMROOT%\system32\diskpart.txt«
diskpart /s %SYSTEMROOT%\system32\diskpart.txt
W:\setup.exe


This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters

Show hidden characters

#!ipxe
set iscsi-host 10.10.10.5
set iscsi-url iscsi:${iscsi-host}:::1:iqn.2020-10.com.example.test
# Force gateway to be the iSCSI target server (from https://gist.github.com/robinsmidsrod/2234639)
set netX/gateway ${iscsi-host}
# Prevent iPXE from detaching a SAN drive
set netX/keep-san 1
set root-path ${iscsi-url}:ipxestorage
sanboot —drive 0x80 ${root-path} || goto failed
boot || goto failed
:failed
shell


This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters

Show hidden characters

#!ipxe
set iscsi-host 10.10.10.5
set iscsi-url iscsi:${iscsi-host}:::1:iqn.2020-10.com.example.test
set http-url http://10.10.10.6
# Force gateway to be the iSCSI target server (from https://gist.github.com/robinsmidsrod/2234639)
set netX/gateway ${iscsi-host}
# Prevent iPXE from detaching a SAN drive
set netX/keep-san 1
# Hook the iSCSI target, this will ensure that the iSCSI is available when WinPE boots up
set root-path ${iscsi-url}:ipxestorage
sanhook —drive 0x80 ${iscsi-url}:ipxestorage
# Identify the architecture. If you only have amd64, you can remove this
cpuid —ext 29 && set arch amd64 || set arch x86
# set the kernet to use wimboot
kernel ${http-url}/kernel/wimboot
# Inject the startup script `startnet.cmd`, this should be the exact filename
# If you want different filename, you need to inject `winpeshl.ini`
initrd ${http-url}/os/windows/winpe/startnet.cmd startnet.cmd
# Inject winpe boot files
initrd ${http-url}/os/windows/winpe/${arch}/media/Boot/BCD BCD || goto failed
initrd ${http-url}/os/windows/winpe/${arch}/media/Boot/boot.sdi boot.sdi || goto failed
initrd ${http-url}/os/windows/winpe/${arch}/media/sources/boot.wim boot.wim || goto failed
boot || goto failed
:failed
shell

Время на прочтение12 мин

Количество просмотров69K

Предисловие

Полагаю буду следующим в серии статей-альтернатив:

  1. Раз!

  2. Два!

Раньше у нас использовалась заливка ОС по PXE с использованием syslinux, но как бывает с самодостаточными системами и без достаточного контроля и внимания — быстро превратилась в кашу из конфигураций, библиотек, загрузчиков.

Так же была необходимость в поддержке заливки разных ОС в режиме EFI — на тот момент заливка была только в Legacy.

В желании разобраться в этом наследстве, упростить и облегчить добавление новых образов в список, я познакомился с iPXE.

Оглавление

  1. Подготовка стендового сервера

  2. Сборка загрузчиков

  3. Написание меню загрузки

  4. Добавление образов debian, windows, утилит

  5. Итог

1. Подготовка стенда

Раздел частично отсылает к Загрузочный сервер — как загрузочная флешка…, первичная подготовка схожа — для базы используется чистый Debian Bullseye, но думаю, использование другого дистрибутива не будет сильно отличаться.

Дано

  • VM VirtualBox

    • Ram: 1 Гб

    • VDI: 8Gb

    • CPU: 1 Core

    • Network: — NAT, подсеть 10.0.2.0, без DHCP, шлюз 10.0.2.1

  • Debian 11.4

Необходимо установить:

  1. TFTP

  2. Samba

  3. Apache2

  4. DHCP

1.1. TFTP

Используется для загрузчиков и ipxe скриптов:

apt install tftpd-hpa

Вношу изменения в /etc/default/tftpd-hpa:

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp" # путь к папке tftp
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure -l -vvv -r blksize -m /etc/tftpd.remap"

Замена слешей Windows на Linux /etc/tftpd.remap:

rg \\ /

Оглавление Начало раздела

1.2. Samba

Используется для установки Windows-образов, в процессе монтируя папку образа, как диск:

apt install samba

В конце /etc/samba/smb.conf добавил:

[images]
comment = images
path = /srv/tftp/images
create mask = 0600
directory mask = 0700
guest ok = yes
browseable = yes
locking = no

Создал папку, выдал права, перезапустил samba:

mkdir /srv/tftp/images
chmod 700 /srv/tftp/images
service smbd restart

Оглавление Начало раздела

1.3. Apache2

Используется для загрузки образа WinPE, Linux и прочих данных по протоколу HTTP (быстрее TFTP):

apt install apache2

Настройки на стенде по умолчанию, в папке /var/www/html/ создаю директории:

  • /images/ — для папок ОС

  • /photo/ — для фонов меню, но не обязательно

mkdir -p /var/www/html/images/photo

Оглавление Начало раздела

1.4. DHCP-сервер

Выдает IP адреса в сети. Для настройки iPXE на Windows Server лучше обратиться к документации.

apt install isc-dhcp-server

Задаю статический IP адрес для стенда.

/etc/network/interfaces:

allow-hotplug ens0s3
iface ens33 inet static
address 10.0.2.5
netmask 255.255.255.0
broadcast 10.0.2.255
network 10.0.2.0
gateway 10.0.2.1

Назначаю интерфейс для прослушивания запросов.

/etc/default/isc-dhcp-server:

INTERFACESv4="enp0s3"

Формирую DHCP подсеть и добавляю ключи для загрузки с iPXE.

/etc/dhcp/dhcpd.conf:

option domain-name "local.loc";
option domain-name-servers 10.0.2.1;
# Переменная для определения архитектуры клиента:
option arch code 93 = unsigned integer 16;
# Объявляю пространство имен для ipxe
option space ipxe;
option ipxe.no-pxedhcp code 176 = unsigned integer 8;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
# Возможность получать клиентам IP-адреса
authoritative;
# Выделение подсети
subnet 10.0.2.0 netmask 255.255.255.0 {
range 10.0.2.100 10.0.2.200;
option domain-name-servers 10.0.2.1;
option domain-name "local.loc";
option routers 10.0.2.1;
option broadcast-address 10.0.2.255;
default-lease-time 600;
max-lease-time 7200;
}
# Отключение задержки в iPXE ожидания прокси DHCP.
# Экономит пару секунд.
option ipxe.no-pxedhcp = 1;
# Используя ранее установленную переменную,
# в зависимости от режима загрузки клиента,
# идет выбор, какой загрузчик отправить клиенту:
if option arch != 00:00 {
filename "ipxe.efi";
} else {
filename "undionly.kpxe";
}
# Установка корневой директории с загрузчиками и конфигурациями
next-server 10.0.2.5;
option tftp-server-name "10.0.2.5";
option root-path "tftp://10.0.2.5:/srv/tftp/";

На всякий случай проверяю синтаксис конфигурации на ошибки:

dhcpd -t -cf /etc/dhcp/dhcpd.conf

Если всё хорошо, указания ошибок в выводе не будет:

Internet Systems Consortium DHCP Server 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcp/dhcpd.conf
Database file: /var/lib/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid

Документация:

  1. Настройка DHCP для PXE

  2. Отдача нужного загрузчика, в зависимости от режима загрузки — Legacy/UEFI

  3. Список кодов DHCP сервера

Оглавление Начало раздела

2. Сборка загрузчиков iPXE

В данном разделе будет:

  1. Загрузка пакетов

  2. Скрипт стартовой настройки

  3. Сборка загрузчиков

Оглавление

2.1. Загрузка пакетов

После настройки и проверки стенда, необходимо собрать из исходного кода загрузчики iPXE для режимов Legacy и UEFI.

Обязательно потребуется установить зависимости:

  • gcc

  • binutils

  • make

  • perl

  • liblzma или xz header files

  • mtools

apt install gcc binutils make perl liblzma-dev mtools git

Скачиваю архив кода iPXE, либо клонирую репозиторий. Захожу во внутрь:

git clone git://git.ipxe.org/ipxe.git
cd ipxe/src/

Большинство возможностей iPXE по умолчанию закомментировано и при сборке бинарников, будет недоступно. Полный перечень функций указан тут, перебирая разделы можно выбрать, что нужно и где включить.

В текущем случае нужно:

  • в файле config/gereral.h раскомментировать строки с CONSOLE_CMD, IMAGE_PNG для команд консоли и png картинок.

  • в файле config/console.h раскомментировать строку с CONSOLE_FRAMEBUFFER, тоже для картинок.

Оглавление Начало раздела

2.2. Скрипт стартовой настройки

После загрузки iPXE от DHCP появится приглашение командной строки iPXE. Дальше нужно будет получить ip и начать загрузку скрипта меню. Чтобы этого не делать вручную, можно встроить базовый скрипт в сам бинарник.

Создаю скрипт start.ipxe (имя значения не имеет). Перечень, возможных команд.

#!ipxe
:start
# Механизм получения ip. В случае ошибки - предлагает нажать "s" для запуска командной строки.
# Иначе - начать снова.
dhcp && goto next || prompt --key s --timeout 1500 Press "s" for the iPXE command line... && shell || goto start
:next
# Случае успеха - загрузить "меню" с tftp-сервера (о нём - позже).
chain tftp://10.0.2.5/boot.ipxe

Оглавление Начало раздела

2.3. Сборка загрузчиков

Внимание! Строка имени файла является и его целевой конфигурацией, т.е. какое имя будет выбрано, для той платформы и будет сборка. В ключе EMBED= указывается имя ранее созданного скрипта.

Так же в случае ошибок при сборке, необходимо добавить ключ -fno-pie в Makefile.housekeeping на 451 строке. Предполагается, что это из-за ошибок в gcc.

make bin-i386-efi/ipxe.efi EMBED=start.ipxe
make bin-i386-pcbios/undionly.kpxe EMBED=start.ipxe

Копирую полученные загрузчики в папку tftp PXE сервера

cp bin-i386-efi/ipxe.efi /srv/tftp/
cp bin-i386-pcbios/undionly.kpxe /srv/tftp/

Оглавление Начало раздела

3. Написание меню загрузки

Оглавление

Ранее, в загрузчики был встроен скрипт, который в случае успешного получения ip, загружал и запускал скрипт boot.ipxe.

Создаю его по пути /srv/tftp/boot.ipxe:

#!ipxe
# Глобальные параметры
set pass pAsWoRd                    # Установка пароля на вход в iPXE
set httpServer http://10.0.2.5:80 # Задание адреса HTTP сервера
set menu-timeout 10000 # таймаут выхода из меню
#############################

########## Графика ##########

# Меняю цвет фона на серый
colour --rgb 0x999999 6

# Цвет по-умолчанию (индекс 0)
# Буквы - черный, фон букв - прозрачный
cpair -f 0 -b 4 0

# Фоновое изображение и рамка
# ${platform} - переменная iPXE, определяет в каком режиме загружен клиент- pcbios или efi
# Задаю параметры окна, картинку фона (загрузив её по http)
console -l 32 -r 32 -t 32 -b 32 -k --x 1024 --y 768 -d 24 -p  ${httpServer}/images/photo/${platform}.png

# После установки фона, удаляю картинку из памяти -
# иначе она ломает wimboot загрузку WinPE
imgfree ${platform}.png
#########################

:login
# Запрашивается пароль. Если будет нажат Ctrl+C или Esc будет выход и загрузка с диска
# В идеале, можно использовать для авторизации в сервисах, но в данном случае играет роль заглушки
login || goto cancel

#Если пароль верен, перейти "дальше"-к меню загрузок, иначе - таймаут 5 секунд и повторный запрос пароля
iseq ${password} ${pass} && goto next || goto error_pass

:error_pass
echo Error password. Repeat after 5 seconds
sleep 5
goto login

:cancel
echo You change "Exit". Boot from disk...
sleep 1
exit

# Переход к файлу с меню
:next
chain --replace --autofree menu.ipxe

По пути /var/www/html/images/photo/ кладу подготовленные pcbios.png и efi.png размера 1024х768. В зависимости от того, в каком режиме запустится ПК, у меня всегда будет подсказка на самом фоне меню:

картинки меню

Cоздаю меню загружаемых ОС и утилит.

/srv/tftp/menu.ipxe

#!ipxe
# После предыдущего скрипта, настройки остаются прежними,
# потому переопределяю их, чтобы было видно текст

######## Графика ########

# Цвет по-умолчанию (индекс 0)
# Буквы - черный, фон-прозрачный
cpair -f 0 -b 4 0

# Нормальный текст (индекс 1)
# Буквы - черный, фон - прозрачный
cpair -f 0 -b 4 1

# Разделители (индекс 3)
# Буквы - красный, фон - прозрачный
cpair -f 1 -b 4 3

#########################

######## Главное меню ########

# На данный момент "всё в одном", но можно разделить как по разным меню, так и по разным файлам
:start

# Составляю меню
# https://ipxe.org/cmd/menu
menu iPXE boot menu
item -k e exit (E)xit and boot from disk
item
item --gap -- -------- Windows Images --------
item -k a win10manager2021 Windows 10 M(a)nager 2021
item
item --gap -- -------- Debian Images --------
item debian11 Debian 11 Bullseye
item
item --gap -- -------- Acronis Images --------
item acronis2021x64 Acronis 2021 64-bit
item

# Для режима Legacy, добавляю утилиты использующие Memdisk
iseq ${platform} pcbios &amp;&amp; item --gap -- -------- BIOS Utilites -------- ||
iseq ${platform} pcbios &amp;&amp; item memtest Memtest86+ (v5.31) ||
iseq ${platform} pcbios &amp;&amp; item mhdd Mhdd (v4.6) ||
iseq ${platform} pcbios &amp;&amp; item hddtolls HDDtools ||
iseq ${platform} pcbios &amp;&amp; item victory Victory ||
iseq ${platform} pcbios &amp;&amp; item diskGenius DiskGenius (disk diagnostics) ||
iseq ${platform} pcbios &amp;&amp; item ||

item --gap -- -------- iPXE Utilites --------
item -k c config Start interactive (c)onfiguration tool
item -k s shell Start (S)hell iPXE

choose -d exit -t ${menu-timeout} selected
goto ${selected}

########
# Пункты меню
# В среднем состоят из трёх пунктов:
# kernel - передаю ядро linux и аргументы для запуска
# initrd - пакет данных для ядра
# boot - команда передачи управления ядру linux

########
:debian11
# В данном случае, в kernel передаётся ссылка linux ядра на http-сервере и аргументы запуска
kernel ${httpServer}/images/bullseye/install.amd/linux auto=true priority=high vga=788 url=${httpServer}/images/bullseye_2/install.amd/pxe_general_${platform}_preseed.cfg netcfg/dhcp_failed=note netcfg/dhcp_options="Retry network autoconfiguration" netcfg/get_domain=  --- quiet initrd=initrd.gz

# так же, ссылкой на http, передается пакет данных для ядра
initrd ${httpServer}/images/bullseye/install.amd/initrd.gz

# команда передачи управления ядру linux и в случае ошибки - переход к обоку обработки ошибок
boot || goto error
goto start

# Разбор файлов для linux - будет ниже
:win10manager2021
# wimboot - загрузчик .wim файлов установщика Windows, который сам патчит BCD, запускает установку и подтягивает скрипты запуска
# https://ipxe.org/wimboot
kernel wimboot
###########################################
# Неизменный блок для любого образа Windows
###########################################
initrd ${httpServer}/images/winpe/Boot/BCD BCD           # Стандартный BCD WinPE
initrd ${httpServer}/images/winpe/Boot/boot.sdi boot.sdi # Стандартный boot.sdi WinPE
initrd ${httpServer}/images/winpe/boot.wim boot.wim      # Стандартный boot.wim
initrd configWPE/winpeshl.ini winpeshl.ini               # Конфиг запускающий скрипт установки.
###########################################

# Изменяемые данные в зависимости от образа
initrd configWPE/win10manager2021/install.bat install.bat   # Скрипт установки образа
boot || goto error

goto start
#############################
# Утилиты загружаемые с iPXE
#############################
# Acronis images

:acronis2021x64
kernel ${httpServer}/images/utils/acr2021/dat10.dat initrd=dat11.dat initrd=dat12.dat vga=vesa MBRCRCS force_modules=usbhid quiet
initrd ${httpServer}/images/utils/acr2021/dat11.dat
initrd ${httpServer}/images/utils/acr2021/dat12.dat
boot || goto error
goto start
# Утилиты загружаются через Memdisk и доступны только для BIOS режима

:memtest
kernel memdisk || goto error
initrd ${httpServer}/images/utils/memtest86+-5.31b.iso || goto error
imgargs memdisk iso raw || goto error
boot || goto error
goto start

:victory
kernel memdisk || goto error
initrd ${httpServer}/images/utils/vcr35r.iso || goto error
imgargs memdisk iso raw || goto error
boot || goto error
goto start

:mhdd
kernel memdisk || goto error
initrd ${httpServer}/images/utils/mhdd32ver4.6.iso || goto error
imgargs memdisk iso raw || goto error
boot || goto error
goto start

:hddtools
kernel memdisk || goto error
initrd ${httpServer}/images/utils/hddtools.iso || goto error
imgargs memdisk iso raw || goto error
boot || goto error
goto start

:diskGenius
kernel memdisk || goto error
initrd ${httpServer}/images/utils/DiskGenius.iso || goto error
imgargs memdisk iso raw || goto error
boot || goto error
goto start

# Интерактивное меню редактирования конфигурация iPXE и сетевой карты
:config
config
goto start

# Командная строка iPXE
:shell
shell
goto start

:exit
echo Boot from disk...
sleep 2
exit

# При ошибках выход на командную строку
:error
echo Failed - have error
sleep 1
goto shell
##############################

Оглавление Начало раздела

4. Добавление образов Linux, Windows, утилит

После написания меню, необходимо подготовить загрузчики и пакеты загружаемых систем.

Разберу примеры:

  1. Linux

  2. Windows

  3. Утилиты

Оглавление

4.1. Добавление Linux

На стенде создаю папки:

mkdir -p /var/www/html/images/bullseye/install.amd # Для загрузчика, файлов ответа
mkdir -p /var/www/html/images/bullseye/postinstall # Для скриптов и пакетов пост-установки. Скачиваться будут благодаря команде в файле ответов
cd /var/www/html/images/bullseye/install.amd/

Скачиваю ядро и пакет данных linux:

wget http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux
wget http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz

Скачиваю драйвера и встраиваю их в пакет ядра:

[ -f initrd.gz.orig ] || cp -p initrd.gz initrd.gz.orig
[ -f firmware.cpio.gz ] || wget http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/stable/current/firmware.cpio.gz
cat initrd.gz.orig firmware.cpio.gz > initrd.gz

Создаю 2 файла ответов для debian-installer:

  • pxe_efi_preseed.cfg с разметкой диска под UEFI

  • pxe_pcbios_preseed.cfg с разметкой диска под Legacy

Кладу их по пути /var/www/html/bullseye/install.amd/:

[drwxr-xr-x 4.0K]  bullseye
├── [drwxr-xr-x 4.0K]  install.amd
│   ├── [-rw-r--r-- 138M]  initrd.gz
│   ├── [-rw-r--r-- 6.5M]  linux
│   ├── [-rw-r--r--  15K]  pxe_efi_preseed.cfg
│   └── [-rw-r--r--  15K]  pxe_pcbios_preseed.cfg
└──[drwxr-xr-x 4.0K]  postinstall

Если сейчас попытаться загрузить linux, то все получится

Оглавление Начало раздела

4.2 Добавление Windows

Установки Windows через PXE как тачка на прокачку:

  • Запускаем PXE ->

  • Передаём управление iPXE ->

  • Передаём управление wimboot ->

  • Передаем управление WinPE ->

  • Устанавливаем Windows

Оглавление

Но по порядку.

  1. Для установки Windows понадобится wimboot — загрузчик для wim образов. Умеет патчить BCD, работать с HTTP, переиспользовать память и т.д.

Скачиваю последнюю стабильную версию и кладу рядом с другими загрузчиками /srv/tftp/wimboot

  1. Следом понадобится чистый WinPE, а именно его

    • winpe/media/Boot/BCD

    • winpe/media/Boot/boot.sdi

    • winpe/media/sources/boot.wim

Для использования его как «оболочки» для запуска установки Windows.

Их необходимо будет распаковать в /var/www/html/images/winpe/

  1. В каталог /srv/tftp/images/win10setup/ распаковываю образ установочного диска Windows и создаю там каталог wims — в неё будут складываться пакеты .wim образов и файлы ответов.

  2. В неё кладу заранее подготовленные:

    • win10manager2021.wim — пакет корпоративного образа

    • autounattend_bios_manager.xml и autounattend_efi_manager.xml — файлы ответов к нему для UEFI и Legacy режимов.

  3. Создаю каталоги:

    • /srv/tftp/configWPE/ — для складывания в него настроек для разных образов (по аналогии с Bullseye)

    • /srv/tftp/configWPE/win10manager2021/ — для непосредственно скрипта установки

  4. Создаю файл /srv/tftp/configWPE/winpeshl.ini — конфигурация, которая передаваемая ядру и которая указывает, какой скрипт выполнить при запуске:

[LaunchApps]
"install.bat"
  1. Создаю сам файл:

/srv/tftp/configWPE/win10manager2021/install.bat

@echo off
echo wpeinit start

:: Инициализация среды WinPE
wpeinit

:: Задержка для гарантированного запуска сетевой карты и получение IP
echo We are waiting for 15 seconds for the network card to start
ping -4 -n 15 -w 1000 "">nul
ipconfig /renew

echo
echo wait 5 second pre-mount share folder with distr
ping -4 -n 5 1000 "">nul

::Монтирование каталога с установщиком Windows
net use Y: \10.0.2.5\images\win10setup /user:anonymous anonymous

:: Получение информации, в каком режиме запущен пк - UEFI или Legacy
echo check boot-mode
wpeutil UpdateBootInfo
for /f "tokens=2* delims=        " %%A in ('reg query HKLM\System\CurrentControlSet\Control /v PEFirmwareType') DO SET Firmware=%%B

:: В зависимости от режима выше - выбор нужного образа установки и файла ответов
echo start Setup win10
if %Firmware%==0x1 Y:\sources\setup.exe /unattend:Y:\wims\autounattend_bios_manager.xml /installfrom:Y:\wims\win10manager2021.wim
if %Firmware%==0x2 Y:\sources\setup.exe /unattend:Y:\wims\autounattend_efi_manager.xml /installfrom:Y:\wims\win10manager2021.wim
cmd.exe

При проверке установка успешно запускается (с ошибкой в конце, что на VM мало места, но не суть):

Картинка

По итогу получается:

Дерево каталогов

# Web-сервер
images
├── bullseye         # Файлы образа Linux
│   ├── install.amd/ # Ядро и файлы ответов
│   └── postinstall/ # Скрипты и пакеты для пост-установки
├── photo            # Необязательный каталог для фонов меню
│   ├── efi.png
│   └── pcbios.png
└── winpe            # Файлы для запуска WinPE
    ├── BCD
    ├── boot.sdi
    └── boot.wim
# Tftp/Samba-серва
tftp
├── boot.ipxe            # Установка переменных среды iPXE
├── configWPE            # Хранилище конфигураций образов Windows
│   ├── win10manager2021
│   │   └── install.bat  # Скрипт запуска установки, где меняются samba пути
│   └── winpeshl.ini     # Общая для всех конфигурация, запускающая скрипт установки
├── images
│   └── win10setup       # Каталог стандартного установочного диска Windows
│       ├── autorun.inf
│       ├── boot/
│       ├── bootmgr/
│       ├── bootmgr.efi
│       ├── efi/
│       ├── setup.exe
│       ├── sources/
│       ├── support/
│       └── wims/        # Пакеты *.wim и файлы ответов
│           ├── autounattend_bios_manager.xml
│           ├── autounattend_efi_manager.xml
│           └── win10manager2021.wim
├── ipxe.efi             # Загрузчик для UEFI
├── menu.ipxe            # Меню iPXE
├── undionly.kpxe        # Загрузчик для Legacy
└── wimboot              # Загрузчик для Windows

Оглавление Начало раздела

4.3 Утилиты

Для них на Web-сервере создал подкаталог /var/www/html/images/utils/ и складываю либо *.iso образы для запуска через Memdisk, либо передавая в качестве ядра соответствующие файлы (например Acronis)

Оглавление Начало раздела

5. Итог

По итогу получилась система с минимальным количеством файлов для заливки и добавления:

  • 3 загрузчика (Legacy,UEFI,Windows)

  • 3 файл WinPE для Windows

  • По 2-3 файла непосредственно образа

  • По 2 файла ответов на образ

  • По 1 скрипту пост-/установки на образ

  • Простое меню. Если убрать графику, парольную заглушку и оставить TUI — станет еще меньше.

  • Возможность работать с HTTP (…, iSCSI SAN, AoE SAN и т.д.), что ускоряет загрузку.

Оглавление

Ожидаю вашего мнения в комментариях

P.S. Первая статья и тонна мучений с редактором.

  • Использую Firefox, при нажатии на «/» в большинстве случаев ничего не появляется, либо стало появляться только после отключения всех AdBlock-еров.

  • Предпросмотра для ссылок нет — перепроверить ссылки внутри статьи не могу

  • В плане оформления помог плагин Unotes который конвертировал мой markdown в WYSIWYG, но потом вносил коррективы. Если что-то не будет работать — буду исправлять по мере обнаружения.

Если эта публикация вас вдохновила и вы хотите поддержать автора — не стесняйтесь нажать на кнопку

Table of Contents

Network-booting Windows PE

Windows PE (WinPE) is the Windows Preinstallation Environment, used for installation and repair of Windows computers.

Using iPXE and wimboot, you can boot into Windows PE via HTTP. You can then connect to a standard Windows file server to install a full version of Windows to the local hard disk (or to an iSCSI target).

Booting Windows PE via HTTP is much faster than using traditional TFTP-based methods such as Windows Deployment Services (WDS). On a Gigabit Ethernet network, it should take less than two seconds to download a typical 200MB Windows PE image.

Setting up Windows PE

Windows PE is available as part of the Windows Assessment and Deployment Toolkit (ADK) for current versions of Windows, or as part of the Windows Automated Installation Kit (AIK) for earlier versions of Windows.

Windows Assessment and Deployment Toolkit (ADK)

The Windows Assessment and Deployment Toolkit (ADK) is compatible with Windows Server 2012, Windows 8, Windows 7, Windows Server 2008, and Vista.

Download and install the ADK onto a working Windows system (the “technician computer”).

From the Start menu, choose All ProgramsWindows KitsWindows ADKDeployment and Imaging Tools Environment. This should open a command prompt window. Create 32-bit and 64-bit versions of Windows PE:

  mkdir C:\temp\winpe
  copype x86 C:\temp\winpe\x86
  copype amd64 C:\temp\winpe\amd64

Copy the contents of C:\temp\winpe to a directory on your web server (e.g. /var/www/winpe for Apache, or C:\inetpub\wwwroot\winpe for IIS).

Download the latest version of wimboot and save it to the same directory on your web server.

Create a text file boot.ipxe in the same directory on your web server, containing:

  #!ipxe
  
  cpuid --ext 29 && set arch amd64 || set arch x86
  kernel wimboot
  initrd ${arch}/media/sources/boot.wim  boot.wim
  boot

Windows Automated Installation Kit (AIK)

The Windows Automated Installation Kit (AIK) is compatible with Windows 7, Windows Server 2008, Vista, and Windows Server 2003.

Download and install the AIK onto a working Windows system (the “technician computer”).

From the Start menu, choose All ProgramsMicrosoft Windows AIKDeployment Tools Command Prompt. This should open a command prompt window. Create 32-bit and 64-bit versions of Windows PE:

  mkdir C:\temp\winpe
  copype x86 C:\temp\winpe\x86
  copype amd64 C:\temp\winpe\amd64

Copy the contents of C:\temp\winpe to a directory on your web server (e.g. /var/www/winpe for Apache, or C:\inetpub\wwwroot\winpe for IIS).

Download the latest version of wimboot and save it to the same directory on your web server.

Create a text file boot.ipxe in the same directory on your web server, containing:

  #!ipxe
  
  cpuid --ext 29 && set arch amd64 || set arch x86
  kernel wimboot
  initrd ${arch}/ISO/boot/bcd          BCD
  initrd ${arch}/ISO/boot/boot.sdi     boot.sdi
  initrd -n boot.wim ${arch}/winpe.wim boot.wim
  boot

Booting Windows PE

Boot using iPXE from the URI of your boot.ipxe script, e.g. http://my.web.server/winpe/boot.ipxe. You should see iPXE download and boot Windows PE via HTTP:

Windows PE booting

Windows PE booted

Installing Windows

You can now connect to a Windows (or Samba) file server to run the Windows installer. For example, if you have copied the contents of your Windows installation DVD-ROM to \\myserver\installers\win8, then you can start the installer using:

  net use \\myserver\installers
  \\myserver\installers\win8\setup.exe

Windows PE running Windows 8 installer

Advanced topics

Adding a startup batch file

You can customise your Windows PE image so that it automatically connects to a file server and runs the Windows installer.

Create a text file install.bat containing the commands needed to connect to your file server and start the installer:

  wpeinit
  net use \\myserver\installers
  \\myserver\installers\win8\setup.exe

Create a text file winpeshl.ini instructing Windows PE to run your install.bat file:

  [LaunchApps]
  "install.bat"

Copy install.bat and winpeshl.ini to your web server and edit your boot.ipxe script to load these files:

  #!ipxe
  
  cpuid --ext 29 && set arch amd64 || set arch x86
  kernel wimboot
  initrd install.bat                                install.bat
  initrd winpeshl.ini                               winpeshl.ini
  initrd ${arch}/media/Boot/BCD                     BCD
  initrd ${arch}/media/Boot/boot.sdi                boot.sdi
  initrd ${arch}/media/sources/boot.wim             boot.wim
  boot

When you boot into Windows PE, it should now automatically connect to your file server and run the Windows installer.

Adding a network card driver

You can customise your Windows PE image to include drivers for your network card, if your card is not already supported by Windows PE. You will need the ImageX and DISM tools, which are part of the Windows ADK (or AIK). A Linux version of imagex is also available as part of the wimlib package.

Download the drivers for your network card, and extract the driver to C:\temp\winpe\drivers. If you are using the ADK then you will need to download a driver compatible with Windows 8; if you are using the AIK then you will need a driver compatible with Windows 7.

Use ImageX and DISM to add this driver to your Windows PE image:

  imagex /mountrw C:\temp\winpe\amd64\media\sources\boot.wim 1 C:\temp\winpe\amd64\mount
  dism /image:C:\temp\winpe\amd64\mount /add-driver /driver:c:\temp\winpe\drivers /recurse
  imagex /unmount /commit C:\temp\winpe\amd64\mount

Installing to an iSCSI target

You can use your Windows PE image to install Windows to an iSCSI target. Create a text file install.ipxe containing:

  #!ipxe
  
  prompt -k 0x197e -t 2000 Press F12 to install Windows... || exit
  chain boot.ipxe

and copy it to the directory on your web server containing your boot.ipxe script.

Configure your DHCP server to provide the URI of your install.ipxe script as the boot filename, and the SAN URI of your iSCSI target as the root-path. If your iSCSI target uses access control lists (ACLs), then you may also need to provide the correct initiator-iqn.

You should see the diskless computer connect to the iSCSI target and then prompt you to ”Press F12 to install Windows”:

WinPE installation prompt

Press F12 to begin the installation process. If you have already added a startup batch file as described above, then the Windows installer will start automatically. If not, then connect to your file server and run the Windows installer manually.

Proceed to install Windows as usual. When you reach the ”Where do you want to install Windows?” screen, you should see the iSCSI disk appear as a possible install location:

WinPE iSCSI installation disk

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • This can happen if layout contains custom windows
  • Как запустить op com на windows 10
  • Ваш windows заблокирован вирус
  • Кодировка командной строки windows 10
  • Angry birds go для windows phone