Welcome!

The kernel problem with recent updates has been solved. Find the solution here

Important information
-- Required MX 15/16 Repository Changes
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- Introducing our new Website
-- MX Linux on social media: here

Current releases
-- MX-18.3 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.4.1 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

[SOLVED] Boot ISO Using Grub4Dos

Help for Current Versions of MX
Post Reply
User avatar
Arvy
Forum Novice
Forum  Novice
Posts: 5
Joined: Sun Jun 30, 2019 7:15 pm

[SOLVED] Boot ISO Using Grub4Dos

#1

Post by Arvy » Sun Jun 30, 2019 8:00 pm

i'm currently running a multi-boot (Win10, Linux Mint, et al) setup on an Intel i9 system (details here). For reasons which I'll explain only if requested (they're quite boring) I use Grub4Dos to boot and test various options including some ISO files that have been downloaded to the /Sources folder on an SSD. MX Linux 18.3 has recently been added to those ISO file downloads and to my Grub4dos menu.lst boot options as appended below in plain text format. All of them work okay with the single exception that the start-up options that are subsequently displayed in the MX Linux boot menu don't actually boot the OS "as advertised". It says that it's searching for antiX/linuxfs but then displays the error message: "No usb,cd devices found". Having searched and read some other threads here, I've tried including "findiso=/Sources/LinuxMX64.iso" on its boot options line and also "load=all", but neither of those corrects the problem in my case.

I can boot the "live" demo fine if I actually install it on a USB stick, but I'd very much like to be able to do it my way if it's possible. Does Linux MX support booting its ISO source file directly as can be done with most other distros, or is it "hard wired" to boot only from usb and cd devices? Any suggestions would be gratefully received.

My current Grub4Dos menu.lst file:

Code: Select all

clear
color white/blue blue/white black/white green/white
splashimage /boot/grub/splash.xpm.gz
timeout 10
default 0
 
title Windows PE/RE Boot Options
find --set-root /CdUsb.Y
chainloader /bootmgr
 
title Linux Mint Cinnamon
find --set-root /boot/grub/i386-pc/core.img
kernel /boot/grub/i386-pc/core.img
 
title Linux Mint Live (ISO)
find --set-root /Sources/LinuxMint.iso
map --heads=0 --sectors-per-track=0 /Sources/LinuxMint.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)
 
title Linux MX Live (ISO)
find --set-root /Sources/LinuxMX64.iso
map --heads=0 --sectors-per-track=0 /Sources/LinuxMX64.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)
 
title Terabyte IFL Media (ISO)
find --set-root /Sources/TerabyteIFL.iso
map /Sources/TerabyteIFL.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)
 
title Acronis Rescue Media (ISO)
find --set-root /Sources/AcronisMedia.iso
map --heads=0 --sectors-per-track=0 /Sources/AcronisMedia.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)
 
title Windows 10
find --set-root /Windows/bootstat.dat
chainloader /bootmgr
 
title Reboot
reboot
 
title Shutdown
halt
Last edited by Arvy on Mon Jul 01, 2019 1:39 pm, edited 1 time in total.

User avatar
fehlix
Forum Veteran
Forum Veteran
Posts: 4610
Joined: Wed Apr 11, 2018 5:09 pm

Re: Boot ISO Using Grub4Dos

#2

Post by fehlix » Sun Jun 30, 2019 9:09 pm

You can actual boot from MX Linux ISO's but not directly through grub4dos.
You might need to add a further step to chainload grub2, e.g. grub2win's grubloader,
and from here boot into the iso's via loopback.
The trick is to use the boot option fromiso, which than is used by the Live-initrd, to find the ISO and within the ISO the squashed linuxfs system file to boot from.
You might consider to use directly grub2 (on windows) to boot directly into different iso's.
You can also chainload between grub4dos and grub2, vice versa.

A exampled grub2 config file has posted recently here and would look like this:

Code: Select all

