agFM – a1ive grub2 File Manager

The default agFM theme

Menu systems on an Easy2Boot USB drive include: 

  • Easy2Boot – a grub4dos-based MBR\Legacy-only menu system
  • agFM – a grub2-based MBR\Legacy+UEFI32+UEFI64 menu system based on grubfm (optional)
  • Ventoy for Easy2Boot – a grub2-based MBR\Legacy+UEFI32+UEFI64 menu system based on Ventoy  (optional)

Although agFM can also MBR\Legacy boot, I recommend that you use the E2B menu system for Legacy booting and the agFM menu system for UEFI booting. E2B has been developed and tested over many years and is usually more compatible than agFM or Ventoy when used with a Legacy BIOS.
Ventoy may be more successful when booting some BSD-based ISOs and WinPE-based ISOs.

Note: Some (but not all) boot options require the ISO file to be contiguous.

Introduction to agFM

  • agFM is grub2-based and is a modified version of grubfm by a1ive (github project). The agFM boot files are located on the 2nd FAT32 partition. Partition 4 should not be present on the USB drive.
  • MBR-boot to agFM from the E2B Legacy menu on Partition 1 or directly UEFI-boot to agFM from the 2nd partition.
  • agFM can boot payload files from any drive or partition. For example, you can add your ISOs, VHDs, WIM files to Partition 3 of the USB drive (or other drives\partitions).
  • Boot to Windows Install ISO files (even >4GB)), Linux ISOs, WIM, VHD, EFI and IMG files.
  • To UEFI-boot to agFM you must boot from the second FAT32 partition – payload files are usually on first NTFS partition (but can be on other partitions or drives).
  • To Legacy-boot to agFM you must first boot to the Easy2Boot menu and then select the agFM menu entry.
  • Windows ISOs do not need to be contiguous (but should not be highly fragmented).
  • Secure UEFI64-boot to most ISOs (even >4GiB Windows ISOs or non-secure ISOs) – uses Kaspersky shim.
  • If booting a .VHD or .imgPTN file or using the Easy2boot\partnew boot option then the file must be contiguous.
  • Secure UEFI-boot from FAT32 Windows Install .imgPTN files + other OS’s.
  • Secure UEFI-boot to FAT32+NTFS .imgPTN files (e.g. for large Windows Install ISOs >4GiB).
  • Switch-in different images into Partition 3 using the .imgPTNREP3 file extension (e.g. ext4, Linux swap or hfs Mac OSX partitions).
  • Configurable menu theme/wallpaper/text colours/layout.
  • Design your own initial start-up menu.
  • Add your own menu entries for special functions such as Linux+persistence, or UEFI64-booting and then running a Legacy-only Linux ISO, etc.
  • Replace the agFM partition with the latest official Ventoy version and transform the USB drive into an official Ventoy USB drive.

Get the eBook!

eBook #4 – a1ive grub2 File Manager for Easy2Boot (PDF)  – UEFI multiboot using the agFM grub2 File Manager. How to add Linux ISOs, DLCBoot, Strelec WinPE, HBCD, Gandalf, Medicat, Kaspersky, DrWeb, Eset, Norton Rescue, Avast, GData, Trend Micro AV, Adaware, Comodo AV, Windows Install ISOs, etc.

To update agFM (under Windows 10)

Run “\e2b\Update agFM\Download and update agFM_v2.cmd” on the FAT32 2nd partition 

or (if agFM is an old version) use…

\_ISO\docs\Make_E2B_USB_Drive\Download and update agFM_v2.cmd” which on the first partition.


you can instead run Make_E2B.exe from the E2B download and click on the ‘Update E2B drive’ button to update E2B, agFM and Ventoy.

To add agFM – if not already present on Partition 2

If you have a USB Flash drive you will need a Windows 10 system to add files to Partition 2 (MBR partition – FAT32 600MB+).

If the agFM files are not already present on the 2nd FAT32 Primary partition, you can download the agFM files from the Alternate Downloads sitesa1ive grub2 file manager folder and extract the contents directly onto the root of partition 2. The latest version can be downloaded directly here:

After adding the agFM files, you can add the Ventoy files by running \e2b\Update agFM\Update_to_latest_Ventoy_version.cmd from partition 2.

Updating agFM under Windows XP/7/8

If you don’t have a Windows 10 system you can run the Install_agFM.exe utility (see eBook #4 for download)

After you have made the E2B drive using Make_E2B.exe (make a two-partition USB drive), you then run Install agFM.exe which performs the following actions:

  • 1. Asks the user for the USB drive number – DO NOT ENTER THE WRONG DRIVE NUMBER!
  • 2. Deletes the second partition on the chosen drive
  • 3. Creates a new FAT32 second partition using the remaining space (Z:)
  • 4. Re-orders the first and second partition so that partition 2 is now accessible as drive Z:
  • 5. Downloads the currently released of agFM and extracts the files to the second partition
  • 6. Re-orders the first and second partitions back to their original order
  • 7. Re-assigns a drive letter to partition 1

agFM folders/files

agFM files/folders on Partition 2

\grubfmx64.efi – the UEFI64 version of grubfm by a1ive
\ventoy – part of ‘Ventoy for Easy2Boot’ – also contains sample Ventoy cfg and json files
\tool – part of ‘Ventoy for Easy2Boot’
\Sources – you can add a bootable WinPE .wim file here (see eBook #4)
\MEMTEST86 – PassMark MemTest86 UEFI (free version)
\grub – used in booting Ventoy
\EFI – Most UEFI boot files, etc. Includes Clover, Microsoft BCD, rEFInd
\boot – agFM files
\e2b\grubfm.iso – MBR boot file for grubfm/agFM
\e2b\SWITCH_E2B.exe – Windows program to switch in a .imgPTN partition image file or restore an E2B drive
\e2b\*.cfg – various agFM example .cfg files
\e2b\Sample agFM menu files – examples of grub2 menu files (e.g. boot Linux ISO with persistence)
\e2b\Update agFM:
Download and update agFM_v2.cmd – updates agFM to the latest released version
Update_to_latest_Ventoy_version.cmd – downloads the latest ‘Ventoy for Easy2Boot’ version can calls Add_Ventoy.cmd
Add_Ventoy.cmd – extracts the needed files from a ‘Ventoy for Easy2Boot’ zip file
Make_Latest_Ventoy_Partition_Image.cmd – downloads the latest ‘official’ Ventoy version and converts it to partition images
GetLatestVentoyPluginFiles.cmd – downloads the latest plugins required by Ventoy for some functions (Windows vhd plugin, Windows wim plugin, Linux persistence .dat files in a .zip file, bootable ISO to remove Ventoy Secure Boot whitelist key from UEFI BIOS NVRAM) – see for details or my Ventoy eBook.

Using agFM

When agFM boots, a brief information screen will be displayed first to show you the BIOS mode and Secure Boot details:

agFM info is displayed only for a few seconds.

The agFM menu system can have an initial grub2-based menu, after which a ‘File Explorer’ type menu system is loaded. This allows you to select any file on any drive in the system (not just the files on the USB drive).

To MBR\Legacy boot – first Legacy boot to the E2B Menu system – then select the ‘a1ive grub2 File Manager (agFM)’ menu entry as shown below:

Easy2Boot Legacy menu will list the agFM Legacy menu entry

0 Set default menu entry and timeout – set the Main menu default menu option and countdown timeout
1 a1ive grub2 File Manager – loads the agFM grub2 menu system (Legacy mode)
2 Clover 64-bit UEFI Boot – Clover is a substitute UEFI BIOS, use it to boot various .EFI files from a Legacy BIOS (it is better to directly UEFI-boot from Partition 2, if possible)
3 Clover 32-bit UEFI Boot – Clover is a substitute UEFI BIOS, use it to boot various .EFI files from a Legacy BIOS (it is better to directly UEFI-boot from Partition 2, if possible)
4 Ventoy – loads the Legacy grub2-based USB multiboot Ventoy menu system
5 Disable UEFI64 secure Boot (blank screen BUGFIX) – some BIOSes will not load the Kaspersky shim which is used for bypassing Secure Boot. If you have Secure Boot enabled in your BIOS and you try to UEFI64-boot from partition 2 and get a blank screen on some systems, you will need to use this option to replace the Kaspersky Secure Boot shim and disable Secure Boot in your BIOS. Then UEFI64-boot using non-secure booting.
6 Disable UEFI-booting from Partition 2 – this is a workaround for another BIOS bug. Some UEFI BIOSes will not offer the choice to Legacy-boot from the E2B USB drive unless you remove the UEFI boot files. This option renames the EFI folder so that these BIOSes will allow you to Legacy boot from the E2B drive (the same menu option is available if you UEFI64-boot to agFM). To re-enable UEFI-booting from the E2B USB drive, you must first use the ‘Enable UEFI-booting from Partition 2’ menu entry.
7… – sub-menus and other options

To UEFI-boot, use your BIOS Boot Selection pop-up menu to select Partition 2 on the E2B USB drive.

To UEFI-boot, select the correct EFI BIOS entry (Partition 2)
Default agFM startup menu
Using the agFM File Manager menu system (F2), you can locate any payload file on any drive and select it.

Tip: When you first boot to agFM, it will tell you what mode it has booted in (Legacy, UEFI32, UEFI64, Secure Boot, etc.)…

agFM startup information

On first startup, agFM will load a special ‘startup’ menu before it runs the grubfm Explorer menu system. You can modify this startup menu if you wish, change contents and appearance, etc.

Note: the default start-up menu can be configured to not allow you to press c to get to the grub2 console or e to edit a grub2 menu entry unless you first press the TAB key. Once you get to the agFM explorer interface the TAB key is ignored.

Use the keyboard cursor UP/DOWN/PgUP/PgDn/Home/End keys.

F10 will reload agFM and the startup menu.

agFM default startup menu

The default agFM start menu is at \boot\grubfm\startup_default.cfg and will show entries for:

  • Predefined E2B menu folders on Partition 1 (only those that contain files)
  • MemTest86 (UEFI)
  • Disable Kaspersky UEFI64 Secure Boot (fix blank screen on boot)
  • Disable agFM UEFI booting (rename /EFI boot folder)
  • Ventoy for Easy2Boot (hotkey V)
  • rEFInd (UEFI64)
  • TEXT MODE MENU – English US (hotkey F7)

Note: F10 will reload the startup menu even when in the agFM Manager menus.

‘Disable Kaspersky UEFI64 Secure Boot’ replaces the Kaspersky signed shim with a standard unsigned grub2 EFI boot because some UEFI bioses do not seem to like the Kaspersky shim and just give a blank screen on boot.

‘Disable agFM UEFI booting’ will make the agFM Partition 2 non-UEFI bootable by renaming the EFI folder. This is useful because some buggy UEFI bioses will always UEFI-boot if they see the UEFI bootx64.efi boot file is present and will not allow you to legacy\MBR boot even if you have enabled CSM in BIOS Setup.

‘rEFInd’ is a UEFI boot manager. It also allows you to perform other functions such as install rEFInd to disks in the system and manage the EFI BIOS boot order,

‘TEXT MODE (F7)’ is useful if you find that some UEFI payloads use an incompatible graphics mode when you boot to them. Sometimes using text mode system fixes this. It also helps if the agFM grub2 graphical menu seems to react very slowly when scrolling, etc.

User Startup Menu

You can also insert your own menu or submenu into the default startup menu without needing to change the default menu file (agFM v1.86+): You can create one or more of the files listed below and your menuentry or submenu will be added into the default menu at the specified place. By adding these files you do not need to create your own startup menu file…

  • /boot/grubfm/user_menu_top.cfg
  • /boot/grubfm/user_menu_middle.cfg
  • /boot/grubfm/user_menu_bottom.cfg

You can also add settings into any of these menu files to set a different theme, language, keyboard, password, etc. See SAMPLE_user_menu_top.cfg for an example.

You can create your own startup menu but do not modify the startup_default.cfg file because it will be overwritten whenever you next update agFM (see eBook #4 for more details). You can copy the contents of the starttup_default.cfg file and create a new file called startup_menu.txt. This will take preference over the startup_default.cfg file and will be run instead. Note that the grubfm_multiarch.iso will also run your startup_menu.txt file too!

Add payload files (ISO files, etc.)

Although you can copy your payload files to any folder or partition on the E2B USB drive, it is best to use the standard E2B menu folders so that the files will also be listed by the E2B Menu system.

Windows Install ISO files should always be copied to the appropriate E2B menu folder – e.g. \_ISO\WINDOWS\WIN10 for a Windows 10 Install ISO file. This allows you to use it with Easy2Boot and to use the XML files if required.
Note: Please ensure the file extension .xml is lower-case for agFM or else it will not be listed.

All other types of ISO file can be copied to whichever menu folder that you like. For instance, you can copy an Ubuntu LiveCD ISO file to the \_ISO\LINUX folder or to the \_ISO\MAINMENU folder or even to the \_ISO\DOS folder.

Ubuntu ISO in \_ISO\LINUX folder

Select the payload file from any folder on any drive…

The method of booting the payload file is determined by the file extension that the payload file has.

The Secondary Menu allows you to choose several different boot methods…

Secondary Menu for ISO files

You can suppress the secondary menu by changing the file extension (use Windows Explorer or Linux to rename the file). This means you do not have to remember which secondary menu option works with which payload file.

For instance, if the Ubuntu ISO boots successfully after selecting the ‘Boot ISO (partnew/Easy2Boot) [.isodef]’ option, rename the file to have a .isodef file extension.

Note: The Ventoy Menu system will only list files with standard file extensions (e.g. .iso), so if you also want to use Ventoy, you must not change the file extension – instead you can change the filename and add a suffix (see below).

The Ubuntu ISO’s boot menu

Recommended file extensions

You can use a special file extension which is ‘understood’ by the E2B menu system and some of these are also understood by the agFM menu system.

e.g. Ubuntu 64.isodef

E2B and agFM will now immediately boot to this file without any delay and without the user needing to select a secondary menu option.

The E2B menu system understands a greater number of special file extensions than agFM.

However, since the Ventoy menu system only recognises standard file extensions, you can keep the file extension as .iso but force E2B and agFM to boot the ISO file in a different way by using suffixes in the filename…

Example file prefixes, suffixes and extensions

Filename format: [prefix] name [_.xxxx] [.agfmyyyy] . file-extension (where name, file-extension, xxxx and yyyy can be any number of characters, same as *)

Filename prefix

A prefix can be used to change the order of the menu entries within the menu because the files are usually sorted alphabetically.
E2B supports two formats of filename prefix:

Prefix type 1: _*_ (underscore + any number of characters + underscore) – e.g. _123_
Prefix type 2: …_ (any three characters + underscore) – e.g. d34_ (E2B v2.09 or later)

E2B will display the filename in it’s menu system without the initial prefix part and without displaying any part after _. (underscore + period).

Since agFM can only use the first initial letter as a hotkey. I recommend using the type 2 format to order your menu entries:

d34_Ubuntu x64.iso
j50_Tails v2.iso

Tip: To view the order that will be displayed, use Windows Explorer and sort the files by clicking in the word ‘Name’ at the top of the filename column to sort the files by filename.

In E2B, Ventoy and agFM, the menu entries are arranged alphabetically. If you precede the filename with _abcdefg_ (or xyz_) then E2B will not display that first part of the filename in the E2B menu. For example, _aaaaa_Ubuntu 64.iso or a20_Ubuntu 64.iso will appear first in the menu and be listed as ‘Ubuntu 64’ by E2B, but agFM and Ventoy always display the full filename and extension. If the filename starts with an underscore (Type 1 prefix – _abcd_), E2B sorts the filename alphabetically starting with 2nd character (it ignores the first _ when sorting).

Valid non-standard agFM file extensions are those file types listed in the \boot\grubfm\types folder in the 2nd partition.

The file extension determines how E2B and agFM will boot a payload file.

To make an ISO automatically boot in the correct way with no secondary user menu, we can use file extension overrides within the filename.

Two types of file extension override suffixes

_.xxxx. (underscore – period – extension – period)
.agfmyyyy. (period – agfm+extension – fileextension-period) are both override suffixes.

If .agfmyyyy. exists it will always be used by agFM instead of the actual file extension.

yyyy and xxxx can be isowin, winntsetup, isope, isohw, isoagfm, isomap, isodef, isodefault, isoloop, isoPE, iso01 (

  1. If _.*. or .agfm*. do not exist in the full filename, then the actual file extension will be used by both E2B and agFM.
  2. If _.*. exists in the filename then E2B and agFM will always use it as the file extension (unless a .agfm*. is also in the filename).
  3. If .agfm*. exists in the filename (where * is a valid agFM file extension (see below)), then agFM will always use that file extension instead of the actual file extension. E2B ignores it.
  4. If both _.*. and .agfm*. is in the filename – e.g. Ubuntu x64_.isoPE.agfmisowin.iso then E2B will use .isoPE and agFM will use .isowin.

Both E2B and agFM can understand some special file suffixes (_.*.) and .agfm* and file extensions (.zzzz).

E2B will not display the prefix part that starts and ends with an underscore (_aaa_) or if character #4 is an underscore in the menu, but agFM and Ventoy display the complete filename and extension (so for instance:
_001_Ubuntu x64.iso or a30_Ubuntu x64.iso will be displayed as ‘Ubuntu x64’ in the E2B menu – but agFM and Ventoy always display the full filename.

agFM special file extensions

agFM file extension overrides that are currently detected (must start with .agfm string immediately before the file extension):
.agfmisowin, .agfmwinntsetup, .agfmisope, .agfmisohw, .agfmisoagfm, .agfmisomap, .agfmisodef, .agfmisodefault, .agfmisoloop, .agfmisoPE, .agfmiso01, .agfmisopersist, .agfmisomem (not case sensitive).
e.g. xxxx.agfmisowin01.iso would boot as .isowin and if Legacy-booted it would make the boot drive the internal hard disk after booting (for HDD repair operations).

The ’01’ suffix causes agFM to swap the USB drive and first internal drive number so that Drive 0 is the ‘boot’ drive once booted. This is especially useful when booting WinPE-based Windows repair ISOs, where some boot repair commands may install the Windows boot code onto the E2B USB drive if ’01’ is not used in the filename (e.g. DaRT ISOs, HBCDPE, etc).

E2B and agFM both sort files alphabetically. You can select a menu entry using the initial letter when listed in the menu. e.g. Pressing the letter U three times will select the third menu entry that begins with u (if there is one). This does not work so well in agFM if you use numbers like _xxx_ at the beginning of each filename. So for agFM you will need to use the cursor keys or make sure the files begin with a letter.

Note that in the examples below, only the files with a .iso file extension will be listed by Ventoy.

  • ubuntu-20.04-desktop-amd64.isodef – will automatically run the ISO when it is selected and boot using the ‘partnew’ method (no Secondary Menu). The full boot menu within the ISO will be displayed.
  • _001_ubuntu-20.04-desktop-amd64.isodef – same as above but will be listed first/near the top of the menu screen
  • _001_ubuntu-20.04-desktop-amd64.isoagfm – same as above but will use the agFM ‘Boot Ubuntu from ISO’ boot option automatically
  • _001_ubuntu-20.04-desktop-amd64.isoloop – same as above but will use the agFM ‘Boot ISO (loopback.cfg)’ boot option automatically
  • _002_DLCBoot 2019 v3.6_.isohw.iso – E2B will use the isohw boot extension method, agFM will display a secondary boot option screen
  • _003_Gandalf’s Win10PE x64 Redstone 3-07-10-2018_.isomap64.iso – E2B and agFM both ‘understand’ _.isomap64.ISO file extension, agFM will warn if not booted on a 64-bit CPU
  • _050_BobOmbsModifiedWin10PEx64.v4.8.isomap64 – will not be listed in E2B or agFM menu on systems with 32-bit CPUs (no Secondary menu)
  • _030_Sergei_Strelec_WinPE_8and10 x86x64_2019.02.04English.isowin – run Strelec with no secondary menu choice
    Recognised by Ventoy, E2B and agFM (keep extension as .iso)…
  • ubuntu-20.04-desktop-amd64.iso – unaltered (will be listed alphabetically and produce a Secondary Menu when selected)
  • a15_HBCD PE x64 1.0.1_.isomap64.iso – use a prefix to determine order in the menu (xxx_ format)
  • a10_Gandalf5_.isodef.iso – E2B and agFM will boot immediately (no Secondary menu) – extension must be .iso to work for Gandalf
  • a30_Sergei_Strelec_WinPE_8and10 x86x64_2019.02.04English_.isodef.agfmisomap.iso – run Strelec with no secondary menu choice, E2B will use .isodef, agFM will use .isomap.
  • a30_Sergei_Strelec_WinPE_8and10 x86x64_2019.02.04English.agfmisomap.iso – E2B will use .iso and so may prompt the user, agFM will use .isomap.
  • a01_ubuntu-18.10-desktop-amd64_.isodef.agfmisoagfm.iso – E2B will use .isodef, but agFM will use .isoagfm and so recognise the type of Linux and use the kernel parameters so that the ISO file does not need to be contiguous because partnew will not be used. If you just used the .isodef file extension, then both E2B and agFM would require the file to be contiguous.
  • a50_HBCD PE x64 1.0.1_.isodef0164.agfmiso0164.iso – test CPU is 64-bit, swap hd0 with hd1 before Legacy booting (to set boot device as the internal HDD and not the USB).
  • a01_ubuntu-18.10-desktop-amd64_.isopersist.agfmisopersist.iso and a01_ubuntu-18.10-desktop-amd64_.isopersist.agfmisopersist-rw (agFM v1.95+)

Note: In the agFM menu system, if the filename does not begin with a letter, you will always need to use the cursor keys to select that menu entry because the initial-letter hotkey function will not work. In the E2B menu system, you can type the initial letter or the menu number (e.g. press 1 and then 2 to jump to item #12).
For example:
_a30_Sergei Strelec WinPE 8 and 10 x86 x64 2019.02.04 English_.isodef.agfmisomap.iso
will be displayed as ‘Sergei Strelec WinPE 8 and 10 x86 x64_2019.02.04 English‘ in the E2B menu (agFM displays the full filename) provided your MyE2B.cfg is configured to not display the file extensions.
Note that a file called _a30_Sergei Strelec WinPE 8 and 10 x86 x64 2019.02.04 English.agfmisomap.iso will be displayed as ‘Sergei Strelec WinPE 8 and 10 x86x64_2019.02.04 English.agfmisomap‘ by E2B because it contains no _.xxxx. string.

How to determine the correct suffixes/file extensions

Since Ventoy requires ISO files to always have the file extension .ISO, we must not change the file extension if we want to boot any ISO using Ventoy.

Adding file extension suffixes will mean you will not need to remember which boot option to select for each different payload file.

  1. Make sure the ISO file is contiguous by running \Make_This_Drive_Contiguous.cmd under Windows.
  2. Remove all spaces from the filename (to start with) and use alphanumeric characters with – and _ only.
  3. First MBR\Legacy boot to the ISO using E2B. E2B may suggest an alternative file extension for that particular ISO. You can choose to accept the alternate suggestion (type Y and ENTER) or just press ENTER or let it timeout to boot as .iso. Make a note of which extension works best.
  4. Now UEFI-boot to agFM and select the same .iso file – you will be presented with some secondary boot choices (e.g. .isodef, .isoloop, .isowin, .isomap, .isomem, .isoagfm) – try each one until you find one choice that works.
  5. If the default (.isodef/E2B option) worked for both E2B and agFM, you can add the string _.isodef to the end of the filename (keep the extension as .iso) – e.g. Ubuntu x64_.isodef.iso.
    If agFM worked best using .isomap but E2B worked best using the default .iso, then add _.isodef.agfmisomap to the end of the filename – e.g. Ubuntu x64_.isodef.agfmisomap.iso.
    E2B will not display the last part of the filename after _.
  6. Since payload files are ordered alphabetically, you can add a letter/number _*_ prefix – e.g. a10_Ubuntu x64_.isodef.agfmisomap.iso. E2B will not display the prefix part of the filename in the E2B menu.
  7. You can add a ’32’ or ’64’ suffixes. e.g. if you use a10_Ubuntu x64_.isodef64.agfmisomap64.iso – E2B will not list the ISO file at all on 32-bit systems. agFM will list the ISO, but will warn you if the system is a 32-bit system and then load the secondary boot menu.
  8. Test the ISO using Legacy E2B, agFM Legacy, agFM UEFI, Ventoy Legacy and Ventoy UEFI (you can use VirtualBox if you wish)
    Ventoy and agFM will always display the full filenames.
  9. You can now rename the filename and add spaces, etc. (avoid using the characters $, &, ( and ) which may cause problems). Some Linux boot methods do not work if the filename contains spaces. You can use a .txt file to change the E2B menu text.
    Note: If you find that Ventoy is the only menu system that works for some files, you can put them into a new folder – e.g. \_ISO\VENTOY\WINPE and \_ISO\VENTOY\LINUX. The files will not be listed by E2B because they are not in the E2B menu folders.

Special grub2 configuration files (.cfg and .grubfm)

You can write your own grub2 file for agFM if you require special kernel parameters or need to specify a persistence file or want to change the menu entry text to something other than the name of the boot file. A .cfg menu file is normally placed in an E2B menu folder but it can be any any navigable folder that agFM can browse to.

Note: sample agFM .cfg and .grubfm menu files can be found in the Partition 2 agFM partition under the \e2b\Sample agFM menu files folder.

A file with the extension .cfg will be treated as a grub2 menu file – it will be listed in the agFM menu and can be selected from the agFM menu.

  • \_ISO\LINUX\blackarch-linux-full-2020.12.01-x86_64.cfg

See eBook #4 for more details.

You can have ISO files in a different folder and use a .cfg file if you just want to add a new or different menu entry into one or more of the agFM menus. For instance, place a .cfg file called ‘KALI ISO.cfg‘ in the \_ISO\MAINMENU folder and it will appear as ‘KALI ISO.cfg’ in the agFM MAINMENU. The contents of the .cfg file can specify the location of the source file as shown below (or you can add multiple menuentry sections – see example files).

grubfm_open "($bootdev,1)/_ISO/LINUX/ISO/kali-linux-2022.2-live-amd64.iso"

Example .grubfm

A file with a .grubfm file extension must have exactly the same filename as the ISO – it is NOT listed in the menu system.

When the user selects the ISO file, an extra ‘User’ boot menu option will be listed in the agFM Secondary ISO boot menu which will run your .grubfm grub2 menu code.

  • \_ISO\LINUX\blackarch-linux-full-2020.12.01-x86_64.grubfm
  • \_ISO\LINUX\blackarch-linux-full-2020.12.01-x86_64.iso

Example .grubfm file:

menuentry "BlackArch Linux 64-bit (ISO boot) " --class=archlinux {
set "grubfm_path=/_ISO/LINUX/blackarch-linux-full-2020.12.01-x86_64.iso"
set "grubfm_file=(${grubfm_device})${grubfm_path}"
probe -u ${grubfm_device}) --set=abc
set pqr="/dev/disk/by-uuid/$abc"
loopback loop "${grubfm_file}"
set "params=archisobasedir=blackarch accessibility=on img_loop=$grubfm_path img_dev=$pqr driver=free"
linux (loop)/blackarch/boot/x86_64/vmlinuz-linux ${params}
initrd (loop)/blackarch/boot/intel-ucode.img (loop)/blackarch/boot/amd-ucode.img (loop)/blackarch/boot/x86_64/initramfs-linux.img

You can find more example .cfg and .grubfm menus in the \e2b\Sample agFM Menu Files folder on the agFM Partition #2.

agFM v1.96 contains \e2b\Sample agFM menu files\LINUX\pmagic_2022_09_04.grubfm which allows you to boot pmagic with persistence.

Example .cfg: Puppy ISO with persistence (save file)

  • Copy the sample file on Ptn2: \e2b\Sample agFM Menu Files\LINUX\puppy_slacko64-7.0_persistent.cfg to Ptn1:\_ISO\LINUX folder
  • Download and copy slacko64-7.0.iso to Ptn1:\_ISO\LINUX folder
  • Rename file extension from .iso to .isopup
  • If your ISO is not named slacko64-7.0.isopup, you will need to edit the filename one line inside the .cfg file.

Now when you run the slacko .cfg file from the agFM Menu system, the Puppy kernel will find and load the persistence file from the root of E2B Ptn1. When you exit Puppy, it will ask you if you want to save your changes. The first time you exit, it will ask for various options including save file size and if you also want a swap file. Default persistence filename is usually \slacko64save.3fs.

Note: The .isopup file extension is only required by E2B. The file extension can be kept as just .iso if you are not going to use E2B to boot it with persistence. If you select the .isopup file in the agFM menu system then persistence will not work. The E2B Menu system will not list the .cfg file. If you do not want the ISO file to be listed in the agFM menu, you can move it to another folder (e.g. \_ISO\LINUX\ISOS) so that only the .cfg file is listed under the agFM LINUX folder menu (you will need to edit the path in the .cfg file).

Another example:
fossapup64-9.5_.isodef.iso – file extension is kept as .iso so that Ventoy will list it, _.isodef is used so E2B and agFM will not prompt the user with a secondary menu.

Changing the agFM menu background or theme

The default agFM menu system uses a default in-built grub2 theme. You can use your own theme or use a unthemed menu with your own wallpaper background.

agFM Seven22 theme (see eBook #4)

You must create a file on partition 2 called \boot\grubfm\startup_menu.txt menu file (use one of the sample files in the same folder). Instructions are within each .txt file.

You can instead copy the \boot\grubfm\startup_default.cfg to startup_menu.txt and then modify that as you wish.

Some sample themes are available from the Alternate Download sites (hitman, seven, slax, tela).

Details on how to add a theme or add/change the start up menu are in eBook #4.

Windows ISOs

Windows ISOs, when booted using isowin or isomap, can detect if a \sources\install.wim or install.esd file is present and if a \sources\boot.wim file is present inside the ISO file.

If an install.wim/esd file is found it will also list all the XML files in that same folder.

If a .cmd file exists in the same folder and it has exactly the file name as the .iso file, then that .cmd file will be called as soon as WinPE loads. This means you can add drivers or registry commands before Setup runs, or even run your own installation procedure. One use of this is to run some registry commands which disables Setup from checking for a TPM in Win11 Setup.exe. (agFM v1.72 and later).

Partition Image files (.imgPTN/.imgPTN23/.imgPTNREP3)

agFM can switch in Partition image files in the same way that E2B can. A Partition Image file can replace one of the MBR partitions on the E2B USB drive.

For instance, you can UEFI-boot to agFM, switch-in a .imgPTN file and then boot to the files in the new partition. When you next boot to agFM, you can restore the original partitions from the agFM menu.

If you select a .imgPTN file, then partition #1 is replaced but partition #2 (the agFM partition containing agFM and the EFI boot files) and partition #3 are also removed.
For this reason, it is best to rename the .imgPTN file to use the .imgPTN23 file extension (’23’ means keep partition 2 and 3).

Any image partition file with a file extension of .imgPTN or .imgPTN23 should be located on partition #1.

If used, An auxiliary image partition file which has the same file name but has no file extension should be located on Partition #3 of the USB drive, e.g.
Ptn #1: \_ISO\LINUX\Ubuntu64.imgPTN23
Ptn #3: \Ubuntu64

The .imgPTN23 file will replace partition 1 and the auxiliary image file will replace partition 3. In this example, the Ubuntu64 image file could contain an ext3 filesystem with a full install of Ubuntu. The auxiliary file is searched for in the root and in the same folder as the .imgPTN file.

Any image partition file with the file extension of .imgPTNREP3 should be located on Partition #3, e.g.
Ptn #3: \xxx\Catalina.imgPTNREP3
The .imgPTNREP3 file will replace only Partition #3. The image can contain any filesystem (e.g. ext4 or hfs). If it is bootable, you can use the agFM F3 menu to boot to it (or select the boot file using the F2 menu).

For instance, you can switch-in a bootable hfs partition image and then boot to it via the agFM menu system. For example, it can be used to boot to MAC OSx install partition image from the agFM menu.

Official Ventoy images

These are images which will replace the agFM Partition 2 with an ‘official’ Ventoy Partition 2. The E2B USB drive is thus transformed into a Ventoy USB drive with a small 32MB Partition 2 and a volume name of VTOYEFI. The USB drive thus behaves exactly as any official Ventoy USB drive (except it can also MBR\Legacy boot to E2B!). The agFM files are removed and the USB drive will UEFI-boot directly to Ventoy. You can thus always use the latest version of Ventoy whenever a new version is released.

You can restore the original agFM partition and files by booting from ventoy into to a grubfm ISO file and then pick the menu item to restore agFM.

See here for more details.

I recommend the Sandisk Extreme Pro USB 3

New! Ventoy for Easy2Boot v1.0.97 now released!


eBooks available (in PDF format)

Easy-to-read eBooks are available in PDF format (each eBook is over 100 pages) – rated 4.5/5 stars.
Learn the secrets of Legacy and UEFI USB booting and then make your perfect multiboot USB drive.
E2B eBook #1 includes instructions on how to remove the E2B 5-second start-up delay blue screen.

E2B is unique in that it uses partition images which allows you to directly boot from Secure Boot images (no need to disable Secure Boot or run MOK manager or modify your UEFI BIOS).

Most eBooks are over 100 pages long, contain original content and step-by-step exercises which are suitable for both the beginner or the more experienced user.
Customer reviews are located at bottom of each eBook product page and multi-buy discounts are available when you buy more than one eBook. Please also visit and the E2B Forum.
Subscribe to my blog for the latest news, tips, USB boot articles and free eBook updates.