Windows 虚机镜像制作

标签: vm windows

windows镜像制作:(使用virt-manager)

准备:

windows10镜像 & virtio-win 驱动盘

规格配置:

raw格式,存储至少30G
至少2CPU,否则安装系统时会卡住
安装前更改配置,将磁盘接口改为 virtio,并增加CDROM存储挂载 virtio-win驱动盘,以备安装程序识别磁盘。

安装:

安装时点击加载驱动程序,自动扫描,安装w10(win10)驱动

Post Install:

安装完成后

1. 按 https://superuser.com/questions/1453790/how-to-move-the-recovery-partition-on-windows-10 此链接调整recovery分区

tldr:
An example how to move Recovery Partition to OS Partition
diskpart

DISKPART> list volume

Volume ### Ltr Label Fs Type Size Status Info


Volume 0 System Rese NTFS Partition 500 MB Healthy System
Volume 1 C Windows11 NTFS Partition 58 GB Healthy Boot
Volume 2 NTFS Partition 617 MB Healthy Hidden

DISKPART> select volume 2
DISKPART> assign letter=F
DISKPART> list volume

Volume ### Ltr Label Fs Type Size Status Info


Volume 0 System Rese NTFS Partition 500 MB Healthy System
Volume 1 C Windows11 NTFS Partition 58 GB Healthy Boot
Volume 2 F NTFS Partition 617 MB Healthy Hidden

DISKPART> exit

xcopy F:\Recovery C:\Recovery /E /H /I
ReAgentc /info

Windows Recovery Environment (Windows RE) and system reset configuration
Information:

Windows RE status: Enabled
Windows RE location: \?\GLOBALROOT\device\harddisk2\partition3\Recovery\WindowsRE
Boot Configuration Data (BCD) identifier: b4c3cf2d-1282-11ed-b4c8-b90a37105c4b
Recovery image location:
Recovery image index: 0
Custom image location:
Custom image index: 0

ReAgentc /disable
ReAgentc /setreimage /path C:\Recovery\WindowsRE /target C:\Windows

ReAgentc /enable
ReAgentc /info

Windows Recovery Environment (Windows RE) and system reset configuration
Information:

Windows RE status: Enabled
Windows RE location: \?\GLOBALROOT\device\harddisk2\partition2\Recovery\WindowsRE
Boot Configuration Data (BCD) identifier: b4c3cf2f-1282-11ed-b4c8-b90a37105c4b
Recovery image location:
Recovery image index: 0
Custom image location:
Custom image index: 0
NOTE: Observe that “partition3” changed to “partition2”

# delete a Recovery Partition

diskpart

DISKPART> list volume

Volume ### Ltr Label Fs Type Size Status Info


Volume 0 System Rese NTFS Partition 500 MB Healthy System
Volume 1 C Windows11 NTFS Partition 58 GB Healthy Boot
Volume 2 F NTFS Partition 617 MB Healthy Hidden

DISKPART> select volume 2
DISKPART> detail partition

Partition 3
Type : 27
Hidden: No
Active: No
Offset in Bytes: 83763396608

Volume ### Ltr Label Fs Type Size Status Info


* Volume 2 F NTFS Partition 617 MB Healthy Hidden

DISKPART> delete partition override
DISKPART> exit

2. 打开virtio磁盘驱动盘

- 安装驱动选择全部
- 安装guest agent

3. 如果鼠标依然不跟随,see here: https://unix.stackexchange.com/questions/555082/host-mouse-pointer-not-aligned-with-guest-mouse-pointer-in-qemu-vnc

4. kms激活