全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2606|回复: 0

制作Windows 10系统的dd包 - 含网卡和设置静态IP

[复制链接]
发表于 2018-8-8 17:19:37 | 显示全部楼层 |阅读模式
本帖最后由 LiuJia 于 2018-8-10 14:23 编辑

环境:某商家超微主板的凌动服务器($20.00);Windows 10安装ISO文件;Dism++;7-zip;网卡驱动文件;DeployVHD

思路:

1.下载好Windows 10安装ISO文件,如 cn_windows_10_business_edition_version_1803_updated_jul_2018_x64_dvd_12613133.iso

2.按“蜂鸣器”博客里提到的方法,通过Dism++制作好包含“intel ethernet connection 1354 2.5 gbe backplane”网卡驱动的映像文件,将映像文件释放到vhd


3.通过DeployVHD,应用无人值守配置文件Unattend.xml,启用远程桌面,且允许通过Windows防火墙,设置管理员administrator的密码,设置自动登录,设置“以太网”的网卡静态IP。如果是设置为中文语言的,需要留意/Windows/panther/Unattend.xml的文件内容,因为汉字的网卡名称可能会保存异常,否则可能在安装时会提示无人值守文件检查失败


4.压缩包含有无人值守安装设置的vhd文件。在机子上安装测试,通过


/Windows/panther/Unattend.xml 文件内容:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <unattend xmlns="urn:schemas-microsoft-com:unattend">
  3.     <settings pass="specialize">
  4.         <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">
  5.         </component>
  6.         <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" 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">
  7.             <fDenyTSConnections>false</fDenyTSConnections>
  8.         </component>
  9.         <component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" 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">
  10.             <UserAuthentication>0</UserAuthentication>
  11.         </component>
  12.         <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">
  13.             <FirewallGroups>
  14.                 <FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
  15.                     <Group>@FirewallAPI.dll,-28752</Group>
  16.                     <Profile>all</Profile>
  17.                     <Active>true</Active>
  18.                 </FirewallGroup>
  19.             </FirewallGroups>
  20.         </component>
  21.     </settings>
  22.     <settings pass="oobeSystem">
  23.         <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">
  24.             <InputLocale>007f:00000804</InputLocale>
  25.             <SystemLocale>zh-CN</SystemLocale>
  26.             <UILanguage>zh-CN</UILanguage>
  27.             <UILanguageFallback>zh-CN</UILanguageFallback>
  28.             <UserLocale>zh-CN</UserLocale>
  29.         </component>
  30.         <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">
  31.             <AutoLogon>
  32.                 <Password>
  33.                     <Value>xinNIANhao2019</Value>
  34.                     <PlainText>true</PlainText>
  35.                 </Password>
  36.                     <Enabled>true</Enabled>
  37.                     <LogonCount>5</LogonCount>
  38.                 <Username>Administrator</Username>
  39.             </AutoLogon>
  40.             <FirstLogonCommands>
  41.                 <SynchronousCommand wcm:action="add">
  42.                     <CommandLine>powershell.exe Get-NetAdapter -Name *  | ? status -eq up | Rename-NetAdapter -NewName "iEtherNet"</CommandLine>
  43.                     <Description>rename nic name</Description>
  44.                     <Order>1</Order>
  45.                 </SynchronousCommand>
  46.                 <SynchronousCommand wcm:action="add">
  47.                     <CommandLine>powershell.exe New-NetIPAddress -IPAddress "144.172.126.32" -InterfaceAlias "iEtherNet" -PrefixLength 24 -DefaultGateway 144.172.126.1</CommandLine>
  48.                     <Description>set static ip address</Description>
  49.                     <Order>2</Order>
  50.                 </SynchronousCommand>
  51.                 <SynchronousCommand wcm:action="add">
  52.                     <CommandLine>powershell.exe Set-DnsClientServerAddress -InterfaceAlias "iEtherNet" -ServerAddresses 8.8.8.8</CommandLine>
  53.                     <Description>set dns server</Description>
  54.                     <Order>3</Order>
  55.                 </SynchronousCommand>                                 
  56.             </FirstLogonCommands>
  57.             <UserAccounts>
  58.                 <AdministratorPassword>
  59.                     <Value>xinNIANhao2019</Value>
  60.                     <PlainText>true</PlainText>
  61.                 </AdministratorPassword>
  62.             </UserAccounts>
  63.             <OOBE>
  64.                 <HideEULAPage>true</HideEULAPage>
  65.                 <SkipMachineOOBE>true</SkipMachineOOBE>
  66.             </OOBE>
  67.             <TimeZone>China Standard Time</TimeZone>
  68.         </component>
  69.     </settings>
  70.     <cpi:offlineImage cpi:source="catalog:d:/temp/install_windows server 2012 r2 serverdatacenter.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
  71. </unattend>
复制代码



参考:
  • https://www.fmqcloud.com/archives/makedd.html
  • https://askubuntu.com/questions/145902/unable-to-mount-windows-ntfs-filesystem-due-to-hibernation
  • https://github.com/wellsluo/DeployVHD/blob/master/README-CN.md
  • https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-firstlogoncommands
  • https://docs.microsoft.com/en-us/powershell/module/nettcpip/new-netipaddress?view=win10-ps
  • https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-tcpip-interfaces-interface-unicastipaddresses-ipaddress
  • https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/networking-mpssvc-svc-firewallgroups-firewallgroup
  • https://github.com/cloudbase/unattended-setup-scripts/blob/master/Autounattend.xml
  • https://www.starwindsoftware.com/blog/specialize-windows-server-hyper-v-guest-os-automatically
  • https://blogs.technet.microsoft.com/heyscriptingguy/2012/09/06/use-powershell-3-0-to-rename-network-adapters/
  • https://blogs.technet.microsoft.com/heyscriptingguy/2012/11/21/use-powershell-to-configure-the-nic-on-windows-server-2012/
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-4-26 16:35 , Processed in 0.058277 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表