pxelinux_IT怪胎:如何使用PXElinux v5和Wimboot网络引导(PXE)WinPE恢复磁盘

pxelinux

pxelinux

65666352_efaebd0345_o1

Have you ever wished you could get the “Windows Recovery Console” running for that one maintenance procedure or program you want to use, without having to remember where you’ve forgotten the CD? HTG explains how to boot WinPE from PXE.

您是否曾经希望可以为要使用的一个维护过程或程序运行“ Windows恢复控制台”,而不必记住忘记CD的位置? HTG解释了如何从PXE引导WinPE。

Photo Credit: Alfred Hermida via Compfight cc

图片来源: Alfred Hermida通过Compfight cc

Windows Pre-execution environment (WinPE) is the version of windows that most people know as the one that boots off of the install CD. Over the years, entire projects have been created to give one the ability to have a sort of “Windows Live” environment like many Linux distros. In this guide, we will have the windows PE from the install CD boot from PXE just so we can use it to run the Dell BIOS update utility. You are encouraged to continue the exploration of this bottomless pit of geek goodness…

Windows预执行环境(WinPE)是大多数人都知道的Windows版本,它是从安装CD引导的版本。 多年来,已经创建了整个项目,以使人们能够像许多Linux发行版一样拥有一种“ Windows Live ”环境。 在本指南中,我们将从PXE的安装CD引导中获取Windows PE,以便我们可以使用它来运行Dell BIOS更新实用程序。 我们鼓励您继续探索这个极客善良的无底洞。

总览 (Overview)

We’ve shown you what PXE is and how you can easily install a server for it (and much more) with FOG, today we will be adding yet another extension to FOG. Generally today’s procedure will be:

我们已经向您展示了什么是PXE,以及如何使用FOG轻松地为其安装服务器(以及更多) ,今天我们将为FOG添加另一个扩展。 通常,今天的过程将是:

  1. Update PXElinux to v5.01 or higher, if not already installed.

    如果尚未安装,请将PXElinux更新到v5.01或更高版本。

  2. Add the wimboot module.

    添加wimboot模块。
  3. Copy the WIM image and supporting files from the windows install CD.

    从Windows安装CD复制WIM映像和支持文件。
  4. Add the menu entry.

    添加菜单项。
  5. Use the booted WinPE to get a working “Windows recovery console”.

    使用启动的WinPE获得有效的“ Windows恢复控制台”。

We are going to do the above, because going the “regular” Windows Automated Installation Kit (WAIK) way forces you, at best, to install it on your machine and go through a not so straightforward process to mangle the WIM file and its support files into their WDS/RIS form. While Linux alternatives do exists, like the UDA project’s one (which is the PXE server I used before FOG came along), using this way you simply replace some files on the PXE server once (which you probably would have eventually anyhow) and copy the unaltered WIM file and support files directly from the Windows CD into the PXE server.

我们将执行上述操作,因为采用“常规” Windows自动安装工具包(WAIK)的方式最多只能迫使您将其安装在计算机上,并经过一个不太简单的过程来处理WIM文件及其支持文件放入其WDS / RIS表单中。 尽管确实存在Linux替代方案,例如UDA项目的替代方案(这是我在FOG出现之前使用的PXE服务器),但是使用这种方式,您只需替换一次PXE服务器上的某些文件(您可能最终将无论如何都可以)并复制直接从Windows CD到PXE服务器的WIM文件和支持文件保持不变。

The one thing to note, is that while it will look like you can start the windows install procedure this way, you actually can’t complete it, and making that possible is beyond the scope of this guide.

需要注意的一件事是,虽然看起来您可以通过这种方式启动Windows安装过程,但实际上无法完成该过程,并且使之成为可能超出了本指南的范围。

Lets get cracking :)

让我们开始吧:)

将PXElinux更新到V5.01 (Update PXElinux to V5.01)

As of the time of this writing, the version of Syslinux in the Ubuntu repository is still 4.05. I’m guessing this is because the Syslinux team decided to shake things up with the V5 branch and have changed the way their COM32 modules work (now based on ELF) and changed the “core” to require a library (ldlinux.c32) for anything beyond “pure boot”. This makes it very possible to encounter breakage, for anyone who’s used to the “old way”. Don’t fret,  we will download the required files manually and make it so your FOG installation doesn’t loose a beat.

在撰写本文时,Ubuntu存储库中的Syslinux版本仍为4.05。 我猜这是因为Syslinux团队决定通过V5分支来改变现状,并更改了其COM32模块的工作方式(现在基于ELF),并且更改了“核心”,要求使用一个库(ldlinux.c32) 任何超越“纯粹的引导”。 对于那些习惯了“旧方式”的人来说,这很有可能会遇到破损。 不用担心,我们将手动下载所需的文件并进行安装,以使您的FOG安装不会动摇。

We will be using version 5.01 as it is the latest stable release from the V5 branch at the time of this writing and it is the one on which the Syslinux team worked together with the wimboot team to make this specific procedure work.

我们将使用版本5.01,因为它是撰写本文时来自V5分支的最新稳定版本,并且它是Syslinux团队与wimboot团队合作使这一特定过程正常工作的版本。

Note: Another reason that the latest version isn’t part of the Ubuntu repository yet (IMHO), is that at least on Citrix-Xen, the HVM guests can’t boot anything beyond the PXE menus. Other hypervisors like VMware, Hyper-V & VirtualBox, as well as physical machines are just fine with the new version.

注意 :最新版本尚未成为Ubuntu存储库(IMHO)的一部分的另一个原因是,至少在Citrix-Xen上,HVM guest虚拟机无法启动PXE菜单之外的任何内容 。 其他版本的虚拟机管理程序(如VMware,Hyper-V和VirtualBox)以及物理机都可以很好地适应新版本。

If the note above doesn’t affect you, proceed.

如果以上说明对您没有影响,请继续。

Obtain  version 5.01 of PXElinux directly from Kernel.org and extract it on the FOG server by:

直接从Kernel.org获得PXElinux 5.01版,并通过以下方式将其压缩到FOG服务器上:

wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-5.01.tar.bz2
tar xvhf syslinux-5.01.tar.bz2

wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-5.01.tar.bz2
tar xvhf syslinux-5.01.tar.bz2

Create the directory that will hold the newly required libraries:

创建将包含新需要的库的目录:

mkdir -p /tftpboot/howtogeek/libs

mkdir -p /tftpboot/howtogeek/libs

Copy the required library files to this directory, so they will be available for the clients at runtime:

将所需的库文件复制到此目录,以便它们在运行时可供客户端使用:

cp -av syslinux-5.01/com32/lib/libcom32.c32 /tftpboot/howtogeek/libs/
cp -av syslinux-5.01/com32/libutil/libutil.c32 /tftpboot/howtogeek/libs/
cp -av syslinux-5.01/com32/modules/linux.c32 /tftpboot/howtogeek/libs/

cp -av syslinux-5.01/com32/lib/libcom32.c32 /tftpboot/howtogeek/libs/
cp -av syslinux-5.01/com32/libutil/libutil.c32 /tftpboot/howtogeek/libs/
cp -av syslinux-5.01/com32/modules/linux.c32 /tftpboot/howtogeek/libs/

Append the “path” to this directory, to the already existing “default” configuration file, by either editing it or issuing the below:

通过编辑或发出以下命令,将该目录的“路径”追加到已存在的“默认”配置文件中:

echo "PATH howtogeek/libs" >> /tftpboot/pxelinux.cfg/default

echo "PATH howtogeek/libs" >> /tftpboot/pxelinux.cfg/default

Copy the newly required ldlinux.c32 to the root of the TFTP server by issuing:

通过发出以下命令,将新需要的ldlinux.c32复制到TFTP服务器的根目录:

cp -av syslinux-5.01/com32/elflink/ldlinux/ldlinux.c32 /tftpboot/

cp -av syslinux-5.01/com32/elflink/ldlinux/ldlinux.c32 /tftpboot/

Update the graphical engine (vesamenu.c32) to correspond to this new version:

更新图形引擎(vesamenu.c32)以与此新版本相对应:

cp -av syslinux-5.01/com32/menu/vesamenu.c32 /tftpboot/

cp -av syslinux-5.01/com32/menu/vesamenu.c32 /tftpboot/

Congratulations, your PXE server is now updated to v5.01 and everything that was already working (unless you are affected by the “note” from the start of this segment) should continue to do so.

恭喜,您的PXE服务器现在已更新至v5.01,并且已经正常运行的所有功能(除非您从本节开始时受到“注释”的影响)应该继续这样做。

WIMboot (WIMboot)

This bootloader is part of the iPXE project and they describe it like so:

该引导程序是iPXE项目的一部分,他们对它的描述如下:

wimboot is a boot loader for Windows Imaging Format (.wim) files. It enables you to boot a Windows PE (WinPE) environment from a RAM disk, without wasting the memory used for the RAM disk image.

wimboot是Windows映像格式( .wim )文件的引导加载程序。 它使您可以从RAM磁盘启动Windows PE(WinPE)环境,而不会浪费用于RAM磁盘映像的内存。

Download the latest version from their site:

从他们的网站下载最新版本:

wget http://git.ipxe.org/releases/wimboot/wimboot-latest.zip

wget http://git.ipxe.org/releases/wimboot/wimboot-latest.zip

Install unzip on your FOG server if it is missing:

如果缺少,请在您的FOG服务器上安装解压缩文件:

aptitude install unzip

aptitude install unzip

Unzip the wimboot package:

解压缩wimboot软件包:

unzip wimboot-latest.zip

unzip wimboot-latest.zip

Copy the wimboot module to the “libs” directory we created in the previous segment:

将wimboot模块复制到我们在上一部分中创建的“ libs”目录中:

cp -va wimboot*/wimboot /tftpboot/howtogeek/libs/

cp -va wimboot*/wimboot /tftpboot/howtogeek/libs/

That is all. The wimboot bootloader is ready to be called upon.

就这些。 准备好调用wimboot引导加载程序。

Windows CD文件 (Windows CD files)

Create a new directory on the FOG server to hold the files we will copy over:

在FOG服务器上创建一个新目录,以保存我们将复制的文件:

mkdir -p /tftpboot/howtogeek/WinPE/

mkdir -p /tftpboot/howtogeek/WinPE/

Put the original Windows 7 install CD in your CDROM drive and copy the files listed below into this directory:

将原始的Windows 7安装CD放入CDROM驱动器中,并将下面列出的文件复制到此目录中:

\bootmgr

\ bootmgr

\boot\bcd

\ boot \ bcd

\boot\boot.sdi

\ boot \ boot.sdi

\sources\boot.wim

\ sources \ boot.wim

Yes, it is that simple and you don’t need to keep the directory structure on the CD for this to work.

是的,就是这么简单您无需在CD上保留目录结构即可工作。

Note: in order to have the Dell BIOS updates work, I’ve found it to be necessary to use a 32-bit version of Windows.

注意:为了使Dell BIOS更新正常工作,我发现有必要使用32位版本的Windows。

添加菜单项 (Add the menu entry)

Create the PXE menu entry by editing the “Utils” menu:

通过编辑“实用程序”菜单来创建PXE菜单项:

sudo vim /tftpboot/howtogeek/menus/utils.cfg

sudo vim /tftpboot/howtogeek/menus/utils.cfg

Append to it the following:

附加以下内容:

label WinPE
com32 linux.c32 howtogeek/libs/wimboot
APPEND wimboot initrdfile=/howtogeek/WinPE/bootmgr,/howtogeek/WinPE/bcd,/howtogeek/WinPE/boot.sdi,/howtogeek/WinPE/boot.wim

label WinPE
com32 linux.c32 howtogeek/libs/wimboot
APPEND wimboot initrdfile=/howtogeek/WinPE/bootmgr,/howtogeek/WinPE/bcd,/howtogeek/WinPE/boot.sdi,/howtogeek/WinPE/boot.wim

Congratulations, You now have WindowsPE on your PXE server. :)

恭喜,您现在在PXE服务器上安装了WindowsPE。 :)

Note: it may look like its hanging on the “wim” file, but it isn’t. It is actually transferring the 140MB of a file to the client over TFTP, which takes longer than the usually small files that are transferred this way.

注意:它看起来好像挂在“ wim”文件上,但事实并非如此。 实际上,它正在通过TFTP将文件的140MB传输到客户端,这比通过这种方式传输的通常较小的文件花费的时间更长。

Here is the screenshot to prove that it did happen.

这是截图证明它确实发生了。

WinPE01

The VM above, was run using VMware-player,  had Ubuntu installed on its HD and was PXE booted into WinPE.

上面的VM使用VMware播放器运行,并在其HD上安装了Ubuntu,并通过PXE引导到WinPE中。

Windows恢复控制台 (Windows Recovery Console)

Again, as mentioned in the overview, while it looks like you can start the windows install procedure this way, you actually can’t complete it, and making that possible is beyond the scope of this guide.

再次,如概述中所述,虽然看起来您可以通过这种方式启动Windows安装过程,但实际上无法完成该过程,并且使之成为可能超出了本指南的范围。

With that said, just to give one example of why this would be useful, we will use this environment to perform a Dell BIOS update.

话虽如此,仅举一个为什么这样做有用的示例,我们将使用此环境执行Dell BIOS更新。

Get the update you need to perform from Dell’s website and put it on a Disk-On-Key. Put the Disk on key and PXE boot the client.

从Dell网站获取您需要执行的更新,并将其放在Key-Disk-On-Key上。 将磁盘放在钥匙上,然后PXE引导客户端。

In order to reach the recovery console, in the main window as in the screenshot above, click “Next”.

为了访问故障恢复控制台,请在上面的屏幕快照中的主窗口中,单击“下一步”。

WinPE02

Click on “Repair your computer”.

点击“修复计算机”。

WinPE03

Choose “Use recovery tools” and click on “Next”.

选择“使用恢复工具”,然后单击“下一步”。

WinPE04

Click on “Command Prompt”.

点击“命令提示符”。

Once in the command prompt, you will have to find out what “drive letter” WinPE decided to designate to your Disk-on-Key. To do this, have the system enumerate all of the currently assigned drive-letters by issuing:

进入命令提示符后,您将必须找出WinPE决定指定给“密钥磁盘”的“驱动器号”。 为此,请让系统通过发出以下命令枚举所有当前分配的驱动器盘符:

wmic logicaldisk get name

wmic logicaldisk get name

Now excluding the letters A: and X: and perhaps even C: (though its not a given), cycle through the drive letters and look for the Disk-on-Key by issuing:

现在排除字母A:和X:甚至C :(尽管不是给定的),循环浏览驱动器字母,并通过发出以下命令查找“ Key on Disk”:

Driveletter:
dir

Driveletter:
dir

Once you’ve found the correct drive, execute the file and you should see something like the below:

找到正确的驱动器后,执行文件,您应该看到类似以下的内容:

winPE06

Congratulations, you are all set to upgrade :)

恭喜,您已经准备升级:)



I Know Kung Fu…

我知道功夫…

翻译自: https://www.howtogeek.com/162070/it-geek-how-to-network-boot-pxe-the-winpe-recovery-disk-with-pxelinux-v5-wimboot/

pxelinux

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值