View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0014565||CentOS-7||grub2||public||2018-03-08 11:52||2018-03-08 19:45|
|Platform||VirtualBox 5.1.x and 5.2.x||OS||Microsoft Windows||OS Version||Windows 7 SP1|
|Target Version||Fixed in Version|
|Summary||0014565: CentOS 7.4  - boot problems in UEFI mode on VirtualBox 5.x|
|Description||Under VirtualBox, a CentOS-based VM will not boot in UEFI mode if the VM is shut down after installation. An initial boot (from install media) works fine, as does the first (and subsequent) boots from the hard disk. But, when the virtual machine is powered down and up again, the CentOS installation will fail to boot.|
|Steps To Reproduce||1) Create a new Linux VM in VirtualBox 5.2.8 (Red Hat Linux 64-bit, 4GB of memory, accept 8GB default disk size and type).|
2) Go to Settings -> System -> Extended Features, and tick the box "Enable EFI (special OSes only)". Select the boot media for the CD/DVD device.
3) Start the virtual machine, and install a minimal install of CentOS, with all the defaults (including default disk layout.)
4) When the install is finished, click the "Reboot" button, and observe that the system will boot in UEFI mode.
5) Shut the system down (either select ACPI Shutdown, or power-off the machine manually from the command line.)
6) Start the virtual machine back up again. Note that it will not boot - you will get the UEFI Interactive Shell, instead of GRUB.
|Additional Information||I also created a thread on the CentOS forum, here:|
|Tags||No tags attached.|
confirmed issue with virtualbox current implementation of UEFI. Nothing much we can do about it but provide the possible workarounds you have found in the centos and virtualbox forums.
virtualbox bug entry:
<cut/paste from the virtualbox forum: https://forums.virtualbox.org/viewtopic.php?f=3&t=87077>
RHEL 7.4 works with EFI boot after power cycle. CentOS 7.4 does not.
Postby Oliver Jones » 8. Mar 2018, 18:02
The workarounds, in order of opportunity and efficiency:
1) When installing, wait for the "Reboot" button to appear, then press Ctrl-Alt-F2 to get a shell, then enter:
cp -p /mnt/sysimage/boot/efi/EFI/centos/grubx64.efi /mnt/sysimage/boot/efi/EFI/BOOT/
Press Ctrl-Alt-F6 to return to the installer screen, then click the "Reboot" button to finish. The VM should now behave itself after future power cycles (real or virtual).
2) On first boot, sudo to (or login as) root, then enter:
cp -p /boot/efi/EFI/centos/grubx64.efi /boot/efi/EFI/BOOT/
The VM can be safely powered down after this point, and restarted again without further issues.
3) When the VM has been started again, and won't boot, wait until the VM automatically enters the UEFI Shell, then enter:
cp fs0:\EFI\centos\grubx64.efi fs0:\EFI\BOOT
The first line will copy the required file, making startup automatic in future. The second line will start GRUB2 for you, without requiring a further reboot.
4) When the VM has been started again, and won't boot, wait until the VM automatically enters the UEFI Shell, then enter:
Within the editor, add the following line:
Press F2 to save the file, press Enter to accept the default name [startup.nsh] and then press F3 to exit the editor. Either reboot or enter the last line of workaround 3 to start GRUB2 directly.
Thanks go to the CentOS forum's TrevorH, avij and owl102 for information leading to the first two workarounds (TrevorH), and the third workaround (direct tip from avij) and a link to the fourth workaround (direct tip from owl102, fourth tip written by AskUbuntu.com's emash.)