VirtualBox導入虛擬機后無法進入系統(tǒng)問題解決

本文寫于2022年05月17日,閱讀時請注意時效。

問題復現(xiàn)

問題出現(xiàn)在將一臺AMD電腦上的Arch Linux虛擬機導出為.ova格式后遷移到一臺Intel電腦時無法通過bootloader(grub)進入系統(tǒng)而是出現(xiàn)EFI Shell界面。后續(xù)查明為grub的問題,所以該方案對于其他發(fā)行版、CPU、VirtualBox版本大概也適用。

問題截圖如下:

efi-shell

問題解決

無需重裝grub,只要在問題系統(tǒng)中重新設置一遍grub即可。步驟如下

  1. 使用系統(tǒng)鏡像啟動,將各硬盤分區(qū)mount

  2. 使用arch-chroot進入問題系統(tǒng)(其他發(fā)行版使用自己特定的命令即可,大多是chroot

  3. 執(zhí)行如下命令重新配置grub:

    grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
    grub-mkconfig -o /boot/grub/grub.cfg
    
  4. umount之后重啟即可

解決過程的命令行如下:

root@archiso ~ # mount /dev/sda2 /mnt
root@archiso ~ # mount /dev/sda1 /mnt/boot
root@archiso ~ # arch-chroot /mnt
[root@archiso /]# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
Installing for x86_64-efi platform.
Installation finished. No error reported.
[root@archiso /]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  amd-ucode.img initramfs-linux-fallback.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
[root@archiso /]# exit
exit
root@archiso ~ # umount -R /mnt
root@archiso ~ # reboot now

可以看到我系統(tǒng)里安裝了amd-ucode,是不影響的。我還嘗試了安裝intel-ucode,問題并沒有得到解決。

在虛擬機中是無法使用*-ucode的,可以參考Microcode - ArchWiki

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容