www.cnblogs.com/ruiyqinrui

开源、架构、Linux C/C++/python AI BI 运维开发自动化运维。 春风桃李花 秋雨梧桐叶。“力尽不知热 但惜夏日长”。夏不惜,秋不获。@ruiY--秦瑞

python爬虫,C编程,嵌入式开发.hadoop大数据,桉树,onenebula云计算架构.linux运维及驱动开发.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  2912 随笔 :: 9 文章 :: 51 评论 :: 185万 阅读

Converting a VMware Workstation virtual machine to KVM

In this tutorial, I’ll show you the step by step procedure to convert the vmware machine into kvm, during this conversation, I have faced some issues, which I’ll also share with you along with solution.

Before converting the vmware machine,I strongly recommend removing the vmware tools and any existing snapshots of the virtual machine.Then, on the windows machine, convert this multi-file image into a single image:

cd "C:\Program Files (x86)\VMware\VMware Workstation"
vmware-vdiskmanager.exe -r "D:\VMWare\winxplite\XP-Lite.vmdk" -t 0 "D:\VMWare\winxplite\winxp.vmdk"

1

Note: Please change the path of vmdk file according to your requirement.

Copy this new vmdk file to the Linux box using WinSCP:

2

Next, convert the transfered image file (vmdk) into qcow2 format:

qemu-img convert winxp.vmdk -O qcow2 winxpvm.img

3

Move the qcow2 image to the /var/lib/libvirt/images/ directory and check the permission:

mv winxpvm.img /var/lib/libvirt/images/ 
cd /var/lib/libvirt/images/ 
ls -l

4

Start virt-manager by running the virt-manager command,click New to create a new guest.In the Virtual Machine Name window, enter a name for your guest. In this example, the virtual machine is named winxpvm and also select the “import existing disk image“. Click Forward.5

Click on “Browse” button:

6

Locate the qcow2 image that we have converted above and select it:

7

Next,choose the amount of RAM and number of virtual CPUs allocated to the guest:

8

In the Summary window, verify the settings for creating the guest. When you are satisfied, click Finish.

9

Right click on the newly created virtual machine and select Run:

10

After boot, I got the (0x0000007B) BLUE SCREEN OF DEATH (BSOD):

11

Shutdown the Machine:

12

The main reason for BSOD problem is that most VMware Windows images are installed on SCSI virtual disk  but KVM requires IDE device driver for converted images. To solve this problem, copy the MergeIDE.reg text from the below mentioned URL:

https://github.com/TJC/kvm-ievms/blob/master/MergeIDE.reg

13

Create a new file:

nano mergeide.reg

14

Paste the text inside it that we have copied from the above link:

15

Install all libguestfs related packages:

yum install qemu-img '*libguestfs*'

16

Now, we need to merge the mergeide.reg with the VM using virt-win-reg command:

virt-win-reg --merge winxpvm mergeide.reg

17

Note: You must not use virt-win-reg with the –merge option on running virtual machines. If you do this, you will get irreversible disk corruption in the VM.

Start the VM from the virt-manager again:

18

This time, virtual machine will boot successfully :-)

19

Enjoy :-)

Hope this will help you!

Please Remember me in your prayers!

 

posted on   秦瑞It行程实录  阅读(684)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
历史上的今天:
2014-08-12 轻量级开源嵌入式关系数据库sqlite基本使用及接口初识
2014-08-12 euctb
2014-08-12 virsh 基于xml create VMs虚机
2014-08-12 嵌入式项目数据解决方案之sqlite
2013-08-12 C语言中字符串存储方法
2013-08-12 C基本语句和运算符
www.cnblogs.com/ruiyqinrui
点击右上角即可分享
微信分享提示