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

windows 镜像制作 来自 官方文档

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-11-11 11:15:28 | 显示全部楼层 |阅读模式
. F7 D* @2 F: g% S% Q
通过百度,google找到些资料,看到官方制作文档如下:
6 Z: r' L7 |/ l, u4 K2 V1 {
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 15G
      ' a7 u* V1 k, s* f) H& C5 W- n4 X+ \' i0 ?) W0 ~  M

      ' S6 P0 L7 y6 K
  • 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 2012( r- q8 i7 s6 k' F: C

      j* Y4 L" N  L  V/ M% X6 `
    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" F/ p/ V0 A+ l) G# U7 j, I
    ; ^) S& l! {; {, w. D
  • To allow the Cloudbase-Init to run scripts during an instance boot, set the PowerShell execution policy to be unrestricted:
    C:\powershellC:\Set-ExecutionPolicy Unrestricted5 p9 W( |+ M8 j" O5 u3 \  H3 q

    , M) n9 a* T5 n4 H
  • Download and install the Cloudbase-Init:
    C:\Invoke-WebRequest -UseBasicParsing https://cloudbase.it/downloads/CloudbaseInitSetup_Stable_x64.msi -OutFile cloudbaseinit.msiC:\.\cloudbaseinit.msi
    # V1 [! c" [) q* A5 M, b  h6 {; T/ A$ ]; I
    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
      7 n& Y8 ^5 k4 c4 a$ E/ m. ?
    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.

    6 u( E, {" q: `- o$ t( _0 N1 o
Your image is ready to upload to the Image service:
$ openstack image create --disk-format qcow2 --file ws2012.qcow2 WS2012" H, L: ~8 _6 v) L/ x
' b, s5 a7 O# }, d3 L

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
" X! ?( T; M2 @0 T
5 z4 i. J/ F/ O/ W# q

" d- d' [4 n1 C/ b( ]3 T

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:09:34 | 显示全部楼层
[DEFAULT]0 I8 C- M2 N0 z& g' @) k9 f) u! E
# 创建什么用户以及用户属于什么组.8 t! S; b6 \$ a8 \( u# ]; @! T
username=Admin          #一般都是改为Administrator
6 C5 l; M7 X  Mgroups=Administrators
5 m5 r/ x. A9 L2 V% Y; p% H* ^' ?inject_user_password=true  # 从元数据中获取密码 (非随机).
6 V; }' y. ?8 m2 J8 `+ I8 g! x& M# 那个设备是可能的配置驱动 (元数据).
/ n+ c+ X* m9 `% k! l3 Z9 ^config_drive_raw_hhd=true
( o% N. Y) z2 z, Q) Tconfig_drive_cdrom=true
$ y5 T, C' R* F" T5 w# 与ubuntu中功能相同的tar命令默认路径.2 D' r, j+ O) i( U! B/ [5 e1 }, J
bsdtar_path=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe2 K7 A2 u! @6 T2 z% f- |8 u3 M
# 日志等级.& O2 n9 b2 e" \3 r2 e1 U
verbose=true. H! Z* @5 G5 K, \- ^% o. n3 q
debug=true; s5 X& n4 Q+ Q9 m' B3 ^# Q
# 日志存放路径.
8 o4 t5 M7 O" y) q1 D0 h) X' j1 K0 xlogdir=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\log\7 h2 G' C6 W* Y- ^) p$ r
logfile=cloudbase-init-unattend.log
. F* O$ h/ f' Y1 H# _default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN
. X7 n) @+ o. T  j2 nlogging_serial_port_settings=
# X8 R/ g2 V9 q3 u( O* r+ p4 L' B# 启用最大传输单元和时间同步服务.5 Z" ]8 Q/ t. E5 H
mtu_use_dhcp_config=true
+ \% T9 _5 L- w8 h& D' i# tntp_use_dhcp_config=true
" o- V4 J& Z; E3 r# t$ p* G# 存放用户用于执行的脚本的路径.
% A( f8 f" S/ l0 Z' \. p& Qlocal_scripts_path=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\LocalScripts\" @3 H  Y4 Y1 j
# 服务将会检测以下驱动直到某个能够成功获取元数据.3 |6 m  p! |; C% O
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService, #可以开启ConfigDrive和httpservice(Openstack)
7 @2 ~; `) j3 p: W1 Q                  cloudbaseinit.metadata.services.httpservice.HttpService,; _8 W$ k: x; q. G/ h
                  cloudbaseinit.metadata.services.ec2service.EC2Service,. \( A+ r$ q8 g/ f# C
                  cloudbaseinit.metadata.services.maasservice.MaaSHttpService
' s  ]! [+ E  }9 g* b+ k( y1 y# 需要执行的插件.
" ?( U7 y* U- ]; Y+ ^0 f- f, tplugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,- n" f5 f( d( s# k1 ^+ V
        cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,) L" o. _: y. i+ `1 c( f, q. b: l
        cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,. k6 N1 p9 x. D  `  U6 b* `8 g
        cloudbaseinit.plugins.windows.userdata.UserDataPlugin,
% W6 k4 J- ]- b1 N! X        cloudbaseinit.plugins.windows.setuserpassword.SetUserPasswordPlugin,
; d) l% C0 Y7 e6 N# ]7 |. ~4 o        cloudbaseinit.plugins.windows.localscripts.LocalScriptsPlugin
& f* W- O/ G4 t8 \  Q; R# 其他配置.
0 f, I( l& p( J- Callow_reboot=false    # allow the service to reboot the system5 u: G6 l8 N" O. C
stop_service_on_exit=false
# F' T4 [/ p, j# W9 R. i( u; c( c3 Y

8 H2 i* O0 z  k) s$ C

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:20:11 | 显示全部楼层
<?xml version="1.0" encoding="utf-8"?>
  D9 N; S' t$ ?. X9 G6 z) _<unattend xmlns="urn:schemas-microsoft-com:unattend">
! l; G* B; Q  g9 i2 [: a) `0 S/ C<settings pass="oobeSystem">+ K& z2 @# s2 ~8 p
<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">
3 J2 X, z  w6 S/ S& a<InputLocale>zh-CN</InputLocale>( w( c. y: \" N, _2 I
<SystemLocale>zh-CN</SystemLocale>, _) H6 Y$ M/ D: Q6 s
<UILanguage>zh-CN</UILanguage>
+ ?; k$ F" C, {  ]2 c# D<UILanguageFallback>zh-CN</UILanguageFallback>4 Q; h. c, D8 l2 J. U. ^4 x* g3 I
<UserLocale>zh-CN</UserLocale>
: u" _* `5 c* Y# y</component>
+ F% I2 R/ a* A. H. }<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">  E2 W$ M, d  {0 n8 J! ?
<AutoLogon>
# |% `, Q) q  T( l8 s' ]" i7 D<Password>5 F/ t/ P1 _, Z0 G; H7 D
<PlainText>false</PlainText>
- `2 m( G5 L4 T2 `; m6 w<Value>YgBvAGMALgAxADIAMwBQAGEAcwBzAHcAbwByAGQA</Value>
. Z! @2 d$ r2 i0 W6 ^</Password>. j& U8 b: q3 k
<Enabled>true</Enabled>! _+ |! i  y% i# n. Z
<LogonCount>1</LogonCount>
3 C- h5 R/ Z* G& }& v<Username>administrator</Username>
4 e. d1 d+ ]4 B9 M. ]</AutoLogon>. ]4 ~" y+ W- A
<OOBE>
* {- t9 ~2 o* Z<SkipMachineOOBE>true</SkipMachineOOBE>
% D9 n9 l* q$ i, _4 A. d</OOBE>" x9 L2 g8 R3 Q- D4 x0 |  j5 A
<UserAccounts>( S5 c3 q1 y5 E" ~$ X8 M& w
<AdministratorPassword>( B- ^' A' w- Q- O+ C3 v, F
<Value>YgBvAGMALgAxADIAMwBBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value>/ w" Y% W. x# W2 s# [0 z3 R* d0 i
<PlainText>false</PlainText>
- ?6 g1 a& E8 l2 h9 `</AdministratorPassword>! J8 W. W1 J4 D6 \6 J  b
</UserAccounts>$ t0 A, q. X1 c
<FirstLogonCommands>
$ T% v9 y" {2 ]" {. ]/ }' R<SynchronousCommand wcm:action="add">
+ L2 n9 v2 u7 S# `( e( h3 [<Order>1</Order>
5 a% h* m1 n$ S8 x( R<CommandLine>%WINDIR%\System32\WindowsPowerShell\v1.0\PowerShell.exe c:\m.ps1</CommandLine>4 ]$ \1 H; p7 M0 w. e
</SynchronousCommand># g) g# L! c+ [# ^1 y( A
</FirstLogonCommands>
+ i, C2 T: z; o</component>$ P* m, H+ D* S+ G' f* P: e' m; a
</settings>
- C0 ~) V- R  \; q/ e<settings pass="specialize">3 v9 x: k) ~8 C
<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">
) m5 ?3 m. @6 P6 [! Y<SkipAutoActivation>true</SkipAutoActivation>7 X5 ?* n3 ]  v4 q/ f7 w5 C
</component>. O8 a" @" c5 I7 p- W3 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">
1 t6 s+ U) J" e! _  @<ComputerName>PCname1</ComputerName>
# D+ U9 r& {0 g8 V! b! F: c1 h<TimeZone>China Standard Time</TimeZone>
- s/ S$ x  p  {  z# l</component>% p: \: \- i" a$ J- I
</settings>
6 T6 w# v& I7 ~  g: l( o2 I<cpi:offlineImage cpi:source="catalog:e:/isotest/win2008r2_en_windows server 2008 r2 serverenterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />$ m' n0 W; |7 e3 m# W
</unattend>
( s8 ]6 O9 v3 T* Z

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:21:18 | 显示全部楼层
<?xml version="1.0" encoding="utf-8"?>
8 A% A9 E9 H5 e* n<unattend xmlns="urn:schemas-microsoft-com:unattend">) }5 P. V2 L; W7 g
    <settings pass="windowsPE">% t% B$ x; \/ l- {3 t3 e1 X
        <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">
3 P8 u0 o6 }* v9 c( T            <SetupUILanguage>, p) _3 G1 @7 P6 @3 S
                <UILanguage>en-US</UILanguage>7 v- C: S' J9 N4 l& q
            </SetupUILanguage>* C7 o% t: B+ X8 l+ B
            <InputLocale>en-US</InputLocale>9 _) K) Q+ O/ a5 e
            <SystemLocale>en-US</SystemLocale>; p# S% Y& Y+ M, ~
            <UILanguage>en-US</UILanguage>7 W; P; n; s' [, ]
            <UILanguageFallback>en-US</UILanguageFallback>
