Jump to content











Photo
- - - - -

Having problems booting a VHD on a machine with separate EFI partition

vhd windows boot bcd

  • Please log in to reply
25 replies to this topic

#1 jussihi

jussihi
  • Members
  • 9 posts
  •  
    Finland

Posted 16 January 2019 - 12:33 PM

Hello everyone.

 

Just registered here, as I'm having really hard time booting onto a VHD. My ultimate goal is to load a Linux from a VHD image and boot it through the Windows boot manager, and this forum seems to be the ONLY place on internet discussing/having any knowledge regarding this topic.

 

Using bcdedit, I'm able to add the entry to the menu;

C:\Windows\system32>bcdedit

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject            {55a1b3ec-0d84-11e9-8218-8d4c96417f88}
displayorder            {current}
                        {55a1b3f4-0d84-11e9-8218-8d4c96417f88}
toolsdisplayorder       {memdiag}
timeout                 10

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.efi
description             Windows 10
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {55a1b3ee-0d84-11e9-8218-8d4c96417f88}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {55a1b3ec-0d84-11e9-8218-8d4c96417f88}
nx                      OptIn
bootmenupolicy          Standard

Windows Boot Loader
-------------------
identifier              {55a1b3f4-0d84-11e9-8218-8d4c96417f88}
device                  vhd=[C:]\ubuu\ubu.vhd
path                    \Windows\system32\winload.efi
description             ubuntu
locale                  en-US
inherit                 {bootloadersettings}
osdevice                vhd=[C:]\ubuu\ubu.vhd
systemroot              \Windows
detecthal               Yes

The Windows 10 entry boots OK, but I can't boot onto the Ubuntu entry. What could be the error I'm doing here? AFAIK this is how it is done in every tutorial/guide I've come across.

 

The error I'm getting is "Windows failed to boot... The file \Windows\system32\winload.efi could not be found or is corrupt". It is presented on a legacy-looking black screen. Although in the right bottom corner it says "Press ESC to go to UEFI settings.." so it is not trying to boot a MBR/BIOS image.

 

Worth mentioning would also hopefully be that booting Windows 10 entry from the list DOES NOT make my PC reboot, but when I select the VHD entry (Ubuntu), the PC reboots, and then gives me this error.

 

 

Any help would be much appreciated! Thanks in advance  :)


Edited by jussihi, 16 January 2019 - 12:33 PM.


#2 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 16 January 2019 - 01:14 PM

The ubu.vhd will certainly not boot from Windows BootManager menu using path \Windows\system32\winload.efi

which is the file for booting Windows. Also systemroot \Windows is certainly not ok.

 

How did you prepare the ubu.vhd ?

 

I have no experience with booting Linux from VHD.

 

Grub4dos can be used in BIOS mode and Grub2 can be used in UEFI Secure mode to boot various Linux ISO files

as described here and booting from USB is easily made in Windows 10 x64 OS by using UEFI_MULTI_x64.exe



#3 jussihi

jussihi
  • Members
  • 9 posts
  •  
    Finland

Posted 16 January 2019 - 01:36 PM

Thank you for the very quick response, wimb!

 

The reason I thought this would work is the video I followed (). It had some preconfigured vhd file attached, and the presentator showed how to add it to the Windows bootmanager.

 

Thank you for the link to the UEFI_MULTI, but I can already boot the Linux from an USB. My main goal is actually to get rid of that USB stick, so I could boot the live Linux without the USB stick.

 

Also I think that here is some info; http://reboot.pro/to...rom-vhd-how-to/

but my system is a UEFI/GPT only, without the legacy BIOS support, so the grub4dos doesn't work, as it only works with BIOS/MBR afaik.. Or am I wrong here?



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15046 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 16 January 2019 - 02:01 PM

Also I think that here is some info; http://reboot.pro/to...rom-vhd-how-to/
but my system is a UEFI/GPT only, without the legacy BIOS support, so the grub4dos doesn't work, as it only works with BIOS/MBR afaik.. Or am I wrong here?

Sure, most of the info is there and you are right, the grub4dos will only work on BIOS (both on MBR and GPT "style" disks), buit there is still GRUB2 (which does work on UEFI and does allow booting from a RAW file with a sector appended, which is what a static VHD is), if you continue on that thread /around page 3, you will start finding some references to GRUB2 use, including some special/modified versions capable of booting also "dynamic" .vhd's.

