- Joined
- Feb 15, 2014
- Messages
- 20,194
What's keeping you?Is there a way to install rancherOS via the VM tab?
What's keeping you?Is there a way to install rancherOS via the VM tab?
i tried it a couple times and it did not work :DWhat's keeping you?
passwd root
su root
mkdir /boot/efi/EFI/BOOT
cp /boot/efi/EFI/ubuntu/grubx64.efi /boot/efi/EFI/BOOT/bootx64.efi
There have been a number of threads were people have failed to boot a Linux VM after the installation phase using the webUI of FreeNAS 11 nightly, finding themselves stuck in the EFI shell and not knowing how to proceed nor how to avoid this happening each time their VM is started.
It has been sugested elsewhere that this is due a grub error, or a grubx64.efi file which is missing or in the wrong place, or you must create a startup.nsh file or change the boot order in the EFI shell. If your Linux install depends on grub and it has completed successfully, creating the correct EFI partition (ESP) and grubx64.efi file, then none of these suggestions are correct.
Creating a VM via the webUI in FreeNAS 11 converts to a bhyve command in the backend, saving you from using a complex string of commands at the CLI e.g:
bhyve -c 4 -m 768M -HAP \
-s 0,hostbridge \
-s 3,ahci-cd,firmware-8.7.1-amd64-netinst.iso \
-s 4,ahci-hd,debianbox.img \
-s 5,virtio-net,tap1 \
-s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \
-s 31,lpc -l com1,stdio \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
debtest
The file /usr/local/share/uefi-firmware/BHYVE_UEFI.fd provides byve with the firmware to support UEFI guests, this function is based on the OVMF tianocore project which is also used as the basis of VirtualBox's virtual machine UEFI support. The bhyve UEFI firmware conforms to the known “Default Boot Behaviour” and looks for the file \EFI\BOOT\boot64.efi in the EFI partition of your VM. If it's not present you end up in the EFI shell.
One simple remedy is to create this \EFI\BOOT\boot64.efi file in your VM, which is straight forward once your VM has booted.
But how do you boot your VM if you find yourself in the EFI shell at first? Just type exit at the shell prompt, and in the EFI menu system navigate to "Boot Maintenance Manager" and then select "Boot from file" to locate and select your grubx64.efi file.
As root, cd to the /boot/efi/EFI directory of your VM in order to create the new BOOT directory and copy the existing grubx64.efi to /EFI/BOOT/bootx64.efi. The end result should look like this, using Ubuntu as an example:
root@ubuntu-vm:/boot/efi# tree -L 3 .
.
└── EFI
├── BOOT
│ └── bootx64.efi
└── ubuntu
├── fbx64.efi
├── grub.cfg
├── grubx64.efi
├── mmx64.efi
└── shimx64.efi
3 directories, 6 files
root@ubuntu-vm:/boot/efi#
The file bootx64.efi is a copy of the grubx64.efi in your VM.
NB: If grubx64.efi gets updated you will need to re-create bootx64.efi
Half a fix. When you get placed in the interactive shell type exit. Then choose "Boot Maintenance Manager" -> "Boot From File" -> Choose "No Volume Label" -> "EFI" -> "redhat" -> "grub.efi"
Now you can also add a boot entry if you wish, and change the boot order. I save the config but it seems to get wiped upon reboot or shutdown. Shame, thought I'd nailed it :-/
I would suggest putting this into the FreeNAS documentation - it is both fairly common and pretty difficult to troubleshoot for someone unfamiliar with how the EFI boot process works (which is hardly required for FreeNAS operation).There have been a number of threads were people have failed to boot a Linux VM after the installation phase using the webUI of FreeNAS 11 nightly, finding themselves stuck in the EFI shell and not knowing how to proceed nor how to avoid this happening each time their VM is started.
The file /usr/local/share/uefi-firmware/BHYVE_UEFI.fd provides byve with the firmware to support UEFI guests, this function is based on the OVMF tianocore project which is also used as the basis of VirtualBox's virtual machine UEFI support. The bhyve UEFI firmware conforms to the known “Default Boot Behaviour” and looks for the file \EFI\BOOT\boot64.efi in the EFI partition of your VM. If it's not present you end up in the EFI shell.
One simple remedy is to create this \EFI\BOOT\boot64.efi file in your VM, which is straight forward once your VM has booted.
A typo, Guilty as charged. Anyone can do it, like 'direction ' instead of 'directory'. :)The file names are wrong - should be bootx64.efi. (they're correct in the direction listing below that passage.)
It is not permanent as for every ubuntu install we have to do a copy of this grubx64.efi to bootx64.efi and for every update for Grub as well. So not permanent at all.In what way is this fix not permanent?
sudo apt-mark hold grub
I suggest ubuntu change their EFI boot to the standard.I would suggest putting this into the FreeNAS documentation - it is both fairly common and pretty difficult to troubleshoot for someone unfamiliar with how the EFI boot process works (which is hardly required for FreeNAS operation).
I suggest ubuntu change their EFI boot to the standard.
$ ls -lR /boot/efi
/boot/efi:
total 4
drwxr-xr-x 5 root root 4096 Jul 8 10:12 EFI
/boot/efi/EFI:
total 12
drwxr-xr-x 2 root root 4096 Jul 10 12:11 Boot
drwxr-xr-x 3 root root 4096 Jul 8 10:12 Microsoft
drwxr-xr-x 3 root root 4096 Jun 29 12:09 ubuntu
/boot/efi/EFI/Boot:
total 120
-rwxr-xr-x 1 root root 121856 Jul 10 12:11 bootx64.efi
-rwxr-xr-x 1 root root 0 Jul 10 12:11 bootx64.efi.grb
/boot/efi/EFI/Microsoft:
total 4
drwxr-xr-x 2 root root 4096 Jul 10 12:11 Boot
/boot/efi/EFI/Microsoft/Boot:
total 240
-rwxr-xr-x 1 root root 121856 Jul 10 12:11 bootmgfw.efi
-rwxr-xr-x 1 root root 0 Jul 10 12:11 bootmgfw.efi.grb
-rwxr-xr-x 1 root root 121856 Jul 10 12:11 bootx64.efi
-rwxr-xr-x 1 root root 0 Jul 10 12:11 bootx64.efi.grb
/boot/efi/EFI/ubuntu:
total 2484
drwxr-xr-x 2 root root 4096 Jun 29 12:08 fw
-rwxr-xr-x 1 root root 65544 Jun 29 12:08 fwupx64.efi
-rwxr-xr-x 1 root root 126 Jul 8 10:32 grub.cfg
-rwxr-xr-x 1 root root 122368 Jul 29 22:08 grubx64.efi
-rwxr-xr-x 1 root root 1168464 Jul 8 10:32 mmx64.efi
-rwxr-xr-x 1 root root 1169992 Jul 8 10:32 shimx64.efi
/boot/efi/EFI/ubuntu/fw:
total 0