[HOWTO] How-to Boot Linux VMs using UEFI

anderstn

Dabbler
Joined
Oct 2, 2017
Messages
41
Just a quick question. Is the orgiginal file made by ubuntu ever altered and if it is will using a symbolic link (soft or hard) work as a means of keeping the two files in sync.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
Just a quick question. Is the orgiginal file made by ubuntu ever altered and if it is will using a symbolic link (soft or hard) work as a means of keeping the two files in sync.

IIRC you can't hard link across partitions ( in this case ESP and wherever /boot is) and the way UEFI works and the initrd is built means this wouldn't work.

Rather than add bootx64.efi manually, just use this CLI command as root:

grub-install --efi-directory=/boot/efi --boot-directory=/boot --removable

That will create the fallback efi files you need and should survive a grub update.
 

varg86

Cadet
Joined
Feb 11, 2017
Messages
6
Hi,

i´ve tried to fix the problem like discribed in post #1, but do not have any clue where the efi files for my vm are stored.

I´d like to install Sophos UTM Home on my Freenas, but every other ISO does not work.
Also the "Exit" and bootfile method does not work.
Please be gentle, I normally work with Windows Clusters and my Linux skills are really rusty.
 

Rybena

Dabbler
Joined
Jun 25, 2017
Messages
32
Hi,

i´ve tried to fix the problem like discribed in post #1, but do not have any clue where the efi files for my vm are stored.

I´d like to install Sophos UTM Home on my Freenas, but every other ISO does not work.
Also the "Exit" and bootfile method does not work.
Please be gentle, I normally work with Windows Clusters and my Linux skills are really rusty.
Have you watched the video a few posts up?
 

varg86

Cadet
Joined
Feb 11, 2017
Messages
6
i´ve opened it bud forrgot to watch it. shame on me :( .
But now i´ve watched it. He jumps to the boot maintanance Manager->boot from file, but I tried to navigate there yesterday but nothing moves. how does he navigate in there, I don´t get it. If it is that simple, i would try this. thanks for the hint :)
 
Last edited:

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
i´ve opened it bud forrgot to watch it. shame on me :( .
But now i´ve watched it. He jumps to the boot maintanance Manager->boot from file, but I tried to navigate there yesterday but nothing moves. how does he navigate in there, I don´t get it. If it is that simple, i would try this. thanks for the hint :)

Navigation is by normal arrow keys, but do you even know if "Sophos UTM Home" boots under UEFI at all? Have you actually been able to create and install "Sophos UTM Home" in a virtual machine? If so, an alternative workaround for UEFI issue would be to boot from a "refind iso" in a virtual CD-ROM attached to your vm. Use the iso in this file: https://sourceforge.net/projects/refind/files/0.11.2/refind-cd-0.11.2.zip/download
 

varg86

Cadet
Joined
Feb 11, 2017
Messages
6
So I´ve tried the navigation with the arrowkeys, but i can´t access the menue like in the video, therefore i cant get to the grub file. maybe inject it to the iso i want to boot?

Ive also tried the rEFInd, boots up like charm, but what now?

Opensense boots up like normal.

€:

Sophos UTM can be installed on:
  • VMware ESX 5.1
  • VMware ESX 5.5-6.5
  • Microsoft HyperV 2008 R2
  • KVM 1.0 kernel 3.2.0-29-generic (Ubuntu 12.04 LTS)
  • Citrix XenServer 6.0 Enterprise
  • HyperV 3.5 2012 R2
 
Last edited:

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
So I´ve tried the navigation with the arrowkeys, but i can´t access the menue like in the video, therefore i cant get to the grub file. maybe inject it to the iso i want to boot?

Ive also tried the rEFInd, boots up like charm, but what now?

Opensense boots up like normal.

€:

Sophos UTM can be installed on:
  • VMware ESX 5.1
  • VMware ESX 5.5-6.5
  • Microsoft HyperV 2008 R2
  • KVM 1.0 kernel 3.2.0-29-generic (Ubuntu 12.04 LTS)
  • Citrix XenServer 6.0 Enterprise
  • HyperV 3.5 2012 R2

I don't understand what question you are asking.

You still have not explained what VM, if any, you had installed and are were trying to fix. Have you found out for sure if your Spohos UTM iso supports UEFI booting ? The list you've posted is for out of data software, and I wouldn't be at all surprised if your Spohos iso does not support UEFI, in which case you'll have to use grub booting with iohyve which is done via the CLI in FreeNAS. Have a look at this:

https://www.youtube.com/watch?v=rCDh9K16Q5Q
 

varg86

Cadet
Joined
Feb 11, 2017
Messages
6
Good morning.

I haven´t installed any VM to this Point because I was trying the sophos Firewall.iso
But after the rEFInd.iso worked, I tried to boot a OPNsense Firewall. And that worked.

If Sophos is UEFI Bootable, yes.
I found this in the Sophos Forums.

However, as far as my research suggests, the boot loader on the UTM ISO-image is 32bit only.

Given that, it will only work on machines running a 32 bit bios or on machines with a 64 bit EFI BIOS but supporting legacy mode. It will not run an 64 bit only EFI BIOSes which do not support legacy mode. Unfortunately, my device is such a thing :)

So the restriction is not the 64 bit architecture of the UTM but the little tiny bit of software used to boot up.

Thanks for the ioHyve Video, i´ll try that, maybe this works, otherwise I have to use an other piece of Software.
 

KevDog

Patron
Joined
Nov 26, 2016
Messages
462
I've been following this discussion. I'm unfortunately using freenas 9.10 unstead of 11. I see the option within my iohyve install to add a device -- such as a cd-rome I believe according to the man page its something like:
iohyve set
pcidev:[n]=<spec> Generic way to add devices to the guest. [n]
is a generic random number or string <spec> defines a virtual
device added to the guest by using a bhyve -s argument without
the pcislot or function argument. PCI slot numbers are assigned
automatically by iohyve. Examples: "pcidev:1=passthru,2/0/0"
"pcidev:2=ahci-hd,/some/place/disk.img"

Basically I'm trying to add a cd-rom on the command line. Any idea how to do this?
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
I've been following this discussion. I'm unfortunately using freenas 9.10 unstead of 11. I see the option within my iohyve install to add a device -- such as a cd-rome I believe according to the man page its something like:
iohyve set
pcidev:[n]=<spec> Generic way to add devices to the guest. [n]
is a generic random number or string <spec> defines a virtual
device added to the guest by using a bhyve -s argument without
the pcislot or function argument. PCI slot numbers are assigned
automatically by iohyve. Examples: "pcidev:1=passthru,2/0/0"
"pcidev:2=ahci-hd,/some/place/disk.img"

Basically I'm trying to add a cd-rom on the command line. Any idea how to do this?

Haven't used iohyve for a while as I moved to FreeNas 11. But from memory, it's not a problem for Linux VMs as the grub boot is done without UEFI. See this: https://youtu.be/rCDh9K16Q5Q
 

KevDog

Patron
Joined
Nov 26, 2016
Messages
462
Haven't used iohyve for a while as I moved to FreeNas 11. But from memory, it's not a problem for Linux VMs as the grub boot is done without UEFI. See this: https://youtu.be/rCDh9K16Q5Q

Can iohyve in FreeNas 9.10 boot using UEFI? I guess I should ask this question first.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
Still valid for Ubuntu 16.04.3 LTS FreeNAS VM deployment of NextCloud. Thanks so much for the video. The OP had me a bit confused. Cheers!

I've been meaning to tidy up my first post for a long time. For future ref: rather than do this fix manually, the following grub command executed as root will create the necessary dir & files under "/boot/efi/EFI" (assuming you have the ESP partition mounted at /boot/efi)

Code:
grub-install --efi-directory=/boot/efi --boot-directory=/boot --removable


Notice that in the case of Ubuntu it's actually the "shimx64.efi" file that gets copied as "BOOTX64.EFI"

Code:
root@ubuntu-vm:/# cd /boot/efi/EFI;ls -l
total 8
drwx------ 2 root root 4096 Nov 29 20:11 BOOT
drwx------ 2 root root 4096 Nov 29 18:15 ubuntu
root@ubuntu-vm:/boot/efi/EFI# cd ubuntu;ls -l
total 3400
-rwx------ 1 root root	 117 Nov 29 18:15 grub.cfg
-rwx------ 1 root root 1133944 Nov 29 18:15 grubx64.efi
-rwx------ 1 root root 1168464 Nov 29 18:15 mmx64.efi
-rwx------ 1 root root 1169992 Nov 29 18:15 shimx64.efi
root@ubuntu-vm:/boot/efi/EFI/ubuntu# cd ../boot;ls -l
total 3432
-rwx------ 1 root root 1169992 Nov 29 20:11 BOOTX64.EFI
-rwx------ 1 root root	 117 Nov 29 20:11 grub.cfg
-rwx------ 1 root root 1164664 Nov 29 20:11 grubx64.efi
-rwx------ 1 root root 1168464 Nov 29 20:11 mmx64.efi
root@ubuntu-vm:/boot/efi/EFI/boot
 

Rybena

Dabbler
Joined
Jun 25, 2017
Messages
32
I've found that after each re boot of the freenas server, I have to use VNC viwer initially to log into ubuntu vm server and then it boots right away, It won't boot without doing this. Anyone else having this issue?
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
Check the settings of the "VNC device" attached to your Ubuntu VM. It sounds as if you might have "wait to boot" selected.

It that's not the problem, do you need the VNC device at all? Use ssh only and see if problem persists.
 

Rybena

Dabbler
Joined
Jun 25, 2017
Messages
32
Check the settings of the "VNC device" attached to your Ubuntu VM. It sounds as if you might have "wait to boot" selected.

It that's not the problem, do you need the VNC device at all? Use ssh only and see if problem persists.
Thanks that did it, the "wait to boot" was ticked.
 
Top