Unfortunately, for *some reasons*, the whole stuff about Linux booting from a VHD (static or dynamic) seems like being not very popular (not only - as you noticed - elsewhere) and the information available is scarce.

What is not seen in that video (or maybe I missed it) is actually booting the Ubuntu from the VHD. :dubbio:

:duff:
Wonko

#5 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 16 January 2019 - 02:26 PM

How did you prepare the ubu.vhd ?

 

Wonko is right, since your system is UEFI/GPT then Grub2 should be tried as boot manager for booting your ubu.vhd

 

In Grub2 menu you can use chainloader for booting your original Windows 10 x64 as done by UEFI_MULTI


menuentry "Windows 10 x64 EFI BootManager" {
  chainloader /efi/microsoft/boot/bootmgfw.efi
}

if [ -e "/images/ubuntu-18.10-desktop-amd64.iso" ]; then
menuentry "ISO Ubuntu - ubuntu-18.10-desktop-amd64.iso" {
  set iso_path=/images/ubuntu-18.10-desktop-amd64.iso
  loopback loop $iso_path
  linux (loop)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=$iso_path quiet splash ---
  initrd (loop)/casper/initrd
}
fi

 

I can boot from my internal SSD / GPT with FAT32 EFI partition in UEFI Secure mode with Grub2 of Linux Mint

and then select in Grub2 menu to boot with Windows Boot Manager Or with Linux ISO located in folder images on FAT32 EFI partition (Ubuntu and Knoppix and Linux Mint were tested).

However, I must use BOOTICE to make UEFI Grub2 entry and must boot via F8 menu and then select this UEFI Grub2 entry. Otherwise I get straight Windows  Boot Manager.

 

So the only thing to be done is making ubu.vhd and the Grub2 entry for booting this ubu.vhd ....

I have a FAT32 ubu.vhd with the files from Ubuntu booting flat according to AIO, but I don't know yet a Grub2 menu to boot such vhd ....

 

But booting Ubuntu Linux ISO from internal SSD is may be already a good solution for you that is working in UEFI Secure anyway OK  :)



#6 jussihi

jussihi
  • Members
  • 9 posts
  •  
    Finland

Posted 16 January 2019 - 04:38 PM

Thank you both for your very good points on this topic!

 

Is there any way to chainload GRUB from Windows boot manager, or alternatively install the GRUB EFI binary to the EFI partition and then boot that EFI binary WITHOUT entering the UEFI BIOS? Does a normal Windows-only installation even have its own separate EFI partition?

 

So, for both of you; my goal is to somehow boot a Linux ISO/VHD on a Windows-only system, without an external USB stick and without the need to get into / touch the UEFI/BIOS firmware settings. Is this possible? I thought that a Linux installation with a custom kernel inside a VHD (which I could boot through Windows boot manager) would work, but now it seems to be impossible.

 

And wimb, I did not prepare the ubu.vhd in any way, it is the same file linked in the youtube video - I was just trying to get something working as a kind of proof-of-concept first before trying to do my own VHD and own GNU/Linux installation on it..



#7 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 16 January 2019 - 04:59 PM

You don't have to enter the UEFI BIOS.

 

In Windows 10 I used BOOTICE to make UEFI Grub2 entry for my internal SSD with FAT32 EFI partition.

 

UEFI_Grub2_SSD.png
 

And then I Select from F8 Boot Menu this UEFI Grub2 entry.

 

So I can Boot Linux ISO located in folder images on FAT32 EFI partition on internal SSD / GPT having  Windows 10 x64 system on second NTFS partition.

 

I don't see a link for this ubu.vhd. Can you give a download link ?



#8 jussihi

jussihi
  • Members
  • 9 posts
  •  
    Finland

Posted 16 January 2019 - 05:16 PM

Thanks wimb!

 

Yeah, this is great, as I can programmatically do this UEFI installation (adding the UEFI entry) myself too using the SetFirmwareEnvironmentVariableEx call.. Just have to figure out how to alter the EFI partition from a Win32 program that I'm writing. And I can also "lend" the Ubuntu bootloader efi binary, which is already signed so it works with SecureBoot also!

 

I will most likely post more once I get further and get stuck again...


Edited by jussihi, 16 January 2019 - 05:18 PM.


#9 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 16 January 2019 - 06:26 PM

You can modify your SSD_EFI partition after booting with WIM file from USB

 

