ISO File Boot

Google Translate Button


Booting ISO Files


These are the steps required to set up a Grub2Win menu entry for booting an ISO file. The file can be on a hard disk, CD, DVD or USB flash drive.


First add a new menu entry by clicking "Add A New Entry" on the Managing the boot menu  screen.

When the orange Edit screen appears, select an OS Type of isoboot.


You will now see the Entering custom code screen. You can click either the Select ISO File or Load Sample Code button to get started.



#

#            This is sample code for booting from an iso file

#            via the Grub2Win g2wisoboot function

#

#

#            Notes: There are many many ISO files available. They are all different.

#                   You must examine your particular ISO file with a utility like 7-Zip to

#                   obtain the proper kernel and initrd paths.

#                   You can then set the kernelpath and initrdpath variables below.

#                   The kernel and initrd files will not be found unless the correct paths are set.  

#

#                   Literal strings in the setparams command must be surrounded by single quotes '      

#

#

     clear

     set isopath=/** your iso file path **                # Example  set isopath=/my.linux.iso

     set kernelpath=/** kernel path **                    # Example  set kernelpath= /vmlinuz

     set initrdpath=/** initrd path **                       # Example  set initrdpath=/initrd.img

     setparams      '** your linux bootparms **'       # Example  setparams      'boot=/ iso-scan/filename='     $isopath      ' noprompt noeject ---'



     g2wisoboot "$1""$2""$3""$4""$5""$6""$7""$8""$9""$10"    #  Run the g2wisoboot function ** Do not touch this line!

#



If you click the Select ISO File button. Grub2Win will fill in the path to the ISO file you select and set the isopath variable for you. Grub will search all available drives at boot time to locate this file.


You will need to edit the code to set three variables: isopath, kernelpath, initrdpath and use the setparams command to create the boot parameters. Click the "Edit Custom Code" button to open notepad and edit the code.


Set the kernelpath and initrdpath variables to the location within the iso file where the kernel and initrd are located. You can open your iso file with 7-Zip to find the paths to these files.


The initrdpath variable can be set to contain multiple files separated by spaces with surrounding single quotes, example:

set initrdpath='/casper/initrd1 /casper/initrd2 /casper/initrd3'


Use the setparams command to create the boot parameters required for your Linux distribution. These parameters can be complex and vary widely, so you will need to consult the documentation for your particular software.


Once you have set up the variables, save the file and continue with your menu entry. Grub2Win will include the necessary function in the C:\grub2\grub.cfg file for your new ISO Boot menu entry.



You can practice using isoboot to boot the Ubuntu 23.10 Mate 64 bit ISO file which can be downloaded here:



https://cdimages.ubuntu.com/ubuntu-mate/releases/23.10/release/ubuntu-mate-23.10-desktop-amd64.iso



Here is the working code used to boot the Ubuntu ISO. You will need to set the isopath variable to the location where you save the ISO file.


********************************************************************************************************************

                                           

set isopath=ubuntu-mate-23.10-desktop-amd64.iso

set kernelpath=/casper/vmlinuz

set initrdpath=/casper/initrd


setsetparams   'boot=casper iso-scan/filename='    $isopath     ' noprompt noeject ---'



g2wisoboot   "$1""$2""$3""$4""$5""$6""$7""$8""$9""$10"         #  Run the g2wisoboot function ** Do not touch this line!


*******************************************************************************************************************


Note: If you get "error: read out of range" when loading the kernel, it may indicate that your .iso file is fragmented. This is a known bug in GNU Grub. Try moving your .iso file to another partition.































Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?