分类 drserver 下的文章

DCImanager 5 - Windows 2025 - UnattendEFI.xml

问题:setup.exe /Unattend:x:\temp\Unattend.xml 后,在约 60% 的进度条,弹框提示安装失败
过程:查看 Panther\setuperr.log 文件内容,有如:

2024-12-06 19:41:00, Error                            WpxXmlDocument::ReportError (onecore\base\ntsetup\wpx\core\xml.cpp:157) - 0xc00ce50d:
2024-12-06 19:41:00, Error                                Invalid XML (line 196, position 142): A semi colon character was expected.

2024-12-06 19:41:00, Error                            WpxXmlDocument::LoadXml (onecore\base\ntsetup\wpx\core\xml.cpp:266) - 0x8007000d:
2024-12-06 19:41:00, Error                                The given data cannot be parsed
2024-12-06 19:41:00, Error                            WpxGetAnswerFileType (onecore\base\ntsetup\wpx\file\getfiletype.cpp:54) - 0x8007000d:
2024-12-06 19:41:00, Error                                Couldn't parse answer file contents as XML

查看相应的 Unattend.xml 内容,是:

        <RunSynchronousCommand wcm:action="add">
          <Description>finish</Description>
          <Order>9</Order>
          <Path>cmd /c echo cmd /c %windir%\setup\scripts\wget.exe -O- "http://10.8.8.8/dcimgr?func=osinstall.finish&id=1wJj42
pYVdjzzB9" >> %windir%\setup\scripts\SetupComplete.cmd</Path>
          <WillReboot>OnRequest</WillReboot>
        </RunSynchronousCommand>

而 DCIM 的 UnattendEFI.xml 文件内容是:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        <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">
            <UserData>
                <AcceptEula>true</AcceptEula>
            </UserData>
            <DiskConfiguration>
                <WillShowUI>OnError</WillShowUI>
                <Disk wcm:action="add">
                    <CreatePartitions>
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Size>400</Size>
                            <Type>EFI</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>2</Order>
                            <Type>MSR</Type>
                            <Size>128</Size>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Order>3</Order>
                            <Extend>true</Extend>
                            <Type>Primary</Type>
                        </CreatePartition>
                    </CreatePartitions>
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Format>FAT32</Format>
                            <Label>System</Label>
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>2</Order>
                            <PartitionID>3</PartitionID>
                            <Label>Windows</Label>
                            <Letter>C</Letter>
                            <Format>NTFS</Format>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
            </DiskConfiguration>
            <ImageInstall>
                <OSImage>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>3</PartitionID>
                    </InstallTo>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/IMAGE/INDEX</Key>
                            <Value>2</Value>
                        </MetaData>
                    </InstallFrom>
                    <WillShowUI>OnError</WillShowUI>
                    <InstallToAvailablePartition>false</InstallToAvailablePartition>
                </OSImage>
            </ImageInstall>
        </component>
        <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">
            <SetupUILanguage>
                <UILanguage>en-US</UILanguage>
            </SetupUILanguage>
            <InputLocale>0409:00000409</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UILanguageFallback>en-US</UILanguageFallback>
            <UserLocale>en-US</UserLocale>
 </component>
    </settings>
    <settings pass="oobeSystem">
        <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">
            <UserAccounts>
                <AdministratorPassword>
                    <Value>($PASS)</Value>
                </AdministratorPassword>
            </UserAccounts>
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
            </OOBE>
        </component>
        <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>en-US</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UserLocale>en-US</UserLocale>
        </component>
    </settings>
    <settings pass="offlineServicing">
    </settings>
<settings pass="specialize">
    <component name="Microsoft-Windows-TCPIP" 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">
        <Interfaces>
            <Interface wcm:action="add">
                <Ipv4Settings>
                    <DhcpEnabled>false</DhcpEnabled>
                    <RouterDiscoveryEnabled>false</RouterDiscoveryEnabled>
                </Ipv4Settings>
                <Ipv6Settings>
                    <DhcpEnabled>false</DhcpEnabled>
                    <RouterDiscoveryEnabled>false</RouterDiscoveryEnabled>
                </Ipv6Settings>
                <Identifier>($WIN_MAC)</Identifier>
                <UnicastIpAddresses>
                    <IpAddress wcm:action="add" wcm:keyValue="1">($IP)/($NETMASK_SHORT)</IpAddress>
                    <IpAddress wcm:action="add" wcm:keyValue="2">($IPv6)/($NETMASKv6)</IpAddress>
                </UnicastIpAddresses>
                <Routes>
                    <Route wcm:action="add">
                        <Identifier>1</Identifier>
                        <Metric>10</Metric>
                        <NextHopAddress>($GATEWAYv4)</NextHopAddress>
                        <Prefix>0.0.0.0/0</Prefix>
                    </Route>
                    <Route wcm:action="add">
                        <Identifier>2</Identifier>
                        <Metric>10</Metric>
                        <NextHopAddress>($GATEWAYv6)</NextHopAddress>
                        <Prefix>::/0</Prefix>
                    </Route>
                </Routes>
            </Interface>
            <!--Interface wcm:action="add">
                <Ipv4Settings>
                    <DhcpEnabled>false</DhcpEnabled>
                    <RouterDiscoveryEnabled>false</RouterDiscoveryEnabled>
                </Ipv4Settings>
                <Ipv6Settings>
                    <DhcpEnabled>false</DhcpEnabled>
                    <RouterDiscoveryEnabled>false</RouterDiscoveryEnabled>
                </Ipv6Settings>
                <Identifier>Ethernet 2</Identifier>
            </Interface-->
        </Interfaces>
    </component>
    <component name="Microsoft-Windows-DNS-Client" 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">
        <Interfaces>
            <Interface wcm:action="add">
                <Identifier>($WIN_MAC)</Identifier>
                <DNSDomain>($HOSTNAME)</DNSDomain>
                <DNSServerSearchOrder>
                    <IpAddress wcm:action="add" wcm:keyValue="1">($NAMESERVER)</IpAddress>
                </DNSServerSearchOrder>
                <DisableDynamicUpdate>false</DisableDynamicUpdate>
                <EnableAdapterDomainNameRegistration>false</EnableAdapterDomainNameRegistration>
            </Interface>
        </Interfaces>
    </component>
    <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <fDenyTSConnections>false</fDenyTSConnections>
      </component>
      <component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <UserAuthentication>0</UserAuthentication>
      </component>
    <component name="Networking-MPSSVC-Svc" 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">
        <FirewallGroups>
            <FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
                <Active>true</Active>
                <Group>@FirewallAPI.dll,-28752</Group>
                <Profile>all</Profile>
            </FirewallGroup>
        </FirewallGroups>
    </component>
    <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">
              <Description>Delete route</Description>
              <Order>1</Order>
              <Path>cmd /c echo IF "($IPv4)"=="" (route delete 0.0.0.0/0) ELSE IF "($IPv6)"=="" (route delete ::/0) >> %windir%\setup\scripts\SetupComplete.cmd</Path>
              <WillReboot>OnRequest</WillReboot>
           </RunSynchronousCommand>
           <RunSynchronousCommand wcm:action="add">
                      <Description>Change EFI boot order</Description>
              <Order>2</Order>
                      <Path>cmd /c echo cmd /c %windir%\setup\scripts\boot_order_changer.exe setfirstid __EFIBOOT__  >> %windir%\setup\scripts\SetupComplete.cmd</Path>
              <WillReboot>OnRequest</WillReboot>
           </RunSynchronousCommand>
           <RunSynchronousCommand wcm:action="add">
                       <Description>Disable Network Discovery</Description>
                       <Order>3</Order>
                       <Path>cmd /c echo cmd /c %windir%\System32\WindowsPowerShell\v1.0\powershell.exe -command "&amp; {&amp;'Disable-NetFirewallRule' –DisplayName '@FirewallAPI.dll,-32752'}" >> %windir%\setup\scripts\SetupComplete.cmd</Path>
                       <WillReboot>OnRequest</WillReboot>
           </RunSynchronousCommand>
                   <RunSynchronousCommand wcm:action="add">
                       <Description>Setting multiple nameservers</Description>
                       <Order>4</Order>
                       <Path>cmd /c echo cmd /c %windir%\setup\scripts\nameservers.cmd ($NAMESERVERS) >> %windir%\setup\scripts\SetupComplete.cmd</Path>
                       <WillReboot>OnRequest</WillReboot>
                   </RunSynchronousCommand>
           <RunSynchronousCommand wcm:action="add">
                       <Description>Enable language</Description>
                       <Order>5</Order>
                       <Path>cmd /c %windir%\System32\WindowsPowerShell\v1.0\powershell.exe %windir%\setup\scripts\lang.ps1 "($LANG)" >>%windir%\setup\scripts\lang.log 2>&amp;1</Path>
                       <WillReboot>Never</WillReboot>
           </RunSynchronousCommand>
                   <RunSynchronousCommand wcm:action="add">
                       <Description>finish</Description>
                       <Order>6</Order>
                       <Path>cmd /c echo cmd /c %windir%\setup\scripts\wget.exe -O- "($FINISH)" >> %windir%\setup\scripts\SetupComplete.cmd</Path>
                       <WillReboot>OnRequest</WillReboot>
                   </RunSynchronousCommand>
           <RunSynchronousCommand wcm:action="add">
                       <Description>Postinstall script listener</Description>
                       <Order>7</Order>
                       <Path>cmd /c IF "($HAS_RECIPE)"=="1" (echo cmd /c %windir%\System32\WindowsPowerShell\v1.0\powershell.exe  %windir%\setup\scripts\winrm_listener.ps1 "($HOSTNAME)" "($LOCATIONIP)") >> %windir%\setup\scripts\SetupComplete.cmd</Path>
                       <WillReboot>OnRequest</WillReboot>
                   </RunSynchronousCommand>
                   <RunSynchronousCommand wcm:action="add">
                       <Description>Change EFI boot order 2</Description>
                       <Order>8</Order>
                       <Path>cmd /c %windir%\setup\scripts\boot_order_changer.exe setfirstid __EFIBOOT__ >> %windir%\setup\scripts\efi.log</Path>
                       <WillReboot>OnRequest</WillReboot>
                   </RunSynchronousCommand>
                   <RunSynchronousCommand wcm:action="add">
                       <Description>Put key</Description>
                       <Order>9</Order>
                       <Path>cmd /c echo ($PRODUCTKEY) >> %windir%\setup\key</Path>
                       <WillReboot>OnRequest</WillReboot>
                   </RunSynchronousCommand>
                   <RunSynchronousCommand wcm:action="add">
                       <Description>Activating windows</Description>
                       <Order>10</Order>
                       <Path>cmd /c echo cmd /c %windir%\setup\scripts\activate.cmd >> %windir%\setup\scripts\SetupComplete.cmd</Path>
                       <WillReboot>OnRequest</WillReboot>
                   </RunSynchronousCommand>
                   <RunSynchronousCommand wcm:action="add">
                       <Description>TZ setup</Description>
                       <Order>11</Order>
                       <Path>cmd /c IF NOT "($TIMEZONE)" == "()" ( IF NOT "($TIMEZONE)" == "" (tzutil /s "($TIMEZONE)"))</Path>
                       <WillReboot>OnRequest</WillReboot>
                   </RunSynchronousCommand>
        </RunSynchronous>
    </component>
</settings>
    <cpi:offlineImage cpi:source="catalog:c:/distr/7601.17514.101119-1850_x64fre_server_eval_en-us-grmsxeval_en_dvd/sources/install_windows server 2008 r2 serverstandard.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

网上查得,在 xml 文件中,& 的符号要转义。尝试使用 CData 来表达 URL 的变量 ($FINISH) 。但实践中,使用了 CData 后,网址末尾多出来了个分号 ; 符号。无奈,最后将 URL 的变量拆成两部分,前边一部分写固定,后边用变量 ($AUTH_ID) 的组合。

参考:

ubuntu 22.04 pxe 安装 太慢了 run_unattended_upgrades

问题:有用户反馈,安装 ubuntu 22.04 系统失败。

过程:在 ipmi 里查看,安装信息停留在 run_unattended_upgrades 这一步很长时间。直到安装脚本在1或2个小时后超时失败。尝试下载 https://releases.ubuntu.com/22.04/ubuntu-22.04.4-live-server-amd64.iso 的文件,显示要约五个小时才能完成,速度约 150KB/s。尝试更新 pxe 里引用的 iso 文件,替换为最近的(发布于2024-02) 22.04.4 版本的 iso 文件,再次测试,安装在30分钟后完成。

参考:

ubuntu 24.04 - pxe 安装 - unable to find a live file system on the network - 要用和iso文件匹配版本的 vmlinuz 和 initrd

问题:客户要求安装 ubuntu 24.04。我偷懒,直接复制原 ubuntu 22.04 的目录,然后替换其中的 iso 文件。实机操作提示出错,unable to find a live file system on the network , BusyBox initramfs。

尝试:需要从新版本iso文件casper目录中提出 vmlinuz 和 initrd 文件,替换旧版本的,因为两者要匹配,否则会报错。

参考:https://unix.stackexchange.com/questions/633218/unable-to-find-a-live-file-system-on-the-network-pxe-boot-ubuntu-from-centos

drserver.net 站的静态页面简体中文翻译 - 非官方

用了四天,将我老板的网站 drserver.net 大概翻译了。我是将原网站页面保存为静态文件,然后动手将其中的十个页面进行小修改和翻译。

不译如 resellerwebhosting 的页面,因为觉得没人看。aup 和 termsofservice 页面的内容合并在一处。

效果:https://drs.anqun.org/https://drserver.cn/ 请注意,仅是我个人的翻译,内容可能不准确,不代表官方意思。

可能的好处:从中国访问,相对会快些吧,因为原站在欧洲。

hostbill - 简体中文语言翻译错误 - clientarea - addfunds_d

问题:用户问为什么充了200美元,没有奖励5%的,充值页面明明写着是有。

尝试:当用户使用英语时,没有奖励的语句,是"dd funds for a future use - either for the next orders or for your future invoices automatic payment."但切换到中文语言显示时,是“添加资金用于购买我们的产品服务(一次性添加200元或等值美元,奖励5%资金)”。因为我们没有提供过“充值返点”的活动,应该是hostbill的简体中文语言包翻译错误。

可以登录到hostbill管理后台,Languages -> Chinese -> Section -> clientarea 找到相应的句子,纠正过来。

如将:addfunds_d 添加资金用于购买我们的产品服务(一次性添加200元或等值美元,奖励5%资金) Add funds for a future use - either for the next orders or for your future invoices automatic payment.

中的中文修改为:添加资金用于购买我们的产品服务(生成新订单和新账单时会自动从余额中划扣)

感谢mark反馈。

dn-hostbil-chinese-error-1.png