and then run WinNTSetup_x64.exe so that EFI partition is mounted as drive Z:

 

SSD_EFI_Grub2_Linux.png

 

Grub2 of Linux Mint has the advantage that it is OK for UEFI Secure boot

 

of Linux ISO of Linux Mint - Knoppix Live - Ubuntu - Porteus

 

Ubuntu Grub2 does not support UEFI Secure boot of all these Linux ISO files .....



#10 cdob

cdob

    Gold Member

  • Expert
  • 1440 posts

Posted 16 January 2019 - 11:06 PM

@jussihi

What's the request? Do you search a solution for one machine?
Do you search a general solution for all machines?

Be aware, there are differnt UEFI implentations in real world.

Some boot NVRAM first entry. The file name is read from NVRAM, can be grub2 or windows default file names.
Other boot a fixed file name, e.g. /EFI/Microsoft/Boot/bootmgfw.efi This can be a renamed grub2 file.

Given two NVRAM entries:
-if you press the boot hotkey, you may see a selection choice.
-if you press the boot hotkey, the UEFI may not show a selction and present first NVRAM setting only

And there is a backup without a NVRAM entry, 64bit UEFI file name /efi/boot/bootx64.efi.

A general solution is difficult.
  • devdevadev likes this

#11 stayboogy

stayboogy

    Member

  • Members
  • 47 posts
  •  
    United States

Posted 17 January 2019 - 02:41 AM

[deleted]


Edited by stayboogy, 17 January 2019 - 02:51 AM.


#12 stayboogy

stayboogy

    Member

  • Members
  • 47 posts
  •  
    United States

Posted 17 January 2019 - 02:44 AM

and yes, uefi installed windows has to have a separate efi partition, on both mbr and gpt uefi installs.



#13 stayboogy

stayboogy

    Member

  • Members
  • 47 posts
  •  
    United States

Posted 17 January 2019 - 02:55 AM

Hello everyone.

 

Just registered here, as I'm having really hard time booting onto a VHD. My ultimate goal is to load a Linux from a VHD image and boot it through the Windows boot manager, and this forum seems to be the ONLY place on internet discussing/having any knowledge regarding this topic.

 

Using bcdedit, I'm able to add the entry to the menu;

C:\Windows\system32>bcdedit

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject            {55a1b3ec-0d84-11e9-8218-8d4c96417f88}
displayorder            {current}
                        {55a1b3f4-0d84-11e9-8218-8d4c96417f88}
toolsdisplayorder       {memdiag}
timeout                 10

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.efi
description             Windows 10
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {55a1b3ee-0d84-11e9-8218-8d4c96417f88}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {55a1b3ec-0d84-11e9-8218-8d4c96417f88}
nx                      OptIn
bootmenupolicy          Standard

Windows Boot Loader
-------------------
identifier              {55a1b3f4-0d84-11e9-8218-8d4c96417f88}
device                  vhd=[C:]\ubuu\ubu.vhd
path                    \Windows\system32\winload.efi
description             ubuntu
locale                  en-US
inherit                 {bootloadersettings}
osdevice                vhd=[C:]\ubuu\ubu.vhd
systemroot              \Windows
detecthal               Yes

The Windows 10 entry boots OK, but I can't boot onto the Ubuntu entry. What could be the error I'm doing here? AFAIK this is how it is done in every tutorial/guide I've come across.

 

The error I'm getting is "Windows failed to boot... The file \Windows\system32\winload.efi could not be found or is corrupt". It is presented on a legacy-looking black screen. Although in the right bottom corner it says "Press ESC to go to UEFI settings.." so it is not trying to boot a MBR/BIOS image.

 

Worth mentioning would also hopefully be that booting Windows 10 entry from the list DOES NOT make my PC reboot, but when I select the VHD entry (Ubuntu), the PC reboots, and then gives me this error.

 

 

Any help would be much appreciated! Thanks in advance  :)

I know I'm coming in late here, but this entry:

 

Windows Boot Loader
-------------------
identifier {55a1b3f4-0d84-11e9-8218-8d4c96417f88}
device vhd=[C:]\ubuu\ubu.vhd
path \Windows\system32\winload
.efi
description ubuntu
locale en
-US
inherit
{bootloadersettings}
osdevice vhd=[C:]\ubuu\ubu.vhd
systemroot \Windows
detecthal
Yes

 

