Skip to content

Instantly share code, notes, and snippets.

@tienthanh2509
Created October 12, 2017 04:25
Show Gist options
  • Save tienthanh2509/eb9f306547c3bc281516578e0cfba077 to your computer and use it in GitHub Desktop.
Save tienthanh2509/eb9f306547c3bc281516578e0cfba077 to your computer and use it in GitHub Desktop.
Grub boot from ISO
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
# hd0 ~ sda
# hd0,1 ~ sda2
# hd0,5 ~ sda6
menuentry "Ubuntu Mini ISO" {
set isofile="/mini.iso"
loopback loop (hd0,5)$isofile
linux (loop)/linux boot=casper iso-scan/filename=${isofile}
initrd (loop)/initrd.gz
}
@tienthanh2509
Copy link
Author

tienthanh2509 commented Dec 25, 2019

menuentry "VMware" {
        insmod ext2
        set isofile="/VMware-VMvisor-Installer-201912001-15160138.x86_64.iso"
        set gfxpayload=keep
        loopback loop (hd2,msdos1)$isofile
        linux   (loop)/mboot.c32 -c boot.cfg
}

menuentry "Linux Mint 19.3" {
        insmod ext2
        set isofile="/linuxmint-19.3-cinnamon-64bit.iso"
        set gfxpayload=keep
        loopback loop (hd2,msdos1)$isofile
        linux   (loop)/casper/vmlinuz  file=(loop)/cdrom/preseed/linuxmint.seed boot=casper iso-scan/filename=${isofile} toram ---
        initrd  (loop)/casper/initrd.lz
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment