怎样从vmware的vmdk转还到kvm可以启动的磁盘格式

The vmware system consists of two disks in raw format: the old boot diskand the second one. It is Windows 2000 Server guest OS.

  1. Create empty new boot image (use dd).
  2. Boot stand alone OS from any other disk with old boot disk and new boot image connected (that is at least 3 disks).
  3. Sign up, make partition and format the new disk (do not make volume).
  4. xcopy /e /c /r /h /k /o /x /y old_boot_disk:\ new_boot_disk:\
  5. Copy boot.ini from new boot disk to the second one (that is not boot disk).
  6. Edit boot.ini on the second disk to boot from rdisk(1)
  7. Swap disks: new <-> second.
  8. Boot setup from CD and go on Repair Procedure (after licence agreement) for the new boot disk.
  9. fdisk new boot image and toggle Boot flag.
  10. Swap disks back: second <-> new.
  11. Boot from the new disk.
  12. Remove vmware tools and devices.
  13. Reboot and be happy.

That's all.

P. S. To swap disks and edit boot.ini (items 5,6,7,10) should be excludedif the boot disk is named C:, that is right in most cases. Those items arefor strange case, when boot disk is D: and second one is C:.

 


Starting at v0.12, Qemu-kvm has native support to VMware's disk images v6 (seems to be compatible with v7, used by VMware Server). So VMware images can could be run with Qemu-kvm without any modification (make backups and do it at your own risks though !).

Look at your VMX configuration file:

  • scsi0:0.fileName = "zimbra-000001.vmdk"
  • uuid.bios = "56 4d 3f 3d 32 80 5b f2-94 31 21 c9 b2 c3 93 b9"
  • ethernet0.generatedAddress = "00:0c:29:c3:93:b9"

And then build the command-line:

kvm -drive file=zimbra-000001.vmdk,boot=on \
-net nic,macaddr=00:0c:29:c3:93:b9 -net tap \
-uuid 564d3f3d-3280-5bf2-9431-21c9b2c393b9

The UUID is optional, but might be useful for applications using it for validation (i.e. Windows), and the MAC address as well.

Second way could be to convert the disk image:

kvm-img convert -O qcow2 zimbra-000001.vmdk zimbra.qcow2

1.安装kvm,即yum install kvmkvm-kmod

 


2.利用qemu-img命令进行格式转换:
qemu-img convert-O qcow2 政法委系统.vmdkdisk.qcow2
转换成qcow2格式的磁盘(大写的o)


3.利用kvm命令启动该磁盘:
kvm-m 512 -drive file=disk.qcow2,boot=on -netnic
其中-m指定内存大小,-net指定网卡。
kvm命令的参数很多,可以mankvm一下,添加需要的参数。


4.在咱们的系统上如果运行kvm命令有错误的话,可以运行以下命令:
ln–s /usr/libexec/qemu-kvm /usr/bin/kvm

 

http://www.linux-kvm.org/page/How_To_Migrate_From_Vmware_To_KVM

转载于:https://www.cnblogs.com/chinacloud/archive/2010/12/09/1901096.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值