won't work because you are trying to load \Windows\system32\winload.efi from your Ubuntu.vhd which would not have that file present because that file is only present in a windows install.  you have confused the bcd for the bios uefi boot manager which is what you need for what you trying to do.

 

the tutorials you have seen are not doing what you are trying because it will never work.

 

now...

 

to possibly get ubuntu booting from vhd, you will need the grub2 efi firmware.

 

copy the EFI folder from a Ubuntu installed in uefi mode--which requires the first partition of a gpt disk to be a fat32 partition, just like for windows (which will work both mbr/gpt disks), then you have to mount it to /boot/efi under linux, then grub-install from the terminal using the switch for x86_x64-uefi to the mounted path of the efi partition.

 

copy the EFI folder from said ubuntu install to the efi partition that boots your uefi installed windows.  then change your bios uefi boot settings to boot the grubx64.efi firmware image and give that a boot entry in the bios settings.  that's the only way you'll ever load the grub efi boot manager.  you might possibly be able to realmode load grubx64.efi from the windows bcd but i doubt it.

 

you'll then have to change your grub.cfg to load your vhd, which that is something i do not know how to do.


Edited by stayboogy, 17 January 2019 - 03:00 AM.


#14 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 17 January 2019 - 08:47 AM

You can modify your SSD_EFI partition after booting with WIM file from USB

 

and then run WinNTSetup_x64.exe so that EFI partition is mounted as drive Z:

 

 

 

There is no need to boot with WIM file.

 

In Windows 10 x64  I can run WinNTSetup_x64.exe so that EFI partition is mounted as drive Z:

 

Then I use R-mouse menu to run as administrator Explorer-x64.exe of Explorer++

 

Now I have FileManagement in EFI partition and can edit grub.cfg

 

I have Multiboot from internal SSD of Linux ISO's and Windows 10 x64 booting with UEFI Secure Grub2 of Linux Mint perfectly working.

However, I had to make space on my FAT32 EFI partition to accomodate the Linux ISO files located there in folder images.

 

It would be better when I can have the folder images with Linux ISO files located on the (hd0,gpt2) NTFS partition with Windows 10 x64 OS.

That would be an advantage since then there would be no need to resize the FAT32 EFI partition (hd0,gpt1)

 

I cannot get the Linux ISO files booting when located on NTFS partition.

I tried something with insmod ntfs but have no experience with Grub2 ....

Is there a solution and can anyone help me to solve this problem ?



#15 jussihi

jussihi
  • Members
  • 9 posts
  •  
    Finland

Posted 17 January 2019 - 09:06 AM

Thank you for all these great replies, I'll try to answer to those below. As you can see, I'm more of a Linux guy than Windows... That's why all this Windows boot manager stuff is pretty unclear for me.

 

@wimb,

yes, no need to boot the Windows, actually I think you can just use "mountvol X: /s" to mount EFI to X:/. And no, insmod ntfs is a command for linux, in grub you have not yet loaded the kernel, so of course it cannot load the linux kernel driver. EDIT: Actually it seems like there is NTFS support for GRUB. Does your grub folder in the EFI partition have "ntfs.mod" inside it? Maybe you are missing the ntfs module, and that's why it cannot load it.

 

@cdob,

I would like to create as-universal-as-possible solution to boot a live Linux from the existing Windows NTFS filesystem, pretty much like the GRUB4DOS does, but for UEFI/GPT systems. I see there are some problems, as some laptop makers try to force booting of the windows boot manager EFI binary, as you said. Is there any other kinds of workarounds for these, other than replacing the original /EFI/Microsoft/Boot/bootmgfw.efi on the EFI partition?

 

@stayboogy,

thanks, that I was thinking too, that it's trying to load the file from the VHD... I just wanted to make sure that my thoughts were actually correct. Thanks for the info about the EFI partition, I guess it is a must-have for UEFI in general, and not only used in GNU/Linux


Edited by jussihi, 17 January 2019 - 09:08 AM.


#16 jussihi

jussihi
  • Members
  • 9 posts
  •  
    Finland

Posted 17 January 2019 - 09:13 AM

@wimb, 

 

I have a copy of old Ubuntu installation's GRUB EFI loader, which is Secureboot friendly and has the ntfs module (and a lot of other modules too). Should I upload it here so you could try it out..?

 

edit: seems like loading data from NTFS needs part_gpt module too,


Edited by jussihi, 17 January 2019 - 09:25 AM.


#17 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 17 January 2019 - 10:00 AM

@wimb, 

 

I have a copy of old Ubuntu installation's GRUB EFI loader, which is Secureboot friendly and has the ntfs module (and a lot of other modules too). Should I upload it here so you could try it out..?

 

edit: seems like loading data from NTFS needs part_gpt module too,

 

Yes, please upload it so that I can try it.

Do you have NTFS support when booting with that Grub2 of Ubuntu ?

And can you launch Linux ISO when located on NTFS -partition.

If you can then please give your grub.cfg with menuentry and a view on EFI folder content



#18 jussihi

jussihi
  • Members
  • 9 posts
  •  
    Finland

Posted 17 January 2019 - 10:07 AM

Yes, please upload it so that I can try it.

Do you have NTFS support when booting with that Grub2 of Ubuntu ?

And can you launch Linux ISO when located on NTFS -partition.

If you can then please give your grub.cfg with menuentry and a view on EFI folder content

 

I'm sorry, I'm not at home, so can't test right now, but I got the files on my laptop,

 

I'm sorry I cannot upload to this forum for some reason, but here is a link http://s000.tinyuplo...571403134348868

 

It does not include the NTFS entry in grub.cfg, as I've never tried this before, but I would imagine it would be like 

insmod part_gpt
insmod ntfs
set root='hd1,gpt2' #just a helper
isofile/whatever the command is ${root}/path/to/iso.iso

Edited by jussihi, 17 January 2019 - 10:09 AM.


#19 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 17 January 2019 - 10:46 AM

Thanks for uploading Ubuntu Grub2 and for your suggested menuentry.

 

I will test later today hopefully ...



#20 jussihi

jussihi
  • Members
  • 9 posts
  •  
    Finland

Posted 17 January 2019 - 11:20 AM

I will test it too, 

 

@wimb, what is the GRUB command to load the ISO file from a file? I will get home in some 2-3 hours so I will test with some Ubuntu ISO.



#21 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 17 January 2019 - 01:41 PM

With Ubuntu Grub2 I get: Secure Boot forbids loading mod .....

 

With Linux Mint Grub2 and ISO on (hd0,gpt2) NTFS partition I get Unknown filesystem,

allthough I added insmod part_gpt and insmod ntfs to the menuentry that tries to boot from (hd0,gpt2)

 

I have succes with three Linux ISO files booting in UEFI Secure mode using Linux Mint Grub2 and ISO files located in folder images on FAT32 EFI partition.

 

Here is for that case my menuentry for Ubuntu ISO

menuentry "ISO Ubuntu - ubuntu-18.10-desktop-amd64.iso" {
  set iso_path=/images/ubuntu-18.10-desktop-amd64.iso
  loopback loop $iso_path
  linux (loop)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=$iso_path quiet splash ---
  initrd (loop)/casper/initrd
}



#22 jussihi

jussihi
  • Members
  • 9 posts
  •  
    Finland

Posted 17 January 2019 - 02:14 PM

I'm having the same issue.. Didn't know that you can't load modules when securebooting. I guess these modules should also be signed.

 

Next I'll try to use bootx64.efi (I guess this is a signed shim) and grubx64.efi from https://github.com/n...master/EFI/BOOTand see if it works, the owner of this repo says that the ntfs module is included in the grubx64.efi he offers.

 

Here is also an interesting topic: https://unix.stackex...-and-install-it


Edited by jussihi, 17 January 2019 - 02:21 PM.


#23 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 17 January 2019 - 02:55 PM

Ok so there is may be no NTFS support possible for hosting Linux ISO files in case of UEFI Secure boot.

 

Anyway we have a good working solution by increasing the size of the FAT32 EFI partition so that the Linux ISO's can be located there.

 

I have now 7 UEFI Secure Boot options from internal SSD / GPT

- Windows 10 x64 OS and WIM and VHDX file on NTFS partition and booting with Windows EFI Boot Manager

- 4 Linux ISO files in folder images on FAT32 EFI partition and booting with Grub2 from Linux Mint

 

Procedure

- In Windows Disk Management use R-mouse menu to Shrink partition of C: drive by 10 GB

- Create a FAT32 primary partition of 10 GB to host the Linux ISO files

- Make folder images on FAT32 drive and copy Linux ISO's to folder images 

