找回密码
 注册
查看: 1679|回复: 6

windows 镜像制作 来自 官方文档

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-11-11 11:15:28 | 显示全部楼层 |阅读模式
) U+ X. t" v8 `: W
通过百度,google找到些资料,看到官方制作文档如下:
* G: g+ |  Z+ ^& v
This example creates a Windows Server 2012 qcow2 image, using the virt-install command and the KVM hypervisor.
  • Follow these steps to prepare the installation:
    • Download a Windows Server 2012 installation ISO. Evaluation images are available on the Microsoft website (registration required).
    • Download the signed VirtIO drivers ISO from the Fedora website.
    • Create a 15 GB qcow2 image:
      $ qemu-img create -f qcow2 ws2012.qcow2 15G5 @, I$ ~# s: r2 h. z

      $ Q# U5 p1 F& Y. t/ Z0 B- {: e9 a  J+ W
  • Start the Windows Server 2012 installation with the virt-install command:
    # virt-install --connect qemu:///system \  --name ws2012 --ram 2048 --vcpus 2 \  --network network=default,model=virtio \  --disk path=ws2012.qcow2,format=qcow2,device=disk,bus=virtio \  --cdrom /path/to/en_windows_server_2012_x64_dvd.iso \  --disk path=/path/to/virtio-win-0.1-XX.iso,device=cdrom \  --vnc --os-type windows --os-variant win2k12 \  --os-distro windows --os-version 20124 G$ A5 }7 e2 {. |% w3 x

    7 r/ d- G* _4 F7 S0 h4 P( C
    Use virt-manager or virt-viewer to connect to the VM and start the Windows installation.
  • Enable the VirtIO drivers. By default, the Windows installer does not detect the disk.
  • Load VirtIO SCSI drivers and network drivers by choosing an installation target when prompted. Click Load driver and browse the file system.
  • Select the E:\virtio-win-0.1XX\viostor\2k12\amd64 folder. The Windows installer displays a list of drivers to install.
  • Select the VirtIO SCSI drivers.
  • Click Load driver and browse the file system, and select the E:\NETKVM\2k12\amd64 folder.
  • Select the network drivers, and continue the installation. Once the installation is completed, the VM restarts.
  • Define a password for the administrator when prompted.
  • Log in as administrator and start a command window.
  • Complete the VirtIO drivers installation by running the following command:
    C:\pnputil -i -a E:\virtio-win-0.1XX\viostor\2k12\amd64\*.INF" S  p6 Y( b1 q, ~6 \0 z/ |5 P
    , Q1 m. C1 w0 b$ K
  • To allow the Cloudbase-Init to run scripts during an instance boot, set the PowerShell execution policy to be unrestricted:
    C:\powershellC:\Set-ExecutionPolicy Unrestricted
    # b0 ^. P: c1 S* L9 W& P* I9 F$ [% G
  • Download and install the Cloudbase-Init:
    C:\Invoke-WebRequest -UseBasicParsing https://cloudbase.it/downloads/CloudbaseInitSetup_Stable_x64.msi -OutFile cloudbaseinit.msiC:\.\cloudbaseinit.msi5 o! d! u& G7 p1 g

    0 [+ ]2 D9 s$ D( m
    In the configuration options window, change the following settings:
    • Username: Administrator
    • Network adapter to configure: Red Hat VirtIO Ethernet Adapter
    • Serial port for logging: COM1
      % i8 B" o7 i' O+ ^
    When the installation is done, in the Complete the Cloudbase-Init Setup Wizard window, select the Run Sysprep and Shutdown check boxes and click Finish.
    Wait for the machine shutdown.
    9 D0 G; J3 v3 o9 ~' S- a
Your image is ready to upload to the Image service:
$ openstack image create --disk-format qcow2 --file ws2012.qcow2 WS20128 C$ x0 K( W' w* l% y
( h* a% g! {; Z

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:09:21 | 显示全部楼层
[DEFAULT]# 创建什么用户以及用户属于什么组.username=Admin          #一般都是改为Administratorgroups=Administratorsinject_user_password=true  # 从元数据中获取密码 (非随机).# 那个设备是可能的配置驱动 (元数据).config_drive_raw_hhd=trueconfig_drive_cdrom=true# 与ubuntu中功能相同的tar命令默认路径.bsdtar_path=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe# 日志等级.verbose=truedebug=true# 日志存放路径.logdir=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\log\logfile=cloudbase-init-unattend.logdefault_log_levels=comtypes=INFO,suds=INFO,iso8601=WARNlogging_serial_port_settings=# 启用最大传输单元和时间同步服务.mtu_use_dhcp_config=truentp_use_dhcp_config=true# 存放用户用于执行的脚本的路径.local_scripts_path=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\LocalScripts\# 服务将会检测以下驱动直到某个能够成功获取元数据.metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService, #可以开启ConfigDrive和httpservice(Openstack)                  cloudbaseinit.metadata.services.httpservice.HttpService,                  cloudbaseinit.metadata.services.ec2service.EC2Service,                  cloudbaseinit.metadata.services.maasservice.MaaSHttpService# 需要执行的插件.plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,        cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,        cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,        cloudbaseinit.plugins.windows.userdata.UserDataPlugin,        cloudbaseinit.plugins.windows.setuserpassword.SetUserPasswordPlugin,        cloudbaseinit.plugins.windows.localscripts.LocalScriptsPlugin# 其他配置.allow_reboot=false    # allow the service to reboot the systemstop_service_on_exit=false% F0 V5 h8 ^5 Z, A- N8 a, Y3 s

" t* A6 S) R( d+ g
6 q( ^' b" I& M4 w

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:09:34 | 显示全部楼层
[DEFAULT]- \7 Y) D& G# }8 ]' Z  D4 P
# 创建什么用户以及用户属于什么组.
3 B, C8 t6 f; ~" |- n+ yusername=Admin          #一般都是改为Administrator7 s' X4 O7 b9 S
groups=Administrators
2 ]$ \& |# P; |9 P  B/ @% ^inject_user_password=true  # 从元数据中获取密码 (非随机).
9 E7 O. G% R5 n& N4 r; |+ I$ Q# 那个设备是可能的配置驱动 (元数据).9 X  B. V+ R+ Y, m( R
config_drive_raw_hhd=true
; h* n) v7 `& S2 Q! y" A4 t( Xconfig_drive_cdrom=true
7 v4 @# A) [+ T# 与ubuntu中功能相同的tar命令默认路径.
% @* d( p( M1 _4 ybsdtar_path=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe: j" |6 t+ h( L0 n# Q1 n
# 日志等级.# t/ D" U2 X: ?  a3 e. b
verbose=true- `1 f  M2 r- Z) @& q1 B% W  j
debug=true& F5 G3 a% A3 Y/ p" M3 x8 G
# 日志存放路径.1 m; S7 w' h6 q
logdir=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\log\" z. `. X) w3 Z0 N4 v
logfile=cloudbase-init-unattend.log
% b' Z6 U- U4 I- {# o8 M1 I$ r: Sdefault_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN
8 C1 W& y% g% \+ N( Qlogging_serial_port_settings=0 A9 ?& i% N; B5 X8 F5 x! p" E
# 启用最大传输单元和时间同步服务./ |0 O5 `$ o, \* q1 c
mtu_use_dhcp_config=true
: O* c6 \' |% ?. n0 ontp_use_dhcp_config=true
9 I" H' G  C9 i, }9 A9 l# 存放用户用于执行的脚本的路径.& [) H( B( Z6 y5 T4 }% N* A; [
local_scripts_path=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
5 w4 F- [( p2 N) C$ Z# 服务将会检测以下驱动直到某个能够成功获取元数据.. T) G6 u: f5 [* N8 @" L& {
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService, #可以开启ConfigDrive和httpservice(Openstack)
+ B! S7 |9 Q& \# l9 @                  cloudbaseinit.metadata.services.httpservice.HttpService,4 ~  C( V8 ^- t& P/ F
                  cloudbaseinit.metadata.services.ec2service.EC2Service,
" z9 s3 |& y4 l) J+ L/ D6 Y5 F                  cloudbaseinit.metadata.services.maasservice.MaaSHttpService2 b: ^# a! }$ y+ g: w
# 需要执行的插件.! w+ b  O+ E/ D
plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,( A; w* Q" I; H/ h  X7 G: {
        cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,1 [! Z, f1 {4 D6 e/ j
        cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,$ m% x2 ]) u2 t2 f0 ^- [
        cloudbaseinit.plugins.windows.userdata.UserDataPlugin,
2 T4 o* K0 Y6 A        cloudbaseinit.plugins.windows.setuserpassword.SetUserPasswordPlugin,
' M/ o* E$ X& x+ z. A" I        cloudbaseinit.plugins.windows.localscripts.LocalScriptsPlugin7 [, `9 G! ?/ ?: z7 R5 Q
# 其他配置.
" m) \' a8 E7 M& Vallow_reboot=false    # allow the service to reboot the system
6 \9 N3 M$ y' `2 j9 x) e# qstop_service_on_exit=false
0 T2 }0 k# p3 j) w' e5 @! M. S% N) I% G

( w& C3 `* g- V  C) e$ R3 e

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:20:11 | 显示全部楼层
<?xml version="1.0" encoding="utf-8"?>$ G. L/ m  l1 E/ k& \
<unattend xmlns="urn:schemas-microsoft-com:unattend">7 A* r. x7 N. y; z% {! B
<settings pass="oobeSystem">
4 S& y) `' z$ V: t6 F7 B<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">7 S0 ~6 o  |5 m8 @+ e# L( o& Q
<InputLocale>zh-CN</InputLocale>
7 g- _0 ]( r4 w; M& Y! h* S2 v8 x7 I<SystemLocale>zh-CN</SystemLocale>
, j1 W! ]5 x' T<UILanguage>zh-CN</UILanguage>
3 E5 U2 C. g, C/ s3 A8 m<UILanguageFallback>zh-CN</UILanguageFallback>/ i, m6 \7 @. z4 t) t* `7 M8 K0 d
<UserLocale>zh-CN</UserLocale>7 t3 H3 b' T% ^  t( {, r
</component>/ Y% \9 N! y5 b% P* `6 A- @$ s
<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">
8 Q7 ~( U, H7 H+ d7 r<AutoLogon>1 D+ f7 k; t3 c6 i, g
<Password>4 |, `6 Q0 e  U% V- j
<PlainText>false</PlainText>' ^$ b/ m( N  \  U5 `$ L- h$ K6 M& }
<Value>YgBvAGMALgAxADIAMwBQAGEAcwBzAHcAbwByAGQA</Value>* x5 e4 b* t/ W( d
</Password>' w$ U9 I7 ^+ V5 q2 T
<Enabled>true</Enabled>
1 i& X. r* V; R3 k1 u<LogonCount>1</LogonCount>+ d9 _0 J& z# }" J& w, b
<Username>administrator</Username>
! c1 Q- s0 V/ Z' W6 t</AutoLogon>  M. k5 m/ d& o& m; g0 F3 L3 b# W
<OOBE>  d8 z" l1 H+ w$ z
<SkipMachineOOBE>true</SkipMachineOOBE>
5 ^( _, D8 h5 p9 v/ d</OOBE>: f8 ^+ k6 u: S" u; ]) s
<UserAccounts>
6 j4 N+ H5 ~/ ~& m<AdministratorPassword>* }- Z" [; s$ W5 k7 {7 V
<Value>YgBvAGMALgAxADIAMwBBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value>
9 Y) ~8 [  A* x<PlainText>false</PlainText>
4 z9 }9 {& x* l9 [. E# W8 ~0 _! S: G</AdministratorPassword>
! W8 D! z7 ]# r6 E! r- [</UserAccounts>
/ V+ x( l+ B2 m- W% O; O2 \, [6 f<FirstLogonCommands>: G7 |, m3 c; a4 B3 ?
<SynchronousCommand wcm:action="add">! s/ ]- ]& N; r  i; [* A
<Order>1</Order>& [4 j- e0 }" D6 j4 h% X0 R9 i
<CommandLine>%WINDIR%\System32\WindowsPowerShell\v1.0\PowerShell.exe c:\m.ps1</CommandLine>: o3 x7 D9 O% z8 Q
</SynchronousCommand>1 F  n/ E+ k5 D. V$ l3 K
</FirstLogonCommands>0 g3 Z+ `2 n2 H
</component>8 F& O7 Y& y2 a: j- f7 u- z
</settings>+ h& w$ R, @- C, ]' E
<settings pass="specialize">
. x6 v: e  W) L. G8 b* n* I<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">
( C: _! G, j2 b. _2 V<SkipAutoActivation>true</SkipAutoActivation>2 T" A$ \: g: Y$ ^, b
</component>' B) n6 `8 ]- m* v$ g
<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">3 ?# C$ k- T* z: P; e
<ComputerName>PCname1</ComputerName>
4 D' ^. P  {" p: Z3 P<TimeZone>China Standard Time</TimeZone>
, Q0 Y& o, I  }</component>
+ {, p3 c  B7 t* [$ x2 n# t</settings>
- ^0 m* ?: C: n$ ]( u<cpi:offlineImage cpi:source="catalog:e:/isotest/win2008r2_en_windows server 2008 r2 serverenterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
; H, H- k& W( D/ q5 L6 t5 a</unattend>
! q8 B% b3 x) I) Q' @9 \

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:21:18 | 显示全部楼层
<?xml version="1.0" encoding="utf-8"?>
: d; |5 q$ J- _; Z; O<unattend xmlns="urn:schemas-microsoft-com:unattend">. _) a& n/ M, L) O" d9 f" ?
    <settings pass="windowsPE">
/ M, A6 Y2 w6 ?8 J7 K. J- j& i7 p# E        <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">6 D5 w  ~2 s3 k
            <SetupUILanguage>
) A/ z5 t9 Q; z+ E, N& f/ i' ~: B                <UILanguage>en-US</UILanguage>
: O4 }: I- p2 l" {2 e            </SetupUILanguage>
/ [- p6 t( i' r# C& p& @            <InputLocale>en-US</InputLocale>
$ {* ^5 T+ k1 ]# X5 x8 e. W- y            <SystemLocale>en-US</SystemLocale>: _/ S; y- J* s' i% `
            <UILanguage>en-US</UILanguage>
4 t7 Y+ L2 G% G            <UILanguageFallback>en-US</UILanguageFallback>
/ K, I9 Z3 {9 P9 q7 V; A            <UserLocale>en-US</UserLocale>  W% r5 r( K  y4 |5 t* {
        </component>6 I1 `" \& u4 n- \2 u
        <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">2 X/ n$ u0 l8 D7 o5 N3 V) M1 w
            <ImageInstall>
, M0 s0 H' w" M                <OSImage>
- t2 r' {/ n0 C4 v3 Z7 K# R                    <InstallTo>3 o/ k, h: _( h
                        <DiskID>0</DiskID>
3 W0 R: S( q4 ^! C* t1 v7 s                        <PartitionID>2</PartitionID>
$ T% Q' y/ C  n9 z* l5 T. v                    </InstallTo>
( |5 Q% |: H6 v# f8 V            <InstallFrom>
" M2 n; l# W  Z) ]            <MetaData>! g3 v  N8 r  d3 b. }- }4 B
                <Key>/image/name</Key>
0 r5 T6 _; @* \2 e: b4 H9 y                <Value>Windows 10 Enterprise</Value>
. H7 ?5 N" Z$ B1 q, K# M. v2 K            </MetaData>
3 r4 O# }7 r  C' `            </InstallFrom>            
& b. x. w5 J5 P2 `( H: }* J0 m                    <InstallToAvailablePartition>false</InstallToAvailablePartition>
1 g. \8 r: ?* {1 }, j% P                    <Compact>false</Compact>
( q  j+ x% {9 W2 k0 K' y. J/ |8 V                </OSImage># O4 V2 L0 s. L" N# q5 c0 H
            </ImageInstall>
" s0 u5 X% _7 a  @. K4 ?! X2 n            <UserData>  W6 F6 x1 ^6 [
                <AcceptEula>true</AcceptEula>0 G( L0 w; N! K# W
                <FullName>Administrator</FullName>, I$ f! T( {  J, \, ~0 L* u& L# P4 s
                <Organization>MyOrg</Organization>
) N! [+ a5 N6 C- h; u& K5 n6 `( N                <ProductKey>6 E/ w& r8 S# d! S$ R" ^
                    <Key>1ProductKey</Key>
1 w9 E2 S# @# `0 P% h! S                </ProductKey>$ K$ H% z9 f& P$ A, _
            </UserData>
4 f7 R! ^7 S% x8 Y/ X* e            <EnableFirewall>true</EnableFirewall>
" X3 \% [% n9 E- R# W            <DiskConfiguration>
) u+ q6 H' V& H- q( z( J                <Disk>
& j( }/ U5 I# o                    <CreatePartitions>
! E, [$ L3 ]- M% p                        <CreatePartition>
4 M0 V7 j( b' z9 F- E; }  q1 t                            <Size>500</Size>
6 j# V* t) G  M& B" R/ T                            <Order>1</Order>
- l: u9 K4 s- f! ~7 `                            <Type>Primary</Type>" n! N4 z* C8 R  e- S5 ?
                        </CreatePartition>9 o' z* L# u% [2 O5 Q+ E
                        <CreatePartition>
/ t* u  }* }$ a0 u7 A) l7 G                            <Order>2</Order>4 K- n+ h) X: @- T  R* O. d1 i
                            <Extend>true</Extend>3 p# h) `8 i" L& d
                            <Type>Primary</Type>0 ^: u" c$ q7 h) I+ S& \  `( E
                        </CreatePartition>; s! X1 n- j; c
                    </CreatePartitions>
* b  R" P+ T' Q' j2 C                    <ModifyPartitions>$ T& c5 w5 J/ T. `, l9 s' ?7 l- B
                        <ModifyPartition>8 E7 O: [" s6 t- K* r
                            <Active>true</Active>- d. k0 p/ P2 Z( X2 P2 V
                            <Extend>false</Extend>$ Y6 Y7 ]6 e5 w- H# L; L& }
                            <Format>NTFS</Format>
! [" X) h' H2 ~                            <Label>System</Label>  K& w; \4 g+ o
                            <Order>1</Order>
! j/ K4 m! G3 u( h1 f, _                            <PartitionID>1</PartitionID>1 Z5 P; d2 i8 b
                        </ModifyPartition>$ C: A: v( B' K
                        <ModifyPartition>5 e7 u- A1 b; t. m
                            <Active>false</Active>6 d$ i! [' l) O7 Q% V
                            <Extend>false</Extend>
; F$ N4 g: J6 d1 ]                            <Format>NTFS</Format>
$ F) k# R5 P2 }- K                            <Label>OS</Label>1 `6 B! N: M; i# Q
                            <Letter>C</Letter>+ m1 Q/ [& K; V4 {
                            <Order>2</Order>& L( n0 n% C' k, t: m
                            <PartitionID>2</PartitionID>1 w, o3 Z8 ?/ r$ W8 d: u% |
                        </ModifyPartition>
( }$ g# W8 A8 U4 w/ S+ }) c. R                    </ModifyPartitions># Z3 [0 Q8 f* I' D  L
                    <DiskID>0</DiskID>0 L& M6 [' U% ?
                    <WillWipeDisk>true</WillWipeDisk>
) ^& S+ D- k0 f9 J7 |6 h8 n  k9 N                </Disk>
: F" T9 \: t  Y6 C5 K5 d8 m% V                <WillShowUI>OnError</WillShowUI>3 l- F( _" j$ ^
            </DiskConfiguration>
. _3 z% o$ c- }  o8 y5 {        </component>& N& U" Z  s* E5 d  `
    </settings>
! E1 W! w  |1 ?3 n& M' m$ F    <settings pass="offlineServicing">( a; G& R# Q8 S4 @
        <component name="Microsoft-Windows-LUA-Settings" 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">
; E1 q: C9 M! Z( z/ Z3 `            <EnableLUA>false</EnableLUA>2 i/ V2 R! b; {
        </component>
% R3 m1 _7 S: v1 p  q2 `! L    </settings>  x5 Q; r- o; |
    <settings pass="generalize">
& s/ \& n- |. M# k6 i        <component name="Microsoft-Windows-Security-SPP" 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">: z2 U8 Y$ U& h
            <SkipRearm>1</SkipRearm>
1 k  c5 L$ V& D7 X5 b( M7 j: ?' D        </component>
9 \. E. K& i- i% X    </settings>) S7 M' L% P# t9 U
    <settings pass="specialize">
6 H8 L* j1 d, n3 |$ K        <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"># l- {) g& G3 \. l0 H6 C! d4 ~* A
            <Identification>1 v) E3 _1 H0 V6 u- V5 V
                <Credentials>  \% d% Y3 d1 {4 U1 X- F9 W
                    <Domain>1Domain</Domain>
) d) z( d) U0 n7 l9 @6 R  x9 U' o                    <Password>1DomainJoinPW</Password>
* D: ~8 ^/ _0 q$ F- {                    <Username>1DomainJoinAcct</Username>; W% U! |. t9 p1 r! d$ {
                </Credentials>
! D% L0 C3 p& k( Y2 j6 ?' Q                <JoinDomain>1FQDN</JoinDomain>
- d2 ?7 [* c; v' |0 y- k: D                <MachineObjectOU>1OULocation</MachineObjectOU>4 n) k( B5 L" T/ o1 s
                <DebugJoin>true</DebugJoin>8 R, b, L1 g+ V0 k' V6 s$ t9 j  I2 P2 G& C
            </Identification>
) {# e. A5 \, J; w' t1 l7 S        </component>! `8 r+ H/ X; Z; H) Q
        <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 t& G5 N2 ~$ D+ G+ P: y- y
            <ComputerName>1ComputerName</ComputerName>
: U0 G' `: [8 E4 Q/ l            <AutoLogon>% m1 V' X8 U! L4 h" \- f1 t* Y
                <Password>
0 ~; {% d+ c" W: }                    <Value>1AutoLogonPW</Value>! q; Y; q1 r3 b7 Q% _3 O
                    <PlainText>true</PlainText>
# [" J% G/ H' v                </Password>
3 A/ t  K9 i4 h8 x. Z                <Enabled>true</Enabled>5 m3 y! T  p/ C! c$ M
                <Username>1AutoLogonAcct</Username>
# f. \* H; d; y                <Domain>1Domain</Domain>$ R- _6 s1 c6 B# k
            </AutoLogon>
0 |* A8 N' M# Y* Z$ w/ F( [4 d0 F            <RegisteredOrganization>MyOrg</RegisteredOrganization>1 I3 r* G; x9 p/ m7 _
            <RegisteredOwner>Administrator</RegisteredOwner>
) l1 v6 X# L# ?. Y9 e6 s/ }            <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
+ S" V$ `2 I1 H! O6 _7 G1 v3 e            <TimeZone>Central Standard Time</TimeZone>
' L: t# d. `/ i6 y1 k: c        </component>
  D, Y% p6 G+ F8 P        <component name="Microsoft-Windows-IE-ESC" 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">  ?1 o! H8 h: k5 W6 V9 q" ]6 `
            <IEHardenAdmin>false</IEHardenAdmin>
* Z; y6 m7 k% r5 k  h            <IEHardenUser>false</IEHardenUser>, }; \6 h, `/ r; w
        </component>( i0 L+ A6 P1 v. A* u+ [
    </settings>" p6 ~+ S  N3 X3 p& [  C- M
    <settings pass="oobeSystem">5 J- d& ^. ^7 T
        <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 ">
$ M: L: }, a5 x" z/ W            <OOBE>
3 L, [; Z4 l5 H6 o% h- m" l                <HideEULAPage>true</HideEULAPage>! L1 N) @4 \; }$ L2 d
                <HideLocalAccountScreen>true</HideLocalAccountScreen>8 k& D; P! t  u
                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
3 q! I$ w( S7 u) a+ T                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
0 @$ }* d4 v5 h* m+ G                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>7 K' \8 v4 d+ E& T8 M- R
                <NetworkLocation>Work</NetworkLocation>
7 N: S* Z+ y8 J                <ProtectYourPC>1</ProtectYourPC>
: `' r+ J. `- X; i                <SkipMachineOOBE>true</SkipMachineOOBE>, b" R. K, y2 a8 o
                <SkipUserOOBE>true</SkipUserOOBE>" J( I$ c  [5 B4 r6 {
            </OOBE>4 V* w. G1 V. F& |
            <LogonCommands>* W, ~4 H' T+ e7 p' `
                <AsynchronousCommand>
2 g, t5 W3 h3 N) c5 ~7 o                    <CommandLine>powershell -NoLogo -ExecutionPolicy Bypass -File 1DeploymentScript</CommandLine>
9 ^4 b! d) J+ S                    <Description>Installs components</Description>
/ X3 P' A$ v9 B- m3 {. M, k                    <Order>1</Order>
& @" N) t5 O1 X                </AsynchronousCommand>1 O% d% ?$ \7 ^: A; L7 o
            </LogonCommands>+ [, Y5 F% {. L# |7 Z% z
            <UserAccounts>
' t4 m6 j! z* F2 |& T                <AdministratorPassword>( J: I3 {; M- m/ _- f2 D
                    <Value>1LocalAdminPW</Value>
( T! n" O4 q  b; H8 u0 J                    <PlainText>true</PlainText>
  n3 J& {  r! O                </AdministratorPassword>' r: ^  E+ B4 c. ]8 ]
                <DomainAccounts>
, d, Q: Z- O8 H3 Y, R                    <DomainAccountList>
9 M3 D" @$ i% D+ A5 `                        <DomainAccount>
( h' E; D% V1 r0 Q/ a3 l, R8 a1 {5 Y) s                            <Group>RemoteDesktopUsers</Group>
% N3 H& N/ I$ Z- A5 \9 E7 t                            <Name>Domain Users</Name>" O. t# t5 f1 p8 Z
                        </DomainAccount>
+ W: a: T; E' l" Y4 E, G* w; P                        <Domain>1Domain</Domain>
6 v5 v8 [3 V# T' _% i                    </DomainAccountList>& F, E; l7 r( }+ v( h) s, f
                </DomainAccounts>
( U/ s5 U8 r' p            </UserAccounts>
9 D0 @4 ~* q, e/ e2 x& O) m        </component>/ J# M: y9 b8 H+ v9 Z) Y7 X3 M' I
    </settings># ]* R; T, A/ M. }- h
</unattend>

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:22:38 | 显示全部楼层
执行命令”C:\Windows\System32\sysprep\sysprep.exe /generalize /oobe /unattend:Unattend.xml”,对Windows系统进行封装。执行完该命令后,云服务器会自动关机。

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:25:06 | 显示全部楼层
将制作好的应答文件unattend.xml拷贝到模板机sysprep目录下,然后在cmd下运行 (unattend.xml文件可自定义名称)
  sysprep /generalize /oobe /shutdown /unattend:Unattend.xml
Windows2019版本<?xml version="1.0" encoding="utf-8"?>
% F7 i/ ]8 O/ C, G* L. e<unattend xmlns="urn:schemas-microsoft-com:unattend">
4 L, _, W, N# j( B1 m' ?* Y    <settings pass="windowsPE">
9 Q! }/ k* S  Z. D  v1 s. p# c        <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">5 \' W$ I( c9 U4 s
            <SetupUILanguage>& ~! b8 Y9 h1 p+ `1 N, n
                <UILanguage>en-US</UILanguage>& J3 m! d8 N/ N. [+ y
                <WillShowUI>Never</WillShowUI>
- U+ K8 I! C) \. q+ u5 h4 V            </SetupUILanguage>
7 n; M: M* E5 Z, g            <InputLocale>en-US</InputLocale>( J: L; H" R! d" [" z
            <SystemLocale>en-US</SystemLocale>' }. l3 ~4 `& E2 ^
            <UILanguage>en-US</UILanguage>" y6 d, h0 Y* a5 W
            <UserLocale>en-US</UserLocale>3 R" C. T% O* J: _* E* [0 @# M/ _
        </component>2 Z4 O  C( X. Y) s2 c& _, u
        <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">
( i0 h4 I$ L3 _$ W) R            <UserData>3 _. M8 f- u4 t! P& ^
                <AcceptEula>true</AcceptEula>% N% s& x0 O) z" m1 S' G: N$ T  ^
                <ProductKey>" t  v9 s$ n9 B5 L1 r8 ~3 _% Z. p: S
                    <Key>11111-22222-33333-44444-55555</Key>4 X2 X1 ~, {# }9 |$ r
                    <WillShowUI>Never</WillShowUI>
& I& h4 S, j. @( m4 i1 C                </ProductKey>
6 E, [( o( x" ^3 R4 o; B2 \            </UserData>+ m$ a  l( G1 }
            <EnableFirewall>true</EnableFirewall>
" `( ?0 Z7 X" s, ~0 K$ M        </component>! k: M0 o, f0 b% `& m: e% E2 _
    </settings>! v& [9 ^9 {. n5 v3 z: s. U
    <settings pass="specialize">
  E) W# M) \$ f# o" a) T. \        <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">! S$ O0 v* ^1 }+ l0 d* P
            <TimeZone>Central Standard Time</TimeZone>4 Z/ ~" X2 Z0 N9 V% `3 i2 e1 Q
        </component>% Y* R/ Z& T' Y# Z4 r! Y! ^" P; X2 u3 A1 E
    </settings>
9 l0 e. r  L; z, ]3 J7 l  d    <settings pass="oobeSystem">
+ w5 [( k& n% l" I3 @5 P" F$ t        <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">
, R# r' D) a; q7 x1 q: p( H            <AutoLogon>! L- a2 @2 X# r9 `: L7 k0 x
                <Password>
; ]9 u. s. W- n                    <Value>PASSWORD123!</Value>$ w* ~# |; W7 U5 W$ V$ ?
                    <PlainText>true</PlainText>$ M! n1 ~1 R" Z* h" m+ z
                </Password>
4 \6 h4 l5 E* C3 \- b3 c& j4 Z# N" t                <LogonCount>2</LogonCount>
+ q% `/ y: E: Z                <Username>Administrator</Username>
5 M6 v  E% [8 Q! w                <Enabled>true</Enabled>
: W- a* x" q  F3 ?8 F$ u) M# }8 x& m: m            </AutoLogon>
% P9 C- M& X$ y7 z. E: }* M            <UserAccounts>
/ P) A7 w3 C# N  U6 e                <AdministratorPassword>
/ b0 A4 _( R2 l/ v" |7 ~                    <Value>PASSWORD123!</Value>
* A/ B, T1 j; ]1 m                    <PlainText>true</PlainText>
( u5 W! d/ v' A, `6 s$ T                </AdministratorPassword>0 _7 O% f/ ^0 V& [  _. L! f& z
            </UserAccounts>- O/ ]3 K7 m; Z% a7 S8 n
        </component>
. p- _; l1 \- h' U1 c    </settings>
$ o3 M, x5 y/ B5 i$ @/ R; ~    <cpi:offlineImage cpi:source="wim:c:/users/admin/documents/test/win%20srv%202019/sources/install.wim#Windows Server 2019 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />& z1 t1 D. Q( y: o5 {
</unattend>! w8 ^  @! y1 T
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:08 , Processed in 0.020606 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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