# ISO-Boot-Menu
# copy this file to /boot/grub/custom.cfg
# copy ISO to /ISO/MX-18_x64.iso
#
submenu "ISO-Boot Menu" {
   menuentry "ISO-Boot: MX-18_x64.iso - lang=en_US kbd=us tz=America/New_York" {
      set iso_path=/ISO/MX-18_x64.iso
      search --no-floppy --set=root --file $iso_path
      probe -u $root --set=buuid
      loopback loop $iso_path
      set root=(loop)
      
      linux  /antiX/vmlinuz buuid=$buuid fromiso=$iso_path quiet lang=en_US  kbd=us tz=America/New_York
      initrd /antiX/initrd.gz
   }
   
   menuentry "ISO-Boot: MX-18_x64.iso - text menus" {
      set iso_path=/ISO/MX-18_x64.iso
      search --no-floppy --set=root --file $iso_path
      probe -u $root --set=buuid
      loopback loop $iso_path
      set root=(loop)
      
      linux  /antiX/vmlinuz buuid=$buuid fromiso=$iso_path quiet menus
      initrd /antiX/initrd.gz
   }
   
   menuentry "ISO-Boot: MX-18_x64.iso - Failsafe" {
      set iso_path=/ISO/MX-18_x64.iso
      search --no-floppy --set=root --file $iso_path
      probe -u $root --set=buuid
      loopback loop $iso_path
      set root=(loop)
     
      linux  /antiX/vmlinuz buuid=$buuid fromiso=$iso_path quiet failsafe
      initrd /antiX/initrd.gz
   }
}
HTH
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
Arvy
Forum Novice
Forum  Novice
Posts: 5
Joined: Sun Jun 30, 2019 7:15 pm

Re: Boot ISO Using Grub4Dos [UPDATE]

#3

Post by Arvy » Sun Jun 30, 2019 9:55 pm

Thank you for those Grub2 suggestions, fehlix. In fact, I had already included an entry in the same grub.cfg file (via /etc/grub.d/40_custom) that I use for booting with Linux Mint's Grub2 set-up. That does work as specified for booting the MX Linux ISO directly into its demo environment without a boot menu of its own. It's only my Grub4dos menu.lst entry that I can't seem get working as it does for booting all other ISOs. Actually, it does boot the MX Linux ISO and load its boot manager menu okay. It's just that the boot manager can't then seem to locate and load the kernel within the ISO. Not sure why it should be different in that respect unless it's "hard wired" that way.

+++ [UPDATE] +++

Well, I got it half working. After Grub4dos successfully boots the ISO to the MX Linux boot manager, I just need to add the following to the options for its start-up menu:
bdev=/dev/sda1 iso=/Sources/LinuxMX.iso

Note that it's iso= (not fromiso=) and, of course, the bdev= option may not be the same for others. Not very convenient, but it'll do for my immediate trial purposes.

User avatar
JayM
Forum Guide
Forum Guide
Posts: 1812
Joined: Tue Jan 08, 2019 4:47 am

Re: Boot ISO Using Grub4Dos

#4

Post by JayM » Sun Jun 30, 2019 11:48 pm

If you press F8 at the MX startup menu you can enable saving of those boot options so you don't have to type them every time.
Please read How To Ask For Help and How to Break Your System.
MX User Manual: hold down ALT and press F1. Further information may be found in the MX Wiki.

User avatar
Arvy
Forum Novice
Forum  Novice
Posts: 5
Joined: Sun Jun 30, 2019 7:15 pm

Re: Boot ISO Using Grub4Dos

#5

Post by Arvy » Mon Jul 01, 2019 12:14 am

Thanks very much for the suggestion, JayM. That would be great. Unfortunately, when the ISO is booted directly as I'm doing with Grub4dos, it behaves as if it were booted on optical media and doesn't provide the the F8 Save option in the start-up menu.

Eventually, I'll get around to setting things up properly, but for now it's just at the experimental exploratory stage. So I'll just have to accept some temporary inconveniences of my own making. Other than that, I'm quite favourably impressed so far.

User avatar
JayM
Forum Guide
Forum Guide
Posts: 1812
Joined: Tue Jan 08, 2019 4:47 am

Re: Boot ISO Using Grub4Dos

#6

Post by JayM » Mon Jul 01, 2019 12:28 am

If you want to enable persistence you can configure it to use a separate USB thumbdrive for that. I can't tell you how as I've never tried it but I believe it's documented either in the user manual or the wiki. That would give you another thing to experiment and have fun with.

Another thing you could try is to temporarily burn the ISO directly to a USB stick with MX Live USB Maker, boot from it to its main settings menu screen then enable saving and add your boot parameters and see if it will still boot from the USB using them. If so, you can remaster then create a snapshot of it, then boot from your snapshot ISO inGrub4Dos and see if your boot parameters are still there (they should be.) That might be a fun thing to try. :smile:
Please read How To Ask For Help and How to Break Your System.
MX User Manual: hold down ALT and press F1. Further information may be found in the MX Wiki.

User avatar
Arvy
Forum Novice
Forum  Novice
Posts: 5
Joined: Sun Jun 30, 2019 7:15 pm

Re: Boot ISO Using Grub4Dos [UPDATE]

#7

Post by Arvy » Mon Jul 01, 2019 12:45 am

Okay, I may try that and I'll post back if I do, but maybe not for a day or two. At this stage, having only recently moved to Linux from Windows, I'm just beginning to explore the differences among various distros and haven't yet even discovered all of their config parameters and where each one locates them all. And yes, I'm having plenty of fun. But it's now past this old geezer's bed time. :happy:

+++ [UPDATE] +++

Sorry, Jay, but having seen enough of the demo to make me over-eager to try out a full installation, I skipped over your suggested experiments and just went ahead with a standard single-partition setup on one of my SSDs. Wanted to install on an NVMe device, but for some reason the GParted version invoked by the MX installer wouldn't allow me to resize the existing nvme0n1p1 ext4 partition to create an new one there. Anyhow, the full setup is working fine. Now I just have to get all of the multipe OS boot managers "synchronized" with each other. :crossfingers:

User avatar
Arvy
Forum Novice
Forum  Novice
Posts: 5
Joined: Sun Jun 30, 2019 7:15 pm

Re: [SOLVED] Boot ISO Using Grub4Dos

#8

Post by Arvy » Sun Jul 07, 2019 3:08 pm

I don't normally reply to my own queries, but, in view of the suggestions offered by fehlix and JayM, the final outcome may be of some general interest. In essence, I ended up "dumping" Grub4Dos completely in favour of Grub2 -- more or less what fehlix was suggesting, I think, except than no Grub2Win was actually required as a replacement.

My own solution was made easier by the very recent Windows capability for recognizing more than a single partition on USB sticks. (Only W10.1809 and later AFAIK.) Provided that the first partition is Windows readable (i.e., FAT32 or NTFS), a second partition can be ext4 formatted. That second partition can then be mounted and specified as the target (--boot-directory=) for a standard Grub2 installation. Thus, in addition to Grub2's normal handling of the ext4 partition's contents, including ISOs, it can also chainload the windows boot manager (ntldr /bootmgr) on the first partition and that, in turn, can handle options for booting WinPE and WinRE image files on that part of the USB stick.

For those with earlier Windows versions who may be forced to use Grub4Dos to accomplish similar multi-boot USB purposes, it is critical to avoid formatting any ext4 partitions with 64-bit extensions. Grub4Dos can't handle them. If necessary, any pre-existing 64-bit ext4 partition extensions can be removed with the sudo resize2fs -s /dev/sdXY command. They don't actually accomplish much for anything under 16 TB anyhow.

__
P.S.: I'm very impressed with MXlinux generally. Not so keen on its default thunar file manager lacking full control over execute permissions, but nemo works fine as an alternative. LAMP installation, including PhpMyAdmin, was a breeze.

Post Reply

Return to “MX Help”