- In Windows 10 x64  run WinNTSetup_x64.exe so that EFI partition is mounted as drive Z:

- Or use R-mouse to open admin cmd window and use

mountvol Z: /s 

- use R-mouse menu to run as administrator Explorer-x64.exe of Explorer++

- Rename Microsoft file bootx64.efi in folder Z:\EFI as file org-bootx64.efi
- Mount Linux Mint ISO file in Explorer using double-click
- copy folder boot and EFI of Linux Mint to your EFI drive Z: so that computer can boot with Grub2 of Linux Mint
- edit file boot\grub\grub.cfg in drive Z: according to samples given below or as given in download Linux_MULTI
 take into account your FAT32 disk number and partitioning type and partition number e.g. use (hd0,gpt3) or (hd1,msdos1)
 

In Windows 10 one can use BOOTICE to make UEFI Grub2 entry for the internal SSD having FAT32 EFI partition.

 

UEFI_Grub2_SSD.png == Multi-SSD.png
 

And then for booting Linux ISO one can Select from F8 Boot Menu this UEFI Grub2 entry.

 

It is not needed to use F8 if one moves in BOOTICE the UEFI Grub2 entry with Up to the first place so that Grub2 has the highest Boot Priority 

 

More Info - Linux Mint - Knoppix Live - Ubuntu - Porteus - UEFI_MULTI - Grub2 Manual

 

Download - Explorer++ and WinNTSetup and BOOTICE and Linux_MULTI

 

File boot\grub\grub.cfg in EFI partition

if loadfont /boot/grub/font.pf2 ; then
	set gfxmode=auto
	insmod efi_gop
	insmod efi_uga
	insmod gfxterm
	terminal_output gfxterm
fi

set timeout=10
set default=0

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

menuentry "Windows 10 x64 EFI BootManager" {
  chainloader /efi/microsoft/boot/bootmgfw.efi
}

if [ -e "/images/linuxmint-19-cinnamon-64bit-v2.iso" ]; then
menuentry "ISO Linux Mint - linuxmint-19-cinnamon-64bit-v2.iso" {
  set iso_path=/images/linuxmint-19-cinnamon-64bit-v2.iso
  loopback loop $iso_path
  linux (loop)/casper/vmlinuz file=/cdrom/preseed/linuxmint.seed boot=casper iso-scan/filename=$iso_path quiet splash --
  initrd (loop)/casper/initrd.lz
}
fi

