简体   繁体   English

用 windows 10 更改 kvm qcow2 文件

[英]Change kvm qcow2 file with windows 10

I have a qcow2 file that contains windows 10. The operating system is RHEL8.2.我有一个包含 windows 10 的 qcow2 文件。操作系统是 RHEL8.2。 The virtualization stack is kvm, qemu, virt-viewer.虚拟化栈是kvm、qemu、virt-viewer。 And the command line used to manipulate the virtual machine is 'virsh'.用于操作虚拟机的命令行是“virsh”。

I need to update the windows drivers and kernel, change some registry, uninstall some applications, add things to the task scheduler and more.我需要更新 windows 驱动程序和 kernel,更改一些注册表,卸载一些应用程序,将内容添加到任务调度程序等等。

My question, is what is the best process to acheive this?我的问题是,实现这一目标的最佳过程是什么? Is the result should be a new qcow2 file?结果应该是一个新的 qcow2 文件吗? Are there changes required for the xml configuration file of the virtual machine?虚拟机的xml配置文件是否需要修改?

There are 2 modes of editing the virtual machine, online and offline.编辑虚拟机有两种模式,在线和离线。 The difference is if the virtual machine is running during the edit or not.区别在于虚拟机是否在编辑期间运行。 What mode is best to perform the task described above?哪种模式最适合执行上述任务?

As I understand, snapshots are stored inside the qcow2 file, and then the user needs to pick between them.据我了解,快照存储在 qcow2 文件中,然后用户需要在它们之间进行选择。 The users, on the system I am working on, are not aware they run on virtual machines, so I can not use this path, unless I am missing something.我正在使用的系统上的用户不知道他们在虚拟机上运行,所以我不能使用这条路径,除非我遗漏了什么。

Also there is the 'managedsave' and 'save' commands for virsh, but they don't create a new qcow2 file, and I don't think that the commands are meant for it.还有用于 virsh 的 'managedsave' 和 'save' 命令,但它们不会创建新的 qcow2 文件,而且我不认为这些命令是为此而生的。

Finally I found that the qcow2 file can be mounted as a device, perform changes in it, and unmount it.最后我发现qcow2文件可以作为设备挂载,在里面进行修改,然后卸载。 But then how can I uninstall applications and more in this way?但是,我怎样才能以这种方式卸载应用程序等等呢?

Thank you!谢谢!

All the changes you described (update the windows drivers and kernel, change some registry, uninstall some applications, add things to the task scheduler and more) affect only the guest disk - qcow2 file, and guest memory.您描述的所有更改(更新 windows 驱动程序和 kernel,更改一些注册表,卸载一些应用程序,将内容添加到任务调度程序等等)仅影响来宾磁盘 - qcow2 文件和来宾 ZCD69B4957F098CD8191ZBF8CD8191ZBF3。

You can run the guests, do these changes and power off.您可以运行客人,进行这些更改并关闭电源。 All changes will be saved to the guest disk.所有更改都将保存到来宾磁盘。 When instead of poweroff you will suspend the guests, some of the changes can be saved in guest memory.当您将暂停客人而不是关机时,一些更改可以保存在客人 memory 中。

There are no changes needed for the xml configuration file of the virtual machine, no new qcow2 files will be created.虚拟机的 xml 配置文件无需更改,不会创建新的 qcow2 文件。

Yes, snapshots are stored inside the qcow2 file, but since you have a copy, you dont need to create snapshots.是的,快照存储在 qcow2 文件中,但是由于您有副本,因此不需要创建快照。 Also no need for 'managedsave' and 'save' commands.也不需要“managedsave”和“save”命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM