使用 autounattend.xml 通过 Ventoy 引导加载程序自动安装 Windows

使用 autounattend.xml 通过 Ventoy 引导加载程序自动安装 Windows

在我工作的公司,我们偶尔需要构建服务器并将其出售给客户。此过程的一部分包括安装操作系统,过去我们使用过 Windows 10 Ent. IoT 和 Windows Server 2019。现在,随着 Windows 11 Ent. IoT 的发布,我们希望切换到此操作系统。

我目前有一个闪存驱动器,我将其用作 Ventoy 引导加载程序,用于存放多个 ISO(因为我们有时仍需要加载这些其他操作系统)。但是,以前我们只会将产品密钥嵌入 ISO,并被迫手动完成其余的安装过程。除了自动化驱动器分区和安装位置(我故意将其从应答文件中省略)之外,我还希望使用 autounattend 和/或 sysprep 来实现完全自动化的安装过程。

问题是,当使用 autounattend.xml 文件从 Ventoy 启动到该 ISO 时,它只会加载一个黑屏,其中有一个实心的控制台光标,持续几秒钟,然后返回到 Ventoy 菜单。这告诉我它没有识别出该 ISO 为可启动。除了将 autounattend.xml 文件添加到根目录外,我没有对 ISO 进行任何更改。我不确定这是因为它是 Windows 11,还是其他地方的问题。我在网上看到,据说你可以只对 ISO 使用 autounattend(例如,而不是使用 Rufus 之类的软件将 ISO 挂载到 USB 并将文件放在 USB 的根目录中)。在 WSIM 中,至少没有验证错误...无论如何,这是我的 autounattend 文件。出于显而易见的原因,我更改了用户信息和产品密钥。非常感谢任何帮助。

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
            xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>0409:00000409</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UILanguageFallback>en-US</UILanguageFallback>
            <UserLocale>en-US</UserLocale>
        </component>
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
            xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <TimeZone>Central Standard Time</TimeZone>
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <HideLocalAccountScreen>true</HideLocalAccountScreen>
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <NetworkLocation>Home</NetworkLocation>
                <ProtectYourPC>3</ProtectYourPC>
                <SkipMachineOOBE>true</SkipMachineOOBE>
                <SkipUserOOBE>true</SkipUserOOBE>
            </OOBE>
            <UserAccounts>
                <AdministratorPassword>
                    <PlainText>true</PlainText>
                    <Value></Value>
                </AdministratorPassword>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Group>Administrators</Group>
                        <Name>User</Name>
                        <Password>
                            <PlainText>true</PlainText>
                            <Value>Password</Value>
                        </Password>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
            xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Path>net accounts /maxpwage:unlimited</Path>
                    <WillReboot>Never</WillReboot>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Order>2</Order>
                    <Path>net user User /active:Yes</Path>
                    <WillReboot>Never</WillReboot>
                </RunSynchronousCommand>
            </RunSynchronous>
        </component>
        <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
            xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SkipAutoActivation>true</SkipAutoActivation>
        </component>
        <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
            xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <Identification>
                <JoinWorkgroup>WORKGROUP</JoinWorkgroup>
            </Identification>
        </component>
    </settings>
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
            xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>0409:00000409</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UILanguageFallback>en-US</UILanguageFallback>
            <UserLocale>en-US</UserLocale>
            <SetupUILanguage>
                <UILanguage>en-US</UILanguage>
            </SetupUILanguage>
        </component>
        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
            xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <Diagnostics>
                <OptIn>false</OptIn>
            </Diagnostics>
            <DynamicUpdate>
                <Enable>false</Enable>
                <WillShowUI>OnError</WillShowUI>
            </DynamicUpdate>
            <UserData>
                <AcceptEula>true</AcceptEula>
                <ProductKey>
                    <Key>omitted</Key>
                </ProductKey>
            </UserData>
        </component>
    </settings>
</unattend>

答案1

好吧,我找到了一个可行的解决方案,并且基本上回答了我自己的问题。

我深入研究了 Ventoy 的文档,发现它们支持无人值守安装(https://www.ventoy.net/en/plugin_autoinstall.html

与重新创建包含无人值守文件的新 ISO 不同,这仅涉及将 .xml 文件导入 ventoy.json 配置中指定的 USB 目录中,并将其与所需的 .iso 映像配对。非常简单,老实说,比标准方法容易得多,标准方法显然与 Ventoy 配合使用效果不佳。

相关内容