How to boot an ISO from grub menu? READ POST 1. SOLVED

Message
Author
User avatar
Richard
Posts: 1577
Joined: Fri Dec 12, 2008 10:31 am

How to boot an ISO from grub menu? READ POST 1. SOLVED

#1 Post by Richard »

[NOTE2: After experiencing both methods, I prefer the Frugal Persistence install.
With Frugal I can change and add things as I wish and it persists. Direct grub boot doesn't.
YMMV. I'm glad I tried them both. Now to see where to save some SSD space.
After completing the Frugal install, you'll need to reboot, and then look for the menuentry, that
you will find in the file grub.entry inside the folder /antiX-Frugal-4.15.0-1-amd64,
(the numbers will depend on your kernel). Copy the menuentry stanza in grub.entry
into /etc/grub.d/40_custom, just as with the other method.
Dolphin_Oracle's video explains how: https://www.youtube.com/watch?v=6ZGTBUW3bnA

Persistence menus should no longer present themselves, thanks to this post from anti:
#15 Post by anticapitalista » 08 May 2018, 17:26
If you don't want the menus to show up, remove the word menus from the grub entry.
Also, on my Intel box I had to also remove the word nomodeset.
You can't run persistence with fromiso
Adding a corrected menuentry stanza above the first for completeness.
You can always add back any of the debugging code desired or needed.

Leaving the menuentry stanza, just below, as is. If you don't want to see the menus anymore
you can remove "menus" from set bootparams line. Mine wouldn't boot after that,
so as anti mentioned, on Intel mobo's probably need to remove "nomodeset"

[NOTE] Here is the final working stanza, for /etc/grub.d/40_custom, that works for booting MX-Workbench
via the grub2 menu with MX-17.1_x64, no persistence is possible.
Of course, you must change "set iso=" to the path to your iso location:

Code: Select all

menuentry "MX-Workbench_18.3_x64.iso" {
     echo Boot disk address is: $root
     set iso="/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso"
     set bootparms="from=all quiet"
     search -f $iso --set=root
     echo ISO root is:  $root
     echo ISO is:         $iso
     echo Boot parms are: $bootparms
     echo
     loopback loop $iso
     sleep -i -v 5
     linux (loop)/antiX/vmlinuz fromiso=$iso $bootparms
     initrd (loop)/antiX/initrd.gz
     echo Booting $iso
} 

Code: Select all

menuentry "MX-Workbench_18.3_x64.iso -- with menus" {
     echo Boot disk address is: $root
     set iso="/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso"
     set bootparms="from=all quiet menus nomodeset"
     search -f $iso --set=root
     echo ISO root is:  $root
     echo ISO is:         $iso
     echo Boot parms are: $bootparms
     echo
     loopback loop $iso
     sleep -i -v 15
     linux (loop)/antiX/vmlinuz fromiso=$iso $bootparms
     initrd (loop)/antiX/initrd.gz
     echo Booting $iso
} 
1. It boots and runs. Have removed all persistence menus since persistence can not work when booted in this manner. Persistence will work when booted as a Frugal Install which I now feel is more desirable.

2. Don't forget to run "update-grub" after any changes to /etc/grub.d/40_custom.

3. My actual partitions on sda are as follows:
sda1 = /DATA/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso
sda2 = /
In the set iso line, I had to remove /DATA from the beginning of the path to the iso
because the search finds the partition /DATA.

4. Suggestion: When the first stanza is working for you, copy it to a second stanza with a different name
and continue fiddling with the second one. ESC will always take you back to the grub menu if you see a problem while traversing the new stanzas in the grub menu. You can reduce the timeout from 15 seconds to whatever seems appropriate.

5. Genuine thanks to all who commented with suggestions. I didn't try them all
because anticapitalista's and Ed_P's suggestions brought success,
and they had showed how to use fromiso, as Jerry3904 mentioned.

6. There is good information in the other posts, in case you have problems getting some iso to boot
from the grub menu. I will certainly keep them in mind. Thanks to male, Jerry3904, ChrisUK
for suggestions and to Adrian for the MX Workbench
[/NOTE]


[ORIGINAL POST STARTS HERE]
I want to boot MX-Workbench from the iso on the SSD by means of the MX17.1 Grub2 boot menu. I found a few references that say it is possible. My problem is the actual contents of the stanza in /etc/grub.d/40_custom aren't working.

This is what I have on the SSD: {inxi -Fxzdlop at EOF}
1. Actual path to the ISO:
There are only 2 partitions on the disk:
sda1 = /DATA/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso
sda2 = /

2. ## /etc/grub.d/40_custom stanzas...Trials 1..n

3. Saved all edits and executed update-grub and reboot...


## Trial 4:
menuentry “MX-Workbench_18.3_x64.iso” {
set isopath=/DATA/CDs/Utils/MX-Workbench
set isoname="MX-Workbench_18.3_x64.iso"
set isofile="${isopath}/${isoname}"
echo "Using ${isoname}..."
loopback loop $isofile
linux (loop)/vmlinuz boot=antiX findiso=${isofile}
initrd (loop)/initrd.gz
loopback loop (hd0,1)/$isofile
}
error: file `DATA/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso' not found
error: disk `loop' not found
error: you need to load the kernel first
error: file `//DATA/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso' not found
press any key to continue...



## Trial 3:
menuentry “MX-Workbench_18.3_x64.iso” {
set isofile=”DATA/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso”
loopback loop (hd0,1)/$isofile
linux (loop)/antix/vmlinuz
initrd (loop)/antix/initrd.gz
boot
}
error: file `/"DATA/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso” not found
error: disk `loop' not found
error: you need to load the kernel first
error: you need to load the kernel first
press any key to continue...



## Trial #2:
# menuentry “MX-Workbench_18.3_x64.iso” {
set isofile=”/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso”
set root=(hd0,2)
loopback loop (hd0,1)/$isofile
linux (loop)/antix/vmlinuz
initrd (loop)/antix/initrd.gz
boot
}
error: file `/"DATA/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso” not found
error: disk `loop' not found
error: you need to load the kernel first
error: you need to load the kernel first
press any key to continue...



## Trial #1:
# menuentry “MX-Workbench_18.3_x64.iso” {
set isofile=”/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso”
loopback loop (hd0,1)/$isofile
linux (loop)/antix/vmlinuz
initrd (loop)/antix/initrd.gz
}
invalid file name `"/CDs/Utils/MX-Workbench/MX-Workbench_18.3_x64.iso” not found
error: disk `loop' not found
error: you need to load the kernel first
press any key to continue...



What am I doing wrong?
All pointers, code appreciated.
Thanks for your time.

Code: Select all

root@mx171:/home/richard# inxi -Fxzdlop
System:    Host: mx171 Kernel: 4.15.0-1-amd64 x86_64 bits: 64 compiler: gcc v: 6.3.0 
           Desktop: Xfce 4.12.3 tk: Gtk 2.24.31 Distro: MX-17.1_x64 Horizon March 14, 2018 
Machine:   Type: Laptop System: LENOVO product: 2347AY1 v: ThinkPad T430 serial: <filter> 
           Mobo: LENOVO model: 2347AY1 v: NO DPK serial: <filter> UEFI [Legacy]: LENOVO 
           v: G1ET73WW (2.09 ) date: 10/19/2012 
Battery:   ID-1: BAT0 charge: 22.9 Wh condition: 23.5/56.2 Wh (42%) model: SANYO 45N1001 
           status: Unknown 
CPU:       Topology: Dual Core model: Intel Core i5-3320M bits: 64 type: MT MCP arch: Ivy Bridge 
           rev: 9 L2 cache: 3072 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 20752 
           Speed: 1202 MHz min/max: 1200/3300 MHz Core speeds (MHz): 1: 1197 2: 1197 3: 1197 
           4: 1200 
Graphics:  Card-1: Intel 3rd Gen Core processor Graphics driver: i915 v: kernel bus ID: 00:02.0 
           Display: x11 server: X.Org 1.19.2 driver: intel resolution: 1600x900~60Hz 
           OpenGL: renderer: Mesa DRI Intel Ivybridge Mobile v: 3.3 Mesa 13.0.6 
           direct render: Yes 
Audio:     Card-1: Intel 7 Series/C216 Family High Definition Audio driver: snd_hda_intel 
           v: kernel bus ID: 00:1b.0 
           Sound Server: ALSA v: k4.15.0-1-amd64 
Network:   Card-1: Intel 82579LM Gigabit Network Connection driver: e1000e v: 3.2.6-k port: 5080 
           bus ID: 00:19.0 
           IF: eth0 state: up speed: 100 Mbps duplex: full mac: <filter> 
           Card-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi v: kernel 
           bus ID: 03:00.0 
           IF: wlan0 state: up mac: <filter> 
Drives:    HDD Total Size: 585.00 GiB used: 86.23 GiB (14.7%) 
           ID-1: /dev/sda model: Samsung_SSD_840 size: 119.24 GiB 
           ID-2: /dev/sdb type: USB model: Hard_Drive size: 465.76 GiB 
           Optical-1: /dev/sr0 vendor: Optiarc model: DVD RW AD-7740H rev: 1.S1 
           dev-links: cdrom,cdrw,dvd,dvdrw 
           Features: speed: 24 multisession: yes audio: yes dvd: yes 
           rw: cd-r,cd-rw,dvd-r,dvd-ram state: running 
Partition: ID-1: / size: 20.54 GiB used: 13.88 GiB (67.6%) fs: ext4 dev: /dev/sda2 label: MX171 
           ID-2: /DATA size: 96.20 GiB used: 72.36 GiB (75.2%) fs: ext4 dev: /dev/sda1 
           label: DATA 
Unmounted: ID-1: /dev/sdb1 size: 465.76 GiB fs: ntfs label: SONY uuid: 26C28F5FC28F31DB 
Sensors:   System Temperatures: cpu: 52.0 C mobo: N/A 
           Fan Speeds (RPM): cpu: 3768 
Info:      Processes: 220 Uptime: 16m Memory: 7.48 GiB used: 712.1 MiB (9.3%) Init: SysVinit 
           runlevel: 5 Compilers: gcc: 6.3.0 Shell: bash v: 4.4.12 inxi: 3.0.06 
Last edited by Richard on Tue May 08, 2018 8:06 pm, edited 27 times in total.
Thinkpad T430 & Dell Latitude E7450, both with MX-21.3.1
kernal 5.10.0-26-amd64 x86_64; Xfce-4.18.0; 8 GB RAM
Intel Core i5-3380M, Graphics, Audio, Video; & SSDs.

male

Re: How to boot an ISO from grub menu?

#2 Post by male »

Richard wrote:My problem is the actual contents of the stanza in /etc/grub.d/40_custom aren't working.
I stumbled about that at the end of last year. :lion:
Unfortunately only in German. My solution (there are several):
Create a new one, e.g. "42_myISO"

Conditions:
1. the ISO must not be on raid or lvm
2. the script must not contain partitions that already exist with /etc/grub.d/10_linux or called with the other scripts. (for me this would be the case with 40_custom + arch with sdb5,
because the isos are in sdb6)
3. because of the consideration of the kernel entries the script must be AFTER 10!

Content of the new script in /etc/grub.d/42_myISO

Code: Select all

#! /bin/sh -e
echo "Adding Live CD entry" >&2

 cat << EOF
menuentry 'loopback ISO-maui-plasma (auf /dev/sdb6)' {
	insmod loopback
	insmod iso9660
	insmod part_msdos
	insmod fat
	insmod ext2
	search -n -f --set=root ${GRUB_LOOPBACK_ISO_FILE}
	loopback loop ${GRUB_LOOPBACK_ISO_FILE}
	linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${GRUB_LOOPBACK_ISO_FILE} quiet splash
	initrd (loop)/casper/initrd.lz
}
EOF
in /etc/default/grub:

Code: Select all

export GRUB_LOOPBACK_ISO_FILE="/maui/maui-1703-64bit.iso"

User avatar
Jerry3904
Administrator
Posts: 21940
Joined: Wed Jul 19, 2006 6:13 am

Re: How to boot an ISO from grub menu?

#3 Post by Jerry3904 »

There is a boot parameter:

Code: Select all

fromiso=*
I have never tried it, and see a note in the Wiki that it is deprecated but is retained by popular demand.
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox and Windows 10
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

User avatar
ChrisUK
Qualified MX Guide
Posts: 299
Joined: Tue Dec 12, 2017 1:04 pm

Re: How to boot an ISO from grub menu?

#4 Post by ChrisUK »

Assuming you've not fixed it yet:

I was playing with booting a Siduction iso from Grub a while back... the following seemed to work:

Code: Select all

menuentry "Siduction  grub_iso" --class dvd {
    set isofile="/miso/siduction-18.1.0-patience-xfce-amd64-201712310104"
    set dri="free"
    search --no-floppy -f --set=root $isofile
    probe -u $root --set=abc
    set pqr="/dev/disk/by-uuid/$abc"
    loopback loop $isofile
    linux  (loop)/boot/vmlinuz-x86_64  img_dev=$pqr img_loop=$isofile driver=$dri
    initrd  (loop)/boot/intel_ucode.img (loop)/boot/initramfs-x86_64.img
}
Maybe you can adapt it after comparing other alternatives... or mix and match ;)
Chris

MX 18 MX 19 - Manjaro

User avatar
Richard
Posts: 1577
Joined: Fri Dec 12, 2008 10:31 am

Re: How to boot an ISO from grub menu?

#5 Post by Richard »

Thanks for the suggestions.
I know it used to work in sidux but that's been a while.
And I think it was grub1. Supposedly grub2 is easier. :)

Now to do some testing. Thanks again.
Thinkpad T430 & Dell Latitude E7450, both with MX-21.3.1
kernal 5.10.0-26-amd64 x86_64; Xfce-4.18.0; 8 GB RAM
Intel Core i5-3380M, Graphics, Audio, Video; & SSDs.

User avatar
anticapitalista
Developer
Posts: 4166
Joined: Sat Jul 15, 2006 10:40 am

Re: How to boot an ISO from grub menu?

#6 Post by anticapitalista »

anticapitalista
Reg. linux user #395339.

Philosophers have interpreted the world in many ways; the point is to change it.

antiX with runit - lean and mean.
https://antixlinux.com

User avatar
Richard
Posts: 1577
Joined: Fri Dec 12, 2008 10:31 am

Re: How to boot an ISO from grub menu?

#7 Post by Richard »

Yes, and it boots. Thanks!

It went through all the steps to create persistence, as well. Will have change something to see how that works.

Had to read up on the reason for the
# sleep -i -v15
Neat, shows a count down and the possibility to return to the grub2 menu.
Thinkpad T430 & Dell Latitude E7450, both with MX-21.3.1
kernal 5.10.0-26-amd64 x86_64; Xfce-4.18.0; 8 GB RAM
Intel Core i5-3380M, Graphics, Audio, Video; & SSDs.

User avatar
Jerry3904
Administrator
Posts: 21940
Joined: Wed Jul 19, 2006 6:13 am

Re: How to boot an ISO from grub menu?

#8 Post by Jerry3904 »

Can you please lay out the steps you used so we're can get a Wiki entry out of this?
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox and Windows 10
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

User avatar
Richard
Posts: 1577
Joined: Fri Dec 12, 2008 10:31 am

Re: How to boot an ISO from grub menu?

#9 Post by Richard »

Ok, when I understand it better,
I'll write up my experiences.

NOTE: See the first post in this thread for the working stanza for MX-Workbench.
Last edited by Richard on Sun May 06, 2018 5:26 pm, edited 2 times in total.
Thinkpad T430 & Dell Latitude E7450, both with MX-21.3.1
kernal 5.10.0-26-amd64 x86_64; Xfce-4.18.0; 8 GB RAM
Intel Core i5-3380M, Graphics, Audio, Video; & SSDs.

User avatar
Richard
Posts: 1577
Joined: Fri Dec 12, 2008 10:31 am

Re: How to boot an ISO from grub menu?

#10 Post by Richard »

Will try adding a few more utilities to get more familiar with the term.

Although MX Workbench has everything I've ever used, already included. It is much more useful than I thought when Adrian released the first one.

Having it bootable without the need for a separate USB makes it quicker and more accessible for many.
Last edited by Richard on Sun May 06, 2018 5:26 pm, edited 1 time in total.
Thinkpad T430 & Dell Latitude E7450, both with MX-21.3.1
kernal 5.10.0-26-amd64 x86_64; Xfce-4.18.0; 8 GB RAM
Intel Core i5-3380M, Graphics, Audio, Video; & SSDs.

Post Reply

Return to “Software / Configuration”