创建 Windows Server无人值守安装自动安装 ISO

在使用 Red Hat 的 Kickstart 和 Debian 的 Preseed 来自动化 Linux 安装之后,我需要类似的东西来自动化 Windows 部署。

目标

防止在安装过程中显示 Windows 安装程序中的所有用户界面页面并使其完全自动化。

在我们开始之前

我们可以使用应答文件自动安装 Windows。

该过程分为三个步骤:

  1. 下载 Windows 服务器 ISO 文件
  2. 创建应答文件 autounattend.xml
  3. 将应答文件添加autounattend.xml到 ISO 文件中

配置

下载 Windows Server ISO

导航到https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2016并下载 Windows Server 2016 评估 ISO。

在撰写本文时,我没有使用 Windows Server 2019 的经验,因此使用的是我熟悉的 Windows Server 2016。

创建 autounattend.xml

我使用 Windows 系统映像管理器创建了无人值守的 Windows 安装程序应答文件。

我还使用了 Windows 安装程序参考,该参考描述了可以在 Windows Server 2016 中设置的所有无人参与设置。以下链接供参考。

https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/components-b-unattend

这是一个基于反复试验的漫长过程。

你可以autounattend.xml 在这里查看我的。

将 autounattend.xml 添加到 ISO

我最终使用第三方工具来实现这一点。这是我所做的。

使用我们之前下载的 Windows Server ISO 文件创建 KVM 来宾。

# virt-install \
  --name windows2016 \
  --ram 6144 \
  --vcpus 2 \
  --disk path=/var/lib/libvirt/images/windows2016.qcow2,size=40 \
  --os-type windows \
  --os-variant generic \
  --network network=default \
  --cdrom Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO \
  --sound none \
  --virt-type kvm

登录到 Windows 服务器并创建两个目录:

C:\SRC\
C:\OUTPUT\

使用安装的Windows Server ISO为DVD和所有文件复制到C:\SRC\包括autounattend.xml

下载并安装 ImgBurn。

使用 ImgBurn 从目录创建 ISO 文件。导航到“高级 > 可启动磁盘”并勾选“使映像可启动”框。

将“来源”设置为C:\SRC\. 将“目的地”设置为C:\OUTPUT\win2k16_autounattend.iso

使用boot\etfsboot.comDVD 中的文件作为“启动映像”。

设置 Windows Server 2016 时,将“要加载的扇区”设置为 8。

构建图像。在可能出现的所有提示上单击是。

将生成 ISO 文件并另存为C:\OUTPUT\win2k16_autounattend.iso. 现在使用此 ISO 文件部署无人值守的 Windows 服务器。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值