if [ -e "/images/runtimelivecd.iso" ]; then
menuentry "ISO Knoppix - runtimelivecd.iso" {
  set iso_path=/images/runtimelivecd.iso
  loopback loop $iso_path
  linux (loop)/boot/isolinux/linux bootfrom=/dev/*$iso_path lang=en apm=power-off nomce libata.force=noncq hpsa.hpsa_allow_any=1 loglevel=1 noswap tz=localtime
  initrd (loop)/boot/isolinux/minirt.gz
  loopback --delete loop
}
fi

if [ -e "/images/ubuntu-18.10-desktop-amd64.iso" ]; then
menuentry "ISO Ubuntu - ubuntu-18.10-desktop-amd64.iso" {
  set iso_path=/images/ubuntu-18.10-desktop-amd64.iso
  loopback loop $iso_path
  linux (loop)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=$iso_path quiet splash ---
  initrd (loop)/casper/initrd
}
fi

if [ -e "/images/Porteus-CINNAMON-v4.0-x86_64.iso" ]; then
menuentry "ISO Linux Porteus - Porteus-CINNAMON-v4.0-x86_64.iso" {
  set iso_path=/images/Porteus-CINNAMON-v4.0-x86_64.iso
  loopback loop $iso_path
  linux	(loop)/boot/syslinux/vmlinuz nomagic base_only norootcopy from=$iso_path
  initrd (loop)/boot/syslinux/initrd.xz
}
fi

menuentry "Original x64 EFI" {
  chainloader /efi/boot/org-bootx64.efi
}



#24 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 18 January 2019 - 04:02 PM

 

Anyway we have a good working solution by increasing the size of the FAT32 EFI partition so that the Linux ISO's can be located there.

 

 

Changing the size of the EFI partition is not desirable.

 

If you have another FAT32 local drive available or can make such drive then the Linux ISO files can be located there !

 

I used my FAT32 1st partition of hd1 with MBR and can boot Mint and Knoppix and Ubuntu and Porteus ISO UEFI Secure with the following entries

if [ -e "(hd1,msdos1)/images/linuxmint-19-cinnamon-64bit-v2.iso" ]; then
menuentry "ISO Linux Mint - linuxmint-19-cinnamon-64bit-v2.iso (hd1,msdos1)" {
  set iso_path=/images/linuxmint-19-cinnamon-64bit-v2.iso
  loopback loop (hd1,msdos1)$iso_path
  linux (loop)/casper/vmlinuz file=/cdrom/preseed/linuxmint.seed boot=casper iso-scan/filename=$iso_path quiet splash --
  initrd (loop)/casper/initrd.lz
}
fi

if [ -e "(hd1,msdos1)/images/runtimelivecd.iso" ]; then
menuentry "ISO Knoppix - runtimelivecd.iso (hd1,msdos1)" {
  set iso_path=/images/runtimelivecd.iso
  loopback loop (hd1,msdos1)$iso_path
  linux (loop)/boot/isolinux/linux bootfrom=/dev/*$iso_path lang=en apm=power-off nomce libata.force=noncq hpsa.hpsa_allow_any=1 loglevel=1 noswap tz=localtime
  initrd (loop)/boot/isolinux/minirt.gz
  loopback --delete loop
}
fi

if [ -e "(hd1,msdos1)/images/ubuntu-18.10-desktop-amd64.iso" ]; then
menuentry "ISO Ubuntu - ubuntu-18.10-desktop-amd64.iso (hd1,msdos1)" {
  set iso_path=/images/ubuntu-18.10-desktop-amd64.iso
  loopback loop (hd1,msdos1)$iso_path
  linux (loop)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=$iso_path quiet splash ---
  initrd (loop)/casper/initrd
}
fi

if [ -e "(hd1,msdos1)/images/Porteus-CINNAMON-v4.0-x86_64.iso" ]; then
menuentry "ISO Linux Porteus - Porteus-CINNAMON-v4.0-x86_64.iso (hd1,msdos1)" {
  set iso_path=/images/Porteus-CINNAMON-v4.0-x86_64.iso
  loopback loop (hd1,msdos1)$iso_path
  linux	(loop)/boot/syslinux/vmlinuz nomagic base_only norootcopy from=$iso_path
  initrd (loop)/boot/syslinux/initrd.xz
}
fi


Then I created a FAT32 partition of 10 GB at the end of my SSD / GPT with Win 10 x64 OS and copied folder images with Linux ISO's to that location.

 

Now I need to use (hd0,gpt3) instead of (hd1,msdos1) in the above given menuentries and then everything works ok.

 

An inserted USB-Stick can shift the hd number and so it is useful to have additionally menuentries with (hd1,gpt3) and / or (hd2, msdos1)

 

So you need a FAT32 partition that can be located on internal hardisk or SSD with MBR or GPT  partitioning.



#25 wimb

wimb

    Platinum Member

  • Developer
  • 2636 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 19 January 2019 - 07:41 AM

 

In Windows 10 I used BOOTICE to make UEFI Grub2 entry for my internal SSD with FAT32 EFI partition.

 

 

And then I Select from F8 Boot Menu this UEFI Grub2 entry.

 

So I can Boot Linux ISO located in folder images on FAT32 EFI partition on internal SSD / GPT having  Windows 10 x64 system on second NTFS partition.

 

 

 

Instead of press F8 and select UEFI Grub2 from boot menu, we can change in UEFI BIOS the Boot Priority

so that the computer always is booting first with Grub2 Menu, which has as default to continue with Windows Boot Manager.

 

In the EFI\Microsoft\Boot of Windows Boot Manager we can use in the Boot entries the setting  BootMenuPolicy Legacy so that there is no reboot.

You can use BOOTICE to adjust the BCD of current system in Professional mode.

 

So in UEFI Secure mode we have the auto sequence for booting the computer:

 

Grub2 Menu with Linux ISO entries >> Windows Boot Manager Menu with Win 10 x64 and WIM and VHDX entries >> Windows 10 x64 OS

 

In this way you have an UEFI Secure Multi-Boot Computer booting with Linux and Windows

 

More Info: UEFI MULTI Forum en UEFI MULTI Download

 

:cheers:







Also tagged with one or more of these keywords: vhd, windows, boot, bcd

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users