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

windows 镜像制作 来自 官方文档

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-11-11 11:15:28 | 显示全部楼层 |阅读模式

+ N* m4 N5 _9 L$ D* s6 N
通过百度,google找到些资料,看到官方制作文档如下:

$ O5 `/ g! m) o) d# X
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
      # {3 Y. p2 \4 d* t/ x8 `# I$ X3 n+ p1 J& w. u

      ) X  ~7 h$ ^0 Z# i& G4 n; i
  • 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
    - t) R4 C7 ^% ~' g" n4 J! E9 r' f2 ]" b4 Z+ o
    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) l9 P8 \# I/ Y: O& p: M5 C6 f2 C
    & t4 r4 R' [4 X- Q7 O  c0 U3 r
  • 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
    & j/ x3 C% ~7 E% ^; E; f& D6 k+ @
    8 @. p/ O$ n' w9 ?6 {  g  V/ N
  • Download and install the Cloudbase-Init:
    C:\Invoke-WebRequest -UseBasicParsing https://cloudbase.it/downloads/CloudbaseInitSetup_Stable_x64.msi -OutFile cloudbaseinit.msiC:\.\cloudbaseinit.msi3 c0 p" \1 O4 X* K+ {$ c& p7 r7 j

    1 I3 c* L4 o8 u* b
    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
      - K( b0 _; ]4 t6 q+ P) Q( T! e- m, t
    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.
    + z; L& C) A, A  D
Your image is ready to upload to the Image service:
$ openstack image create --disk-format qcow2 --file ws2012.qcow2 WS2012
3 a2 Z% L* [& e) f3 s. d

" d+ s6 T: Z2 w7 g8 E# J- 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
8 z8 Z* E+ d% f/ M

$ r$ z( d6 w# G3 {+ D" ~" e4 t# n; o  N9 m$ t

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:09:34 | 显示全部楼层
[DEFAULT]# {7 }( c" j4 V9 Z8 I  ?
# 创建什么用户以及用户属于什么组., F% ?& T+ D& d. d0 r
username=Admin          #一般都是改为Administrator, g4 |5 @$ K- ~9 H  Z
groups=Administrators
! R3 y" S2 Z# binject_user_password=true  # 从元数据中获取密码 (非随机).% P! w3 _" Z: G1 y/ O
# 那个设备是可能的配置驱动 (元数据).
3 N0 h, i: m2 W: {config_drive_raw_hhd=true
7 x9 n* k, ~" n4 M0 ^# ]" |- uconfig_drive_cdrom=true
( C# u- E, e8 a# 与ubuntu中功能相同的tar命令默认路径.6 b' T2 `! [  M
bsdtar_path=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe6 R5 t" [4 w% C5 O% B# h# S
# 日志等级.
0 n. c; `# S( M: iverbose=true
# \, I2 Q/ T  Q3 vdebug=true" E: E! ^7 S7 u1 E. Z/ u) L: V
# 日志存放路径.
+ k4 i) h+ r! F9 R+ w2 x) H1 m9 hlogdir=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\log\
3 k: r4 H; J# H& Jlogfile=cloudbase-init-unattend.log! A& M3 m4 c, {6 D8 r
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN/ Q5 p5 g% _7 _4 O; q0 \, V; T( ~
logging_serial_port_settings=
# r. y1 y1 N3 ^4 H( y( j* `0 x# 启用最大传输单元和时间同步服务.
- ]6 a. J+ j, j" Fmtu_use_dhcp_config=true" Y8 {$ i  G0 U# F
ntp_use_dhcp_config=true
  C! m2 N$ W/ i/ ~# 存放用户用于执行的脚本的路径., T* @+ l1 X  h) r; ?6 G
local_scripts_path=C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
8 c2 s2 ^! g8 Z/ [- a* C# 服务将会检测以下驱动直到某个能够成功获取元数据.
7 y$ E/ r' D3 Y0 Q7 n* xmetadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService, #可以开启ConfigDrive和httpservice(Openstack)
% H, m! M* t0 j$ W                  cloudbaseinit.metadata.services.httpservice.HttpService,1 G. V# ?" L9 A0 `6 |0 o/ o8 ^# e7 J$ E, V
                  cloudbaseinit.metadata.services.ec2service.EC2Service,/ i! v: k# U6 C! K6 G
                  cloudbaseinit.metadata.services.maasservice.MaaSHttpService2 W3 H$ Y- z, C
# 需要执行的插件.
/ H! U0 J$ X' m3 B, ?+ Q* Eplugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,& P  B- T% d, _. h) }& o
        cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,  _0 C# X  N' B$ H" {6 B( z
        cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,
) A% e+ G( u3 z# r) c        cloudbaseinit.plugins.windows.userdata.UserDataPlugin,6 \; G. L) X& E4 Z
        cloudbaseinit.plugins.windows.setuserpassword.SetUserPasswordPlugin,
* f  f+ k0 d5 e5 M! j        cloudbaseinit.plugins.windows.localscripts.LocalScriptsPlugin! w' W2 b# ^+ t% V1 I4 i+ C
# 其他配置.
: W6 g/ R6 \) I5 {allow_reboot=false    # allow the service to reboot the system
6 k" b  C+ z$ `$ f, D& S3 ostop_service_on_exit=false5 A" _: V% [; h) h* P0 e( _
& d5 K$ X5 Z5 T  E6 }0 K$ Y- W
1 l1 X2 H! }& ]$ S) I

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:20:11 | 显示全部楼层
<?xml version="1.0" encoding="utf-8"?>/ [/ ^% r6 ?" H9 b
<unattend xmlns="urn:schemas-microsoft-com:unattend">
6 \: G9 c! Y8 W) `<settings pass="oobeSystem">
: _: P5 _- L8 h" B! I5 M<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">) R  Y) l! O! k% d2 B2 S! F7 y1 C
<InputLocale>zh-CN</InputLocale>
- h9 B* u$ ?7 G- p( S+ G( S( e! o<SystemLocale>zh-CN</SystemLocale>
0 ~& e# ]$ l# q5 D2 J6 I<UILanguage>zh-CN</UILanguage>3 x# f8 B, Z" V: e! d
<UILanguageFallback>zh-CN</UILanguageFallback>& |# E4 I# ^6 ?) w* ?: H
<UserLocale>zh-CN</UserLocale>
$ _5 {5 y( i3 |* d2 B9 S' e</component>" l# B" `- g% s( V: _  g2 i& 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">
7 S$ T- `  D/ A; H% [. X% p<AutoLogon>  H: d  f: `& p/ q' ^" j' l0 V
<Password>0 H! N% L9 B2 D2 J' U
<PlainText>false</PlainText>
) \( `! l% w) ?( u9 r0 z$ ], ]<Value>YgBvAGMALgAxADIAMwBQAGEAcwBzAHcAbwByAGQA</Value>6 T1 F! y' Z( e3 `4 C5 W
</Password>3 u% R& ]; r/ H
<Enabled>true</Enabled>. c  c3 ^" j6 G/ X. y! ?& A
<LogonCount>1</LogonCount>' \$ H1 s; b, c+ h
<Username>administrator</Username>' n  ^" y. h6 n5 G0 d# z- f
</AutoLogon>( J1 \. W! l8 A$ I1 H
<OOBE>
( _5 m' B- G' l: S, F; o' ^<SkipMachineOOBE>true</SkipMachineOOBE>
# v/ l% S8 s1 q6 V</OOBE>
* u6 s# Z+ P6 f! P<UserAccounts>  u2 X3 g6 L! o  y, n6 V# n/ Q4 m
<AdministratorPassword>+ Q/ G( `4 g& s: H5 ]5 M* v, V! l
<Value>YgBvAGMALgAxADIAMwBBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value>
2 w2 }; O3 u! l0 g) t3 t<PlainText>false</PlainText>- X2 C/ @) D3 q& C  ~, w7 V6 o
</AdministratorPassword>
. H3 l3 W& M1 z& g  |  @* c</UserAccounts>9 |4 o/ R2 o3 B
<FirstLogonCommands>9 ]$ }, |% ~( e4 `0 o
<SynchronousCommand wcm:action="add">
3 E3 M9 v+ h4 `& \' w, U<Order>1</Order>
! t5 R, i5 d" B, ]5 P; S, t<CommandLine>%WINDIR%\System32\WindowsPowerShell\v1.0\PowerShell.exe c:\m.ps1</CommandLine>
' h# U* z8 K/ I7 G6 A* d8 V0 P</SynchronousCommand>' v2 I' T" q; f$ H5 J
</FirstLogonCommands>
7 C. g4 R1 U' a5 Z( x</component>
2 P$ n- T8 Y! c+ a( |$ m( V9 W</settings>
, T& N7 Z) P( I! c7 l, p+ K<settings pass="specialize">0 R  P0 L$ P# ~" N; l* q% d3 r
<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">
$ H) S5 f5 p* u& Y" C  m& u, v<SkipAutoActivation>true</SkipAutoActivation>
! k: e; f9 N5 ?. k6 g</component>
* C( q: `; D1 K  m* N* U<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% o; D. O: O" |: o6 ~: @! b<ComputerName>PCname1</ComputerName>
% k  ^- p* H6 q  _<TimeZone>China Standard Time</TimeZone>
1 q% u$ B# x5 S$ q  u</component>8 _5 H$ t0 E8 P) S
</settings>
* g9 Q* h, j: D% y9 v$ O% b<cpi:offlineImage cpi:source="catalog:e:/isotest/win2008r2_en_windows server 2008 r2 serverenterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
- ?* K+ ~# [, W$ G; ~; b</unattend>
5 O* I+ a: G/ N$ z/ T" t

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-11-30 10:21:18 | 显示全部楼层
<?xml version="1.0" encoding="utf-8"?>
( F6 v4 }3 Y# E5 b5 T9 |<unattend xmlns="urn:schemas-microsoft-com:unattend">, `: ~" V" V9 W# u5 t' H- _0 ^. N
    <settings pass="windowsPE">, k& D, M1 o/ S  r5 M
        <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">% L( \4 s, D5 i7 Q
            <SetupUILanguage>: o/ ~* L4 v% Z  Z# Y
                <UILanguage>en-US</UILanguage>
6 V3 h( S; k; ~+ D  k4 w1 ?            </SetupUILanguage>5 b2 b7 Q$ x, S1 J" L
            <InputLocale>en-US</InputLocale>
0 }. u6 X4 F+ Z7 b& F            <SystemLocale>en-US</SystemLocale>
" W1 E1 D, ?2 j4 ?' A$ Z9 ]- i0 {; Z+ w2 R1 N            <UILanguage>en-US</UILanguage>! p/ ^3 Y4 b" j' j# V- {5 R
            <UILanguageFallback>en-US</UILanguageFallback>' m5 ]: q& D5 z$ a6 R0 w/ g
            <UserLocale>en-US</UserLocale>
% g6 g# n7 T" [3 k4 C4 e* C        </component>5 r4 @+ [2 N; b' h! T
        <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">
  s' `+ i, z$ _' n$ Z! X& Z8 v% \            <ImageInstall>% v9 a. m  L/ r+ I6 \' x# S
                <OSImage>0 L/ i8 I& V" l0 C' k
                    <InstallTo>
. _1 [, A  y' V7 p7 x2 j! R                        <DiskID>0</DiskID>% X* U8 w5 k3 D- J4 L* X
                        <PartitionID>2</PartitionID>1 D; [3 k( N2 X' o
                    </InstallTo>% ~1 e8 h# R$ S: b4 L. o1 M
            <InstallFrom>
9 ^+ e8 O9 Z8 U% i0 G+ A            <MetaData>/ d. D2 }1 z- I3 V1 p( m( B
                <Key>/image/name</Key>
9 W4 ^# U8 M+ t6 q$ D                <Value>Windows 10 Enterprise</Value>1 b/ H. Z- q8 [4 A- h0 Z- P: u% K
            </MetaData>$ m/ U$ G( r, {! n0 J% k: Y7 `7 S
            </InstallFrom>            
* G+ A) m: g6 o7 c9 Z0 A                    <InstallToAvailablePartition>false</InstallToAvailablePartition>- H6 c5 e+ L, B
                    <Compact>false</Compact>
- h7 _& a# \. B                </OSImage>  d6 @+ ^# Y% M& U' S3 f
            </ImageInstall>% x# ~0 S+ d. a8 V9 A% c
            <UserData>
% Y, r( X! [' O$ U1 N                <AcceptEula>true</AcceptEula>
) c2 T4 H9 U( C/ Z! l                <FullName>Administrator</FullName>" s4 H/ l: @1 a) L
                <Organization>MyOrg</Organization>- g. c' D  c4 w/ Q4 u- x
                <ProductKey>( l) t2 r% Y: Z1 n/ Y3 H
                    <Key>1ProductKey</Key>! i- v" L# g; ?4 b) P: ~) m& E
                </ProductKey>
6 o2 \" E% J  Y, Z            </UserData>5 G; y( g7 o* M) D" J' U# I  Z9 |# d) d
            <EnableFirewall>true</EnableFirewall>3 G/ S9 t- I/ r. B7 G
            <DiskConfiguration>9 x  I5 ?/ `% z% |( m! p
                <Disk>
4 B( N' _! _' A  x3 x9 o" B2 }# c                    <CreatePartitions>: P4 B$ r% [3 y; d9 J
                        <CreatePartition>
0 }5 g9 r- H2 N) k- y                            <Size>500</Size>
6 }! k& h9 Y% C( X3 f                            <Order>1</Order>
+ v" M# N- U" x                            <Type>Primary</Type>: a4 K8 f# J4 e; i
                        </CreatePartition>0 `, z5 V8 X; Q
                        <CreatePartition>  |9 g9 |) g0 S; d/ Q# L  `
                            <Order>2</Order>
. K* H. k: ?* o1 J" c4 W  |( o                            <Extend>true</Extend>
' u, x7 A/ O: R, x' @! T7 R' [                            <Type>Primary</Type>
2 X: n7 ^1 G# R8 A  ]                        </CreatePartition>
0 M) a  R  n1 X1 r1 c; i4 }2 |                    </CreatePartitions>
4 D8 `! |8 G- T. _$ ~( B                    <ModifyPartitions>
% u; g: s$ |: K                        <ModifyPartition>
* T* ^, I' z3 V; C& }                            <Active>true</Active>
* Q- W) [+ s: Y& I! _6 k% ^                            <Extend>false</Extend>
' s; T$ m) j3 t: P7 z# b                            <Format>NTFS</Format>
, P8 e) a+ s6 V* ~/ r. m4 V                            <Label>System</Label>* r- J8 c- E  B7 P& `
                            <Order>1</Order>8 }4 K0 q4 H# @' C2 Z8 H$ Q/ W
                            <PartitionID>1</PartitionID>
3 H  v8 [$ j( u! t* Y& M3 Y                        </ModifyPartition>5 W% |/ o" J% }7 A% f: H
                        <ModifyPartition>
( R7 Q; E4 u- ^- }% @                            <Active>false</Active>
- a5 D" u, V0 [; l( K8 W                            <Extend>false</Extend>
, K: L, N& e; q7 m' @% n                            <Format>NTFS</Format>- V/ Q8 u$ g1 @) o3 B- D8 I. F& @
                            <Label>OS</Label>* J* Y0 {1 \6 C: a; C% @
                            <Letter>C</Letter>
. A. ~. F: g8 l6 @' P                            <Order>2</Order>
7 v+ R+ R9 [" }$ q- p" U: s                            <PartitionID>2</PartitionID>
* X2 I8 K: e. |- K( y$ r9 p                        </ModifyPartition>
7 h6 V  q, W# O- O6 I                    </ModifyPartitions>
$ Q6 f% f; y, [9 l/ E. I( J& |' l                    <DiskID>0</DiskID>& }9 r& y2 |1 b9 s  y5 W
                    <WillWipeDisk>true</WillWipeDisk>9 u% t0 U. h/ L) C1 M( a7 E
                </Disk>9 q) z9 |4 t5 E! D5 A& }; F# L
                <WillShowUI>OnError</WillShowUI>
% I- F, Q$ P' \& o. J            </DiskConfiguration>
) M! i+ x6 X0 }6 y$ {9 f        </component>
. ^) B% c* `2 _2 B( R9 c    </settings>3 Q* O( o9 y0 A# t
    <settings pass="offlineServicing">
* w. m+ l0 @$ W# g! p8 H        <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">4 Q6 _% g* `$ t% w& F% B2 Y
            <EnableLUA>false</EnableLUA>% b* Q; `) A2 t3 v" a5 v
        </component>
& @0 N; b5 r# ]" \/ ?* i+ {    </settings>! O: Z+ h% G- G  w; W
    <settings pass="generalize">: u+ s$ N, [* E2 g2 d( g
        <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">, h4 V& B+ t- Z9 o5 Z6 U) A, S
            <SkipRearm>1</SkipRearm>2 t5 X9 ?: ]9 z( p; w
        </component>' d6 B; e8 J: l0 t- a1 g& z: z
    </settings>, |% [) y! Q- b1 O5 E" {
    <settings pass="specialize">
* R, O- g; L. S: x3 r8 H( ~: W% 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">  `1 G! k" Y# w5 [" b6 U/ _
            <Identification>! x* e' |; [6 O& \7 W8 \
                <Credentials>  N6 K' I  }6 I
                    <Domain>1Domain</Domain>: y# H& s8 \8 U" d9 o& `
                    <Password>1DomainJoinPW</Password>
! X% R0 Q" `% S) q/ J6 B                    <Username>1DomainJoinAcct</Username>
% |2 g8 r" @; y( K0 j8 T' D5 E2 ]                </Credentials>
6 E: l% P3 u9 o/ y5 M1 L                <JoinDomain>1FQDN</JoinDomain>
5 U% K0 r/ X6 N6 ^                <MachineObjectOU>1OULocation</MachineObjectOU>
, w& W% ~8 T* J0 R                <DebugJoin>true</DebugJoin>
1 z) d0 h8 F2 f8 }            </Identification>! K4 z& _; k# o4 M7 O
        </component>5 d- _- N! k- v1 O# ~" J5 [: ?
        <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">& _$ X& w6 ]/ X! m' H
            <ComputerName>1ComputerName</ComputerName>
) b% \9 e) p. B- W5 ?; n( O  J' |            <AutoLogon>
# ?& J$ g" J# s( V, P$ b                <Password>
3 a: K0 a4 g; J7 _* f                    <Value>1AutoLogonPW</Value>. D8 r2 L1 [6 k# j* K
                    <PlainText>true</PlainText>" i9 `; v& \: P# F1 h) u; ~7 E) }
                </Password>
9 J: R8 ?/ b: ^4 S                <Enabled>true</Enabled>
& o) D7 E# G- P$ }- M& A                <Username>1AutoLogonAcct</Username>1 W* C" X4 b* K$ |% {
                <Domain>1Domain</Domain>
  p3 O$ q9 g" R4 w) ?6 K            </AutoLogon>
% Z+ [1 z" Z; U1 S" U( ^            <RegisteredOrganization>MyOrg</RegisteredOrganization>
7 a3 i9 A0 ^- b$ l% S) c            <RegisteredOwner>Administrator</RegisteredOwner>
- q! k, G) ?: P5 Q            <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>* m  @1 B1 J8 u8 S9 ]
            <TimeZone>Central Standard Time</TimeZone>
3 L, x$ q5 X: ?) w        </component>/ {; ?! m- ~' F" v. c
        <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">$ S# f- d# \7 {6 s/ v  o; M
            <IEHardenAdmin>false</IEHardenAdmin>$ T. W8 K: ]% f7 r5 ?/ e
            <IEHardenUser>false</IEHardenUser>" Y* F0 [( N3 W: v" b7 {9 K% Q* D
        </component>
+ C  p; n% n' r6 A/ y' d$ D2 b1 A    </settings>
4 B3 z& G/ e! S. }+ ?: F  P/ d. Z, u  ?    <settings pass="oobeSystem">
' z+ l' H/ N) w( Q- A9 w' 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 ">9 M5 e5 K7 }8 T# k5 F, b, s! X
            <OOBE>* A" ?: o6 Q/ O+ j+ Y% a, c
                <HideEULAPage>true</HideEULAPage>
* x3 |) U5 |$ n5 s% I' K                <HideLocalAccountScreen>true</HideLocalAccountScreen>2 A7 F  y6 P5 N: f4 h
                <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>5 I$ J8 N- o! r: G9 n# _' f* r
                <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
5 R: C; H' _+ Z8 c# `                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
1 l' V$ t  {3 @* O$ R1 S7 ?                <NetworkLocation>Work</NetworkLocation>
5 l1 J0 o+ e: ]8 P& X7 r                <ProtectYourPC>1</ProtectYourPC>
  Q: Z/ v- Y0 `3 R5 {                <SkipMachineOOBE>true</SkipMachineOOBE>. _# i" j$ q  C5 B* W2 c
                <SkipUserOOBE>true</SkipUserOOBE>' d+ z; s2 P4 L
            </OOBE>' r9 E" X6 S: v) S% t( U
            <LogonCommands>, g9 P# N9 z( C" ~. {& o
                <AsynchronousCommand>
/ A  w) [, p% T                    <CommandLine>powershell -NoLogo -ExecutionPolicy Bypass -File 1DeploymentScript</CommandLine>
. H2 ]' M* O7 I3 `  \5 f& J; |                    <Description>Installs components</Description>  ]0 E. F+ ~  o9 x. `# h7 R2 W
                    <Order>1</Order>
- J! q$ h% y$ x                </AsynchronousCommand>
& w1 a4 L6 \& p4 w( ~" a            </LogonCommands>
% E$ Y# Q. k- e: ]9 s0 P            <UserAccounts>2 Z/ W8 w4 ^0 q0 f6 d9 _# `7 U0 g
                <AdministratorPassword>
8 h# m) ~& I# h; A* \- j                    <Value>1LocalAdminPW</Value>8 a: f, v. Z4 R. e& |6 ?6 T/ b
                    <PlainText>true</PlainText>
- E$ T1 H8 q5 C( D                </AdministratorPassword>5 l3 @7 P; {) @& O, e( r
                <DomainAccounts>
  L5 V* m  U$ J2 y                    <DomainAccountList>7 g0 e! A7 ~; T; s( Y% l" D6 j' a
                        <DomainAccount>! r# _/ W% I0 I% {4 D' L
                            <Group>RemoteDesktopUsers</Group>
+ y% N; }- V. ]1 _6 ~                            <Name>Domain Users</Name>
; q5 m1 G% @0 L  E- F, Y                        </DomainAccount>6 g1 X" T+ S% F
                        <Domain>1Domain</Domain>9 _5 \& e: _% b5 F: I# F$ P; I
                    </DomainAccountList>; t. B' Y9 e/ o3 ]# p2 ~
                </DomainAccounts>
* E. e% b% o6 }. c0 v            </UserAccounts>
7 y* M# }3 C  R' J- ]3 f/ E        </component>1 R9 ~4 W" A; Z1 _
    </settings>& ?( F. o8 o$ B4 X1 U
</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"?>
) Z6 o' \  f4 E* M<unattend xmlns="urn:schemas-microsoft-com:unattend">1 Q) F! }! Z- b; p" e/ r3 m' I
    <settings pass="windowsPE">
3 N0 `* f% N2 Z        <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">" X8 a/ |( J4 V9 T) v; Q9 B9 l# [3 V
            <SetupUILanguage>9 y) n" c$ v( a( X" c
                <UILanguage>en-US</UILanguage>
0 I+ ~/ H- T6 c, z                <WillShowUI>Never</WillShowUI>
  x2 Z6 t7 o- K1 U            </SetupUILanguage>
: G$ T% D: G  N) N5 D            <InputLocale>en-US</InputLocale>
* M0 q- s2 u% `            <SystemLocale>en-US</SystemLocale>9 v" `/ L* d- U5 O* U; X, [7 ~
            <UILanguage>en-US</UILanguage>% b& T3 ?9 w: H" f! i, ~0 s% n
            <UserLocale>en-US</UserLocale>, x+ h9 T6 J4 t- Q
        </component>
' `! |7 Y# S0 n, f- }, E# |  J        <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">5 }$ Z  l1 l/ U  p5 F
            <UserData>  Y/ U6 v- q# W7 N+ d
                <AcceptEula>true</AcceptEula>
8 j7 l, }% H2 I. ^; Q* N0 ?                <ProductKey>
! I/ v  b5 z% d% t) [                    <Key>11111-22222-33333-44444-55555</Key>& h' @1 Y0 A9 u+ r2 K
                    <WillShowUI>Never</WillShowUI>& g0 i- n2 f* q5 L& H
                </ProductKey>5 s( p6 Q) c8 L7 g5 ^/ {
            </UserData>
( k  U" E) o" I; o: S            <EnableFirewall>true</EnableFirewall>; _' D) q4 ]! ]! I) q
        </component>
5 k, h9 ^( d5 p) O1 n" O0 Y8 b& R    </settings>
; H; B* \% B' J3 ~    <settings pass="specialize">
; o8 L# E9 T4 Q; [1 X        <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">
( l, }) D2 k; B8 n            <TimeZone>Central Standard Time</TimeZone>
& ~  ^# @* A2 p: D4 D        </component>( E/ Z4 L4 u4 F3 s% _3 k
    </settings>4 O+ \; _0 |5 \% W/ l6 `
    <settings pass="oobeSystem">! i0 Z/ c) G3 R6 B, ]
        <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">
0 w/ Y5 ?9 X1 `. ~- x/ F            <AutoLogon>
- j" X1 }4 x4 \                <Password>
5 }' G0 K# V2 o! Q7 P                    <Value>PASSWORD123!</Value>$ [3 v2 f# L6 J2 |* {( z$ U" r) O
                    <PlainText>true</PlainText>
6 N6 {! z( [0 J9 t4 H                </Password>/ M/ u- H" M8 G- z$ ?0 [# o
                <LogonCount>2</LogonCount>+ e0 J+ ]$ C) G0 G; s+ j" S
                <Username>Administrator</Username>
1 M" _" M) J% V                <Enabled>true</Enabled>5 V3 A9 x; B6 T" T8 M( u; `( ]
            </AutoLogon>
5 Q' Y6 s2 {# T4 ?# |/ Y            <UserAccounts>8 D1 }! o7 s) u( A8 x( @
                <AdministratorPassword>7 w- _. s' L* L  ?5 ~: ?
                    <Value>PASSWORD123!</Value>
3 H% h" R1 Z) g( ~% {0 I                    <PlainText>true</PlainText>
5 \! A( k( n! ^- j- j                </AdministratorPassword>
. h8 t  }4 g3 ]- c2 Q5 h            </UserAccounts>
! T6 [. Q/ u! k4 b& D3 n        </component>
7 _( g# v4 q& r    </settings>
6 Q" |9 x- n; H: g    <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" />9 ~) G8 g% ~4 z. M1 Z
</unattend>/ a$ C& [5 j7 n6 a4 \8 E2 k
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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