当前位置:网站首页>如何迁移virtualbox 的虚拟机到hype-v
如何迁移virtualbox 的虚拟机到hype-v
2022-06-23 05:34:00 【Ti-laser】
简介:迁移virtualbox虚拟机核心工作就是虚拟盘格式迁移到hyper-v支持的格式上,本身操作比较简单,但是如果遇到boot方式不对应则需要手动修正,否则无法正常启动。
迁移流程:
*virtualbox 下把虚拟机处于关闭状态(非停止),在命令行下运行下面命令:
VBoxManage.exe clonehd --format vhd "C:\temp\VM\src-disk.vmdk" "C:\temp\VM\target-disk.vhd"
其中src-disk.vmdk为virtualbox 创建好的虚拟盘,而目标文件target-disk.vhd是hyper-v支持的格式

*启动hyper-v新建一个虚拟机,在进入连接虚拟硬盘环节选择你刚转换的虚拟硬盘:

*顺利的话即可启动新虚拟机。
无法启动故障分析:
现象:屏幕只是一个光标闪烁,连ubuntu的grub菜单都不出现,则可能是hyper-v和虚拟盘配置的启动方式不对造成。
解决方法:
检查当下hyper-v方式方法:
关闭系统,hyper-v从ubuntu iso 启动并进入ubuntu光盘演示模式。
在演示模式命令行下面输入
sudo efibootmgr -v
如果出现 "EFI variables are not supported on this system",意味着hype-v当前是处于早期的bios mbr启动模式,否则就是UEFI引导模式。
我的hyper-v是mbr引导模式。
提示,创建hyper-v时候选择代数就是影响启动模式(虽然我的虚拟机是uefi模式,但是创建磁盘时候hyper-v 禁止我选择该模式):

输入fdisk -l检查当前系统的boot模式。对我的虚拟机,虚拟盘是两个分区,其中一个分区属于uefi,另外一个是主系统区域,即在virtualbox里面安装的系统是uefi引导而hyper-v是采用bios mbr引导,两者不一致导致系统无法加载。
由于hyper-v并不支持修改引导模式,故需要把ubuntu系统切到老的bios引导模式。
方法如下(继续在光盘演示模式下):
运行GParted ,删除uefi分区,并创建一个标识为bios_grub的未格式化分区,可以用fdisk 修改分区类型为4 (bios boot类型),分区不要少于1M
然后依次运行下面命令(其中sda2要依据fdisk输出来调整):
mount /dev/sda2 /mnt/
mount -t proc none /mnt/proc
mount -o bind /dev /mnt/dev
mount -t sysfs sys /mnt/sys
chroot /mnt/ /bin/bash
update-grub
/usr/sbin/grub-install --recheck --no-floppy /dev/sda
重新启动,正常情况下grub会出现,启动过程中会进入紧急修复模式,这是因为删除uefi分区导致,可以用vi编辑器注释掉/etc/fstab里面对应分区的挂接,对我的系统是一个id 为747f-1e42的分区。

重启后即可正常进入系统,不要忘记卸载掉virtualbox的无用的插件:
sudo vbox-uninstall-guest-additions
边栏推荐
- VS2013 FFMPEG环境配置及常见错误处理
- Kubesphere offline deployment without network environment
- Haas 506 2.0 Tutoriel de développement - bibliothèque de composants avancés - modem. SMS (ne prend en charge que les versions supérieures à 2,2)
- Phpstudy set 301 redirection
- 20220621 Three Conjugates of Dual Quaternions
- Qt使用多线程编译项目的方法
- 30 data visualization tips that can not be ignored
- C# wpf 附加属性实现界面上定义装饰器
- Plot+seaborn+folium: a visual exploration of Abbey's rental housing data
- XShell7 下载
猜你喜欢

Network architecture from Wan to sd-wan edge devices

Day_ 11 smart communication health project - graphic report and poi Report

中台库存中的实仓与虚仓的业务逻辑设计
Link of Baidu URL parameter? Research on URL parameter encryption and decryption (code example)

Docker practice - redis cluster deployment and micro service deployment project

杂七杂八的东东

idea的去除转义的复制粘贴

20220621 Dual Quaternion

Laravel log channel 分组配置

图解 Google V8 # 17:消息队列:V8是怎么实现回调函数的?
随机推荐
Illuminate\support\collection de duplication unique list de duplication
开源生态|超实用开源License基础知识扫盲帖(下)
【已解决】“The Unity environment took too long to respond. Make sure that :\n“
问题:访问组件中数据object(定义的数据)中属性也为object对象中的属性时,报错现象
Smart port: how to realize intelligent port supervision based on the national standard gb28181 protocol easygbs?
Softing dataFEED OPC Suite将西门子PLC数据存储到Oracle数据库中
Topic35——34. 在排序数组中查找元素的第一个和最后一个位置
什么是客户体验自动化?
Link of Baidu URL Parameters? Recherche sur le chiffrement et le décryptage des paramètres d'URL (exemple de Code)
Network architecture from Wan to sd-wan edge devices
快速认识 WebAssembly
phpStudy设置301重定向
如何实现与FDA保持邮件通信安全加密?
Vs+qt project transferred to QT Creator
Day_ 03 smart communication health project - appointment management - inspection team management
C language removes line breaks (or other characters) at the end of strings
Termux
MySQL5.6 (5.7-8) 基于shardingsphere5.1.1 Sharding-Proxy模式读写分离
English语法_副词 - ever / once
从 WAN 到 SD-WAN 边缘设备的网络架构