Debian VM on FreeNAS 11 stops at grub

Status
Not open for further replies.

cbbc

Dabbler
Joined
Nov 28, 2017
Messages
10
Although I have read KrisBee's post* on Linux VMs, I am unsure how to go forward.
*https://forums.freenas.org/index.php?threads/how-to-how-to-boot-linux-vms-using-uefi.54039/

I have Freenas 11.0-U4 running happily. I was able to get a CentOS VM to install and run happily.

However, I would like to use Debian 9 and so created a new VM in GUI and added devices: a zvol (100GB) and CDROM (/mnt/zpool1/isos/debian-9.2.1-amd64-netinst.iso)

Upon GUI VM Start, my VNC shows that the install has stopped at grub. See attached.

Could anyone suggest steps to move forward?
Also, where are the VM's zvol files? I don't see them in root@freenas:/mnt/zpool1

Thanks, CB
 

Attachments

  • debian_install_stops_at_grub.jpg
    debian_install_stops_at_grub.jpg
    11.9 KB · Views: 1,081

cbbc

Dabbler
Joined
Nov 28, 2017
Messages
10
Mucking about, I have found an answer, or at least a way forward.
I initially tried a light weight ISO: debian-9.2.1-amd64-netinst.iso and I still don't know why it hung on grub.
But, I decided to try a fuller install: debian-live-9.2.0-amd64-lxde.iso... and this makes FreeNAS/bhyve happy.

  • Got to "Installation is complete, so it is time to boot into your new system. Make sure to remove the installation media, so that you boot into the new system rathe rthan restarting the installation."
  • After reboot... Error in TightVNC Viewer. No connection could be made because the target machine actively refused it."
  • But I think I know why this happened: instead of removing the Device from the VM in the GUI, I had quickly moved the ISO out of my ISO folder on the zpool (up one directory). That's gonna confuse bhyve.
  • I stopped the VM, removed the CDROM device and re-started the VM
  • Now I see the not-so-dreaded UEFI Shell screen that others have noted here https://forums.freenas.org/index.php?threads/how-to-how-to-boot-linux-vms-using-uefi.54039/page-5
  • So... next I will follow the suggestions by Rybena at https://www.youtube.com/watch?v=GjMIgkC5REM&t=603s
 

Attachments

  • debian_install_stops_after_reboot.jpg
    debian_install_stops_after_reboot.jpg
    12.3 KB · Views: 1,013
  • debian_install_stops_at_uefi_shell.jpg
    debian_install_stops_at_uefi_shell.jpg
    18.2 KB · Views: 777

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
I can't explain your problem, as I couldn't reproduce it using the debian-9.2.1-amd64-netinst.iso. I presume you created the zvol before the VM, so perhaps is was a bhyve VNC quirk. It's a good idea to install and configure ssh in your VM ASAP.

FYI, zvols are not mounted as filesystems but exist as block devices under the path /dev/zvol/yourpoolname/...

Also for future reference if you choose debian's expert install option when you reach the "install grub loader" option you will be prompted to Force grub-efi installation to the removable media path. Answer "yes" and there will be no need for a post-install UEFI fix.

See here for Debian's argument why this is not a default option:

https://wiki.debian.org/UEFI#Force_grub-efi_installation_to_the_removable_media_path

This is equivalent to executing this command post-installation as root:
grub-install --efi-directory=/boot/efi --boot-directory=/boot --removable

You will find the necessary dir/files have been created, e.g:

Code:
root@debian9-vm:/boot/efi/EFI# ls -l 
total 8 
drwx------ 2 root root 4096 Nov 29 12:28 BOOT 
drwx------ 2 root root 4096 Nov 29 12:28 debian 
root@debian9-vm:/boot/efi/EFI# cd BOOT;ls -l 
total 120 
-rwx------ 1 root root 121856 Nov 29 12:28 BOOTX64.EFI 
root@debian9-vm:/boot/efi/EFI/BOOT#
 
 

cbbc

Dabbler
Joined
Nov 28, 2017
Messages
10
Thanks KrisBee. Very useful. Here is some follow-up:

1. Debian Live does not seem to have an expert install option (see uploaded image). So, I went back to the netinstal path since you said you could not replicate my grub stall issue.

2. Then found my grub stall issue: my initial netinstall wget did not complete.

-rw-r--r-- 1 root wheel 4186112 Nov 27 15:14 debian-9.2.1-amd64-netinst-OLD.iso
-rw-r--r-- 1 root wheel 304087040 Oct 13 06:10 debian-9.2.1-amd64-netinst.iso

So, I re-grabbed the ISO and ran the bhyve VM build process from GUI, and then happily got to Debian netinstall main page and was able to select expert install. Easy from there.

As KrisBee predicted, my Debain 9 VM re-boots happily without EFI mucking.
 

Attachments

  • debian_live_no_adv.jpg
    debian_live_no_adv.jpg
    9 KB · Views: 806

cbbc

Dabbler
Joined
Nov 28, 2017
Messages
10
In sum, recommendations for Debian 9 VM builders (newbies like me):
  1. Netinstall works fine (as long as you have the full file)
  2. At Debian GNU/Linux UEFI Installer menu, choose Advanced options...
  3. Then choose Expert install
  4. At step 16, Install the GRUB boot loader on a hard disk step... Select Yes for Force GRUB installation to the EFI removable media path?
 

Attachments

  • debian_netinstall_main.jpg
    debian_netinstall_main.jpg
    34.2 KB · Views: 760
  • debian_netinstall_expert_install.jpg
    debian_netinstall_expert_install.jpg
    36.8 KB · Views: 927
  • debian_install_adv_install_GRUB_on_hd.jpg
    debian_install_adv_install_GRUB_on_hd.jpg
    38.5 KB · Views: 887
  • debian_install_adv_force_grub_to_EFI_yes.jpg
    debian_install_adv_force_grub_to_EFI_yes.jpg
    49.5 KB · Views: 1,010

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
Bingo!
 
Status
Not open for further replies.
Top