3 ]( t& |( G" h* o/ ?4 G) n+ `            <UserLocale>en-US</UserLocale>
; @, J0 @, \0 e( J) i+ Y5 F        </component>
; h. P: u7 y; O& n: G6 z- M3 S        <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">
. a$ d& _) V/ z  o: j1 J  n6 u1 ]            <ImageInstall>4 X, V+ M- W, e, A4 {9 ?7 e
                <OSImage>$ a! P% b8 p4 F
                    <InstallTo>, y( V" b4 l9 R. \0 c
                        <DiskID>0</DiskID>
) q1 v7 [: x4 T1 m                        <PartitionID>2</PartitionID>
$ J( @' B" A, X0 O& a1 k& p                    </InstallTo>
. e) `+ M7 F' g9 N! i0 ^: }0 b            <InstallFrom>& z% a' f. q% b/ o. E4 ~
            <MetaData>
- R! N+ _' e; N. \                <Key>/image/name</Key>6 s( m2 [3 B4 G: g8 M
                <Value>Windows 10 Enterprise</Value>
8 b0 E& h8 x  N2 M- h! c! ]) ^            </MetaData>
6 A: B1 i* ?. t5 T) z: N7 q            </InstallFrom>            
! c& m* A2 s  j6 e                    <InstallToAvailablePartition>false</InstallToAvailablePartition>( ?& Y; o9 |' y1 k8 ^
                    <Compact>false</Compact>
9 i- T# X3 z  C/ b$ c2 b                </OSImage>  Q: [! j  ^* V  {1 T
            </ImageInstall>
8 n: g# h- E( t8 z+ v2 [  ^            <UserData>" R, w. H' R+ a* T
                <AcceptEula>true</AcceptEula>. Q  }2 B* z$ s2 _3 V
                <FullName>Administrator</FullName>
; ~6 x! F, Y0 d! F1 j9 b                <Organization>MyOrg</Organization>
5 ]; ^* b# N5 q; ^4 j                <ProductKey>
6 u, }+ v9 @; |! t( @                    <Key>1ProductKey</Key>$ p/ T; R0 v: S6 W
                </ProductKey>
! m1 x: [: r6 E( n  }+ G            </UserData>6 }9 e! N! n7 A+ H) t
            <EnableFirewall>true</EnableFirewall>& ~! y3 @/ F6 W, `4 N! x  e% a5 {  v
            <DiskConfiguration>4 _, C2 \6 y+ v- e
                <Disk>
$ X# j9 B3 ]/ T% s                    <CreatePartitions>
! i9 t' y5 w9 j2 b/ v% r. v, w& r                        <CreatePartition>
( d! z( v! j+ j7 }4 M3 q- g                            <Size>500</Size>
# d) t( C$ {6 g* L                            <Order>1</Order>" w# e9 K7 _; c6 ^
                            <Type>Primary</Type>" p% v/ }9 q* [  ?) _3 u
                        </CreatePartition>
" ]$ h* J" B+ K9 G' O                        <CreatePartition>5 F$ i! Q; y! K) l/ \9 q! k
                            <Order>2</Order>5 l& s6 r% t, K! l, p
                            <Extend>true</Extend>
! n: y* T( M8 _" D# W2 v: ^7 s; X  X: F                            <Type>Primary</Type>
, W# z3 o" c% e5 o                        </CreatePartition>
1 I! b! G. ?% U+ r0 x- J% I                    </CreatePartitions>1 |0 R6 S. |* C- }4 y" v
                    <ModifyPartitions>
* }# z! W  I- U( }" v- v% k                        <ModifyPartition>) u' l2 R: j7 ?( r. l5 e  l- C* S
                            <Active>true</Active>! q0 L7 |# n+ A7 C- E0 a0 V- i
                            <Extend>false</Extend>6 Q; ~5 k) v" h# u+ n) s
                            <Format>NTFS</Format>
6 ^1 \7 n2 j! N' a' `( P0 W                            <Label>System</Label>; o/ l: c9 A/ P9 Q5 u
                            <Order>1</Order>1 G* K8 y5 ?* r/ P7 l
                            <PartitionID>1</PartitionID>
" B; `) f  [  u6 f$ ]. z" C                        </ModifyPartition>
4 ^/ c. \3 o4 e4 O, ~                        <ModifyPartition>+ Z, o3 {( B/ D) d
                            <Active>false</Active>
+ z$ v1 b% C: T* G4 s                            <Extend>false</Extend>
( F4 D% c, l* a                            <Format>NTFS</Format>7 }% S0 x2 [/ X+ V( X
                            <Label>OS</Label>- f3 ~6 v1 `& O( l1 \; {
                            <Letter>C</Letter>
# k& Z3 Q9 N- t                            <Order>2</Order>
; B  k! y2 n% v( r2 g                            <PartitionID>2</PartitionID>( ~4 ]3 v+ L; L0 D- w8 P1 J
                        </ModifyPartition>
/ H2 n2 G' j- _' W- m, ^                    </ModifyPartitions>; U+ b; \. M% W( B( b% ~3 i* q
                    <DiskID>0</DiskID>
+ ^5 I/ K7 N& h9 Q) \                    <WillWipeDisk>true</WillWipeDisk>6 L) j2 B1 _0 e' d8 J) Z% ^8 z# s5 |
                </Disk>
; V6 t) o- x1 `2 e+ y, W$ W  |                <WillShowUI>OnError</WillShowUI>
3 s2 x  `2 e9 |: u0 ~            </DiskConfiguration>% A1 S% e* ^6 ?+ R. {  O6 j
        </component>- T; `5 ]- y0 ^" p
    </settings>
: ?0 p( c0 v6 ?; s    <settings pass="offlineServicing">; D; h/ g5 K# h" N1 q, D0 g( t
        <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">
7 L7 u4 \( D3 J% [8 [1 f            <EnableLUA>false</EnableLUA>( c0 n, v, U# K
        </component>4 e6 _* r( S, A  ?
    </settings>
2 D. E8 N3 R% @5 b/ P    <settings pass="generalize">. N$ T$ A9 h" `2 D3 m- H. u
        <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">
% \. X9 l9 @" b9 ]6 J6 Y) k            <SkipRearm>1</SkipRearm>
% r  p9 g: e8 J) h& w4 c$ D4 R        </component>
/ J% ^  H4 R2 W8 v  ^1 O& H8 J    </settings>
9 n# |6 I- [9 o    <settings pass="specialize">
$ s! ?8 c. V1 H        <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">
8 C# [) r! B6 L1 E            <Identification>
, G$ k3 D. c; _, n1 H                <Credentials>
/ W+ G: t6 _3 _+ }7 ]                    <Domain>1Domain</Domain>3 T0 T. u5 J0 a* Y& e$ E
                    <Password>1DomainJoinPW</Password>) s6 M" W( T7 |7 K
                    <Username>1DomainJoinAcct</Username>9 l5 y' v! c, s9 v" {' J2 s
                </Credentials>, U. D/ M; t; P  a# V6 F% E% X  ?
                <JoinDomain>1FQDN</JoinDomain>
% F* T5 z* \+ N                <MachineObjectOU>1OULocation</MachineObjectOU>2 t- P. v/ M/ s
                <DebugJoin>true</DebugJoin>
* U0 `* L. Y/ K; o/ K            </Identification>
  L! G' b. M9 I/ x/ o        </component>5 G6 N: b# `3 |* W% K2 e; c. 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">& Y9 S0 V7 U7 Y8 d3 O, g
            <ComputerName>1ComputerName</ComputerName>
% R6 B1 n" @& O( F( C, m            <AutoLogon>3 k' [) L% T" ^8 i
                <Password># |5 h3 i1 q% |& r1 }
                    <Value>1AutoLogonPW</Value># u# g& N+ T. `& t" o7 A
                    <PlainText>true</PlainText>; N- I( U( e* p. x+ G3 x9 R
                </Password>
0 _2 m1 ?8 V0 n                <Enabled>true</Enabled>9 W( B+ B& o" |. T7 n- t1 J% @
                <Username>1AutoLogonAcct</Username>
; U" B; o; Z* F, V  }1 s                <Domain>1Domain</Domain>5 p0 G$ B2 E6 u7 @  }! Q. J
            </AutoLogon>; Q/ Y, t7 O2 l  ]" g
            <RegisteredOrganization>MyOrg</RegisteredOrganization>
/ V  W; `8 U  H  X8 M            <RegisteredOwner>Administrator</RegisteredOwner>
$ Q- L( A7 S% g3 ]6 Y9 j5 u$ Q5 G0 O            <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>' n/ r; H& Q3 o5 a
            <TimeZone>Central Standard Time</TimeZone>
* M; s7 `% x9 ]: Z  ^8 i& X# m        </component>  B. o- [& o0 `& n. J
        <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">
, N* y3 c; S( A" _            <IEHardenAdmin>false</IEHardenAdmin>
) }$ z$ N) N) M# T6 @- X            <IEHardenUser>false</IEHardenUser>& ~9 F$ [6 c* S
        </component>6 U9 }# k) G+ z& i+ F* V
    </settings>7 P. {, ?7 z( X* g3 t
    <settings pass="oobeSystem">9 W+ Y% ~) C5 A/ q- h
        <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 ">
# P3 ]+ t& a4 q, _/ ?8 b* j            <OOBE>
7 L2 n' A+ D3 U2 K' J- \8 R6 P                <HideEULAPage>true</HideEULAPage>
, r  [9 M# O+ w) d: p) ~                <HideLocalAccountScreen>true</HideLocalAccountScreen>3 [; j# M7 \4 Z+ B
                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>: R+ W( {( b- l. d4 t
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
( Q- L/ C; T0 M& a/ _8 u7 S. ~/ `                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>$ H# u: e5 E- t8 e
                <NetworkLocation>Work</NetworkLocation>( u+ @6 P2 }, E% w
                <ProtectYourPC>1</ProtectYourPC>
/ D, `+ Q3 r. n3 @  ]$ G6 O                <SkipMachineOOBE>true</SkipMachineOOBE>/ N: k7 l& [- z' N
                <SkipUserOOBE>true</SkipUserOOBE>
- q" y4 Z4 z6 @' A- j& h7 H            </OOBE>$ Y+ f9 A# ]! Z, d9 l$ ~
            <LogonCommands>
- ~) e# N( }( F, b8 I                <AsynchronousCommand>% u$ Y+ w) V% A5 ?# t& l
                    <CommandLine>powershell -NoLogo -ExecutionPolicy Bypass -File 1DeploymentScript</CommandLine>
' N$ o' q# z4 ?! y                    <Description>Installs components</Description>
. K0 s) x3 A# I$ w, ?' O                    <Order>1</Order>! Y% ^7 ]  S: U- }4 u
                </AsynchronousCommand>5 A+ i' W7 K9 a) l9 U! I# i
            </LogonCommands>- Z5 L# U# I9 _) x1 a
            <UserAccounts>
+ v5 W  `, m7 r5 o                <AdministratorPassword>
* o. `- a. k; I- A5 J  M! ~                    <Value>1LocalAdminPW</Value>. i+ H' R" L4 d/ H
                    <PlainText>true</PlainText>* j3 \9 m  @+ G
                </AdministratorPassword>
. y% \" n& Z% v6 [4 w                <DomainAccounts>! q$ i( o8 S3 J5 A. x  k5 \
                    <DomainAccountList>. S, b. ~. R& j6 D
                        <DomainAccount>
) C8 Y3 T( g) P: ]1 A* Z7 n% k! j2 k. V                            <Group>RemoteDesktopUsers</Group>5 q+ f( i2 R. O
                            <Name>Domain Users</Name>5 k% C" r( k0 }% B3 t
                        </DomainAccount>
8 I8 f- R' o* _# r8 E                        <Domain>1Domain</Domain>
2 n( M: R- n- Q                    </DomainAccountList>0 D1 Q4 }* B6 R$ u
                </DomainAccounts>
, ~9 O1 W6 P( v. q            </UserAccounts>' O" L7 ]& e; `( `* E! b! ]  n
        </component>! I: j$ o( l! J6 C
    </settings>
& p1 {: j6 e# ]3 o' \8 k  W( F</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"?>
1 {: c* N4 B; S; `9 n- a6 N+ T( S( a<unattend xmlns="urn:schemas-microsoft-com:unattend">
1 y. {8 }# K+ {( V# n! Y: L    <settings pass="windowsPE">
! F+ X. f! s& _9 B, Z( _# j0 R        <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">
# s4 X0 n" W3 Y  j) `8 C7 K7 `5 [            <SetupUILanguage>9 r: t& o0 ^/ g6 k
                <UILanguage>en-US</UILanguage>/ S$ S9 o) @0 v. L7 f3 A& g
                <WillShowUI>Never</WillShowUI># m: @2 c2 {# q" p- E# r; L
            </SetupUILanguage>- W; G% w9 L, `, R0 C) h
            <InputLocale>en-US</InputLocale>
; f1 |! a( B3 i            <SystemLocale>en-US</SystemLocale>: M/ Y/ ]1 L0 R* N* k8 u
            <UILanguage>en-US</UILanguage>* _% Z) ]+ Q6 K8 A4 a/ U
            <UserLocale>en-US</UserLocale>
4 I- W7 \% |3 e" K# Z        </component>: P6 c2 o1 V$ v4 [' c: N
        <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">
  r3 Y" s  K# g. t1 _" x            <UserData>" `# r0 I9 ~3 e) o  t2 j: S' \
                <AcceptEula>true</AcceptEula>
3 O0 O8 u2 w2 _/ M' R                <ProductKey>% y# g8 N2 c3 b$ F
                    <Key>11111-22222-33333-44444-55555</Key>* `% {6 B1 G! y' L% [+ ]
                    <WillShowUI>Never</WillShowUI>. f3 ~/ q9 E* |# M- D5 E9 H
                </ProductKey>
2 z7 P% M  L; b) |8 @( j            </UserData>
$ c! v* i2 }, C/ I            <EnableFirewall>true</EnableFirewall>: e, W& c! c# S
        </component>
& w. S  \/ j8 Q4 T2 S    </settings>0 @' g; e8 b% Q! a8 u& t
    <settings pass="specialize">
) T6 @$ Q% ^# S- o; \  y/ V/ l        <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">
, i# v8 O4 @' F/ M4 n7 ~6 j            <TimeZone>Central Standard Time</TimeZone>
9 Q: O( p% z0 B- ]( A        </component>- L; X! R, k+ y
    </settings>
' W* c* v0 E/ R# J  e' K$ ~: a    <settings pass="oobeSystem">
' R; ?: R/ l/ R7 Y1 a        <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">" c  B0 y/ |0 Q, H3 `' _# U
            <AutoLogon>% B2 B: z( c) \5 ~( ~
                <Password>
, Y" x4 F# E/ D' D                    <Value>PASSWORD123!</Value>4 _2 [+ s4 ^) i& f9 J  ]& a1 f
                    <PlainText>true</PlainText>( W, Q' M) s6 a0 R  V2 E6 `) u# k% i
                </Password>
4 j. e/ E# s7 k5 L& J                <LogonCount>2</LogonCount>
* i0 P4 `4 L$ g+ x5 A                <Username>Administrator</Username>
4 x* A9 r0 m$ C2 h) g1 j7 U                <Enabled>true</Enabled>
2 @3 o1 m2 m0 q5 z' _, t& h            </AutoLogon>
, m* \& G( o. {            <UserAccounts>! W% T% S) m# z1 Z4 j
                <AdministratorPassword>
  w6 u  U2 J+ ^7 M                    <Value>PASSWORD123!</Value>
$ j6 G' R- g4 O% t6 z                    <PlainText>true</PlainText>
3 g% t) E* d8 b6 |$ l0 [7 n- v                </AdministratorPassword>
3 [) `* Y5 ?1 O4 v. F            </UserAccounts>
. ~( D! }8 b$ P0 r( x6 U        </component>
2 J1 F. f- r9 ~9 E( Z- c    </settings>6 R$ N# t: C- f- m* p2 L+ B
    <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" />
5 y9 V% h$ u  s</unattend>8 i" U5 f) f% L' i6 }
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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