VirtualBox導(dǎo)入虛擬機(jī)后無(wú)法進(jìn)入系統(tǒng)問題解決

本文寫于2022年05月17日,閱讀時(shí)請(qǐng)注意時(shí)效。

問題復(fù)現(xiàn)

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

問題截圖如下:

efi-shell

問題解決

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

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

  2. 使用arch-chroot進(jìn)入問題系統(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,問題并沒有得到解決。

在虛擬機(jī)中是無(wú)法使用*-ucode的,可以參考Microcode - ArchWiki

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

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

  • 安裝教程 前期準(zhǔn)備 安裝介質(zhì) 在安裝之前我們先要準(zhǔn)備一個(gè)安裝介質(zhì),在這里只推薦U盤作為安裝介質(zhì)。 到https:/...
    Otis4631閱讀 5,637評(píng)論 0 5
  • Gentoo是一個(gè)非常著名的發(fā)行版,在Linux高手中非常流行。之前我也是被Gentoo的威名震懾了,所以一直沒有...
    樂百川閱讀 5,819評(píng)論 3 2
  • 寫在前面 本文首發(fā)于我的博客 更新修改的內(nèi)容第一時(shí)間不會(huì)同步到簡(jiǎn)書,敬請(qǐng)各位移步博客原文https://www.v...
    viseator閱讀 5,672評(píng)論 4 33
  • archlinux+kde桌面安裝 網(wǎng)上看到很多教程,也沒有真正適合自己的,畢竟要自己踩一下坑才能安裝好,以下為安...
    飛行員阿越閱讀 1,538評(píng)論 0 3
  • 系統(tǒng)安裝過程 MBR:isolinux/boot.cat stage2: isolinux/isolinux.bi...
    毛利卷卷發(fā)閱讀 876評(píng)論 0 1

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