VMWare虚拟机迁移到Hyper-V

  • 格式:pdf
  • 大小:1011.79 KB
  • 文档页数:5

VMWare虚拟机迁移到Hyper-V

把VMWare的vmdk转为Hpper-V使用的vhd或vhdx文件

1、 如果之前动态分配的,需要先将磁盘合并

通常磁盘都分开储存

在cmd 中cd到VM安装目录C:\Program Files (x86)\VMware\VMware Workstation

执行以下命令:

vmware-vdiskmanager -r sourceDisk.vmdk -t 0 targetDisk.vmdk

2、 转换可使用工具包括Microsoft Virtual Machine Converter、winimage、StarWindConverter

Microsoft Virtual Machine Converter使用方法(推荐)

先安装MVMC,然后使用管理员方式启动Power Shell

导入模块:

Import-Module 'D:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1'

执行如下转换语句:

ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath "原文件地址" -DestinationLiteralPath "目录地址" -VhdType

DynamicHardDisk -VhdFormat Vhdx

最后的Vhdx应该也可以是Vhd,没验证过

Winimage使用方法

选择好文件,然后再选择保存位置即可得到一个vhd的磁盘文件

在Hpper-V中新建虚拟机,选择转换后的vhd或vhdx作为源

新建虚拟机,在最后的链接虚拟机步骤中选择使用现在有的虚拟硬盘

VMWare虚拟机迁移到Hyper-v虚拟机加载不了系统

总是进入 dracut 的 shell 里去。

症状:

[ OK ] Reached target Paths.

[ OK ] Reached target Basic System.

Starting File System Check on /dev/mapper/centos-root…

systemd-fsck[288]: fsck: error 2 (No such file or directory) while executing fsck.ext2 for /dev/mapper/centos-root

[ OK ] Started File System Check on /dev/mapper/centos-root

dracut-initqueue[250]: Warning: Could not boot

dracut-initqueue[250]: Warning: /dev/centos/root does not exist

dracut-initqueue[250]: Warning: /dev/centos/swap does not exist

dracut-initqueue[250]: Warning: /dev/mapper/centos-root does not exist

Starting Dracut Emergency Shell…

Warning: /dev/centos/root does not exist

Warning: /dev/centos/swap does not exist

Warning: /dev/mapper/centos-root does not exist

Generating “/run/initramfs/rdsosreport.txt”

处理方法:

1、 对刚刚新建的虚拟机添加DVD驱动器,用 CentOS 7 安装光盘启动,并在引导菜单中选择 troubleshooting

-> Rescue a Linux OS,之后选择1) continue 进入恢复命令行。

2、切换到要修复的系统根路径:cd /mnt/sysimage 然后 chroot .

3、备份一下之前的文件:

mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

4、重建 initramfs:

dracut -v /boot/initramfs-$(uname -r).img $(uname -r)

然后重启,并且选择最新的启动菜单进行系统。

CentOS 7 修改内核默认启动顺序

 步骤一:cat /boot/grub2/grub.cfg |grep menuentry命令查看当前操作系统有几个系统内

核所有的内核

 步骤二:grub2-editenv list命令查看系统当前的默认内核,也可以使用uname -r查看,当

前内核是4.1.12-94.3.9.el7uek.x86_64

 3

步骤三:使用命令grub2-set-default 'Oracle Linux Server (3.10.0-693.el7.x86_64 with

Linux) 7.4'设置默认启动内核为3.10.0

 4

步骤四:然后重启生效,查看内核是否变成3.10.0,如图内核已经修改