VM's in FreeNAS 11

Status
Not open for further replies.

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
I really just followed the bouncing ball and had Ubuntu up and running in just a few minutes. The live image starts as you would expect and runs fine, however once installed, I had to go through the EFI options - type 'exit' at the shell prompt - then choose to boot Ubuntu. I haven't played around with it any more to change boot orders etc.
 

TinkerGuy

Cadet
Joined
Aug 11, 2016
Messages
7
@TinkerGuy Just to confirm, sudo reboot did not work from the EFI [firmware] shell? If not, I'll need to do some more research online to find the proper command then.

@zoomzoom

I'm not referring to rebooting from EFI.

To clarify: rebooting from within a guest operating doesn't work. Booting from the "STOPPED" state always works with all my VMs (Windows 10, Ubuntu, CentOS, and P F Sense).

I don't think this has anything to do with EFI. I think this has to do with persistent guests and bhyve. Simply put, I don't think any of my FreeNAS 11 VMs are provisioned as persistent guests and therefore rebooting will never work.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
A few ways of fixing EFI boot issues due to grubx64.efi missing from \EFI\ubuntu\ or \EFI\boot\
  1. From EFI shell:
    1. Issue: edit startup.nsh
    2. Add Line: FS0:\EFI\Path\To\grubx64.efi
      • Such as: \EFI\ubuntu\grubx64.efi
    3. Save:
      1. CTRL + O
      2. ALT + D
      3. ENTER
      4. CTRL + X
    4. Reboot: sudo reboot

  2. From LiveBoot:
    1. Copy grubx64.efi to \EFI\ubuntu\ or \EFI\boot\ depending on distro used.

On my Ubuntu 17.04 server install grubx64.efi is already in EFI/ubuntu
Screen Shot 2017-04-27 at 12.45.06 pm.png
Screen Shot 2017-04-27 at 12.47.21 pm.png
 

zoomzoom

Guru
Joined
Sep 6, 2015
Messages
677
@SavageAUS Some VMs have it in the right place for certain distros, but not for others, as it's the distro that determines in what directory the *.efi file needs to be in and is a fairly common issue going back quite a few years.

@FreeNASftw You just need to change the boot order in the EFI firmware, as the EFI shell is currently set as first in the boot order.
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
A few ways of fixing EFI boot issues due to grubx64.efi missing from \EFI\ubuntu\ or \EFI\boot\
  1. From EFI shell:
    1. Issue: edit startup.nsh
    2. Add Line: FS0:\EFI\Path\To\grubx64.efi
      • Such as: \EFI\ubuntu\grubx64.efi
    3. Save:
      1. CTRL + O
      2. ALT + D
      3. ENTER
      4. CTRL + X
    4. Reboot: exit

  2. From LiveBoot:
    1. Copy grubx64.efi to \EFI\ubuntu\ or \EFI\boot\ depending on distro used.
How exactly do you add that line?
I enter the shell, enter 'edit startup.nsh'
That lands me at the prompt FS0:\>
I'm not sure what to do from there... I have tried setvar path = fs0:\EFI\ubuntu\grubx64.efi and setvar path = .\;FS0:\efi\tools\;FS0:\EFI\ubuntu\grubx64.efi
 

zoomzoom

Guru
Joined
Sep 6, 2015
Messages
677
How exactly do you add that line?
I enter the shell, enter 'edit startup.nsh'
That lands me at the prompt FS0:\>
I'm not sure what to do from there... I have tried setvar path = fs0:\EFI\ubuntu\grubx64.efi and setvar path = .\;FS0:\efi\tools\;FS0:\EFI\ubuntu\grubx64.efi
Google it, as that's what I did for the info in my post... You should be able to find a few results from either the Ubuntu forums or Stack Exchange that explain what to do.
  • The grubx64.efi file path is not an environment variable but the grub binary that enables booting to an OS with Secure Boot enabled. Secure Boot requires an OS's boot files be digitally signed and loaded into the EFI firmware, thereby preventing malware, such as a rootkit, from being injected into the boot process.

Just an FYI: if after you install it's still booting to the EFI shell, you'll need to adjust the boot order in the EFI firmware menu
Sent from my Nexus 6 using Tapatalk
 
Last edited:

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
I've just realized that when I enter 'edit startup.nsh' it actually returns 'edit: Invalid file name or current-working-directory' ...
I have tried changing the boot order from shell however it appears that shell settings aren't persistent as creating a new boot option then rebooting as required sees the boot option no longer exist.
 

zoomzoom

Guru
Joined
Sep 6, 2015
Messages
677
I've just realized that when I enter 'edit startup.nsh' it actually returns 'edit: Invalid file name or current-working-directory' ...
I have tried changing the boot order from shell however it appears that shell settings aren't persistent as creating a new boot option then rebooting as required sees the boot option no longer exist.
You shouldn't need to create a new boot entry (installing an OS in EFI mode will auto add itself to the boot order), as the OS must digitally sign it's boot option in order for it to be added permanently to the EFI firmware boot options (this is what makes EFI more secure than BIOS, as Secure Boot prevents injection of a rootkit prior to handing off to the OS bootloader). Once a boot option exists, and if it's still booting to the EFI shell, the boot order will need to be changed in the EFI firmware to boot to the OS first and EFI shell last.
  • The easiest way to fix the issue of the grubx64.efi file not being in the correct directory on the FAT32 partition is to live boot Ubuntu and correct the EFI boot directory hierarchy.
 
Last edited:

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
Assuming you have a VM such as Ubuntu which you have already installed to disk.
Manually boot the VM from the BHYVE shell -
Type exit at shell to be presented with UEFI screen
Select Boot Maintenance Managager
Select Boot From File
Drill down until you get to grubx64.efi - hit enter and the VM will boot.

Within the VM-
su
cd /boot/efi/EFI
mkdir BOOT
cp ubuntu/grubx64.efi BOOT/bootx64.efi
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
Hmmm has anyone here used Ubuntu 16.04 LTS with GUI? I've tried running this VM up twice now and it hangs after the install procedure is done, screen says 'remove install media and press enter' but nothing I do will make it respond. I can't even stop it from the GUI, if I delete it while in this state it disappears from the GUI but I can still VNC into it.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
Hmmm has anyone here used Ubuntu 16.04 LTS with GUI? I've tried running this VM up twice now and it hangs after the install procedure is done, screen says 'remove install media and press enter' but nothing I do will make it respond. I can't even stop it from the GUI, if I delete it while in this state it disappears from the GUI but I can still VNC into it.
Yes that happened to me as well. From your vnc viewer just click the ctrl+alt+del command a few times.

Sent from my SM-G930F using Tapatalk
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
Cheers mate, maybe I need to click it a few MORE times! Haha

Edit - I forgot about it and went and did something else, the VM finally stopped of its own accord, I was able to restart it and now it's up and running.
 

Ziggy

Contributor
Joined
Oct 7, 2015
Messages
157
Not yet, but I'll be working on that soon.
Any ETA for that tutorial Mr M0nkey? No flattery with the aim of persuading you intended, but your YouTube vids rock. Simple and easy to follow. And, for the record, you DON'T talk too much.
 

Ziggy

Contributor
Joined
Oct 7, 2015
Messages
157
As they say, seek and you shall find. I was looking to ask the same question, but did a search and found someone has already asked the same. Awaiting some documentation on VM setup. Will FreeNAS 11 (when it releases) officially support VMs ?
Yes, but - to this simple soul at least - it lacks some detail. Can't figure out how to vnc into it, can't find an ip to achieve this.
 

zoomzoom

Guru
Joined
Sep 6, 2015
Messages
677
Yes, but... Can't figure out how to vnc into it, can't find an ip to achieve this.
Have you configured a vLAN adapter on the host [FreeNAS box] for the VM? If not, that must be done, then the vLAN must be assigned to the VM in order for traffic to pass through.
  • You can leave the vLAN ID at 0, unless you're already using vLAN tagging, at which point you'll know what number you'll want it's traffic tagged with
IP is the IP of the FreeNAS box.

Sent from my Nexus 6 using Tapatalk
 
Last edited:

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
Any ETA for that tutorial Mr M0nkey? No flattery with the aim of persuading you intended, but your YouTube vids rock. Simple and easy to follow. And, for the record, you DON'T talk too much.
Hopefully soon. I'm working on the best way to present it in an easy to follow format.
 

runtime

Explorer
Joined
Aug 27, 2016
Messages
57
I'm trying to get a boot2docker VM running or 11RC. I have a NIC and I've added the ISO as a cd-rom, but it doesn't seem to get an IP (nothing in the gui as you can see in the screenshot, and noting in dhcp leases on my router). Any idea how to to give an IP to this VM? What am I doing wrong?
I've also added a screenshot of the 'devices' section of that VM.

Thanks!
 

Attachments

  • Screen Shot 2017-05-07 at 22.06.52.png
    Screen Shot 2017-05-07 at 22.06.52.png
    130.9 KB · Views: 329
  • Screen Shot 2017-05-07 at 22.08.41.png
    Screen Shot 2017-05-07 at 22.08.41.png
    24.2 KB · Views: 284

zoomzoom

Guru
Joined
Sep 6, 2015
Messages
677
@runtime It can't be assigned an IP because it hasn't booted to an OS. (IP is the IP of the FreeNAS box)

Your shell output for the VM shows it's searching for a bootloader and doesn't find one. I've yet to configure a VM on FreeNAS, however there should be a way to access the VM without an IP (See Above) (which it appears you can do since you have a screenshot of the VM not loading the *.efi loader). as it's likely the EFI shell is set as the 1st boot option, which will need to be modified.
 
Last edited:
Status
Not open for further replies.
Top