Grub4Dos: How to Install, Configure, and Troubleshoot
Grub4dos: A Universal Boot Loader for Your PC
If you have ever wanted to boot multiple operating systems on your computer, or run different versions of Windows or Linux, or even boot from an ISO image without burning it to a CD, then you might want to try grub4dos. Grub4dos is a powerful and versatile boot loader that can handle almost any boot scenario. In this article, we will explain what grub4dos is, how to install and configure it, how to boot various operating systems with it, and how to troubleshoot some common errors.
grubinst gui.exe grub4dos grub4dos.zip
What is grub4dos and what can it do?
Grub4dos is a fork of GNU GRUB, the GRand Unified Bootloader, which is the standard boot loader for many Linux distributions. Grub4dos extends the functionality of GRUB by adding support for DOS, Windows, and other operating systems, as well as features such as BIOS disk emulation, ATAPI CDROM driver, memory management, password protection, and more. Grub4dos can also load GRUB modules and execute GRUB commands, making it compatible with most GRUB configurations.
With grub4dos, you can create a boot menu that allows you to choose from different operating systems or options at startup. You can also use grub4dos to boot from a floppy disk, a USB drive, a CD-ROM, or even an ISO image stored on your hard disk. Grub4dos can also chainload other boot loaders, such as Windows boot manager, syslinux, lilo, or even another instance of grub4dos.
Why use grub4dos instead of other boot loaders?
There are many reasons why you might want to use grub4dos instead of other boot loaders. Here are some of them:
Grub4dos is free and open source software. You can download it, modify it, and redistribute it as you wish.
Grub4dos is easy to install and use. You don't need to modify your existing partitions or files. You just need to copy some files to your boot device and run a simple command.
Grub4dos is flexible and customizable. You can edit the menu.lst file to change the appearance and behavior of the boot menu. You can also use the command-line interface or the graphical interface (WINGRUB) to modify the settings on the fly.
Grub4dos is powerful and versatile. You can boot almost any operating system with grub4dos, including Windows XP/Vista/7/8/10, Linux distributions, DOS and other legacy systems, ISO images, etc. You can also use advanced features such as BIOS disk emulation, ATAPI CDROM driver, memory management, password protection, etc.
How to install grub4dos
There are several ways to install grub4dos on your computer. The most common ones are: - Installing grub4dos to the MBR or PBR using bootlace.com - Installing grub4dos to a floppy disk or USB drive - Installing grub4dos from Linux using syslinux, grub or kexec We will explain each of these methods in detail below. Downloading and extracting grub4dos files
Before you can install grub4dos, you need to download and extract the grub4dos files. You can get the latest version of grub4dos from the official website or from the SourceForge project page. The files are compressed in a ZIP archive, so you need a program like WinZip or 7-Zip to extract them.
After you download the ZIP file, extract it to a folder on your hard disk. You should see several files and folders, such as grldr, menu.lst, bootlace.com, etc. These are the essential files for grub4dos. You can also find some optional files and folders, such as grldr.mbr, grldr.pbr, WINGRUB, etc. These are for advanced users who want to customize their grub4dos installation.
Installing grub4dos to the MBR or PBR using bootlace.com
The easiest way to install grub4dos is to use the bootlace.com program, which can write the grub4dos code to the Master Boot Record (MBR) or the Partition Boot Record (PBR) of your hard disk. The MBR is the first sector of your hard disk, which contains the code that is executed when your computer boots up. The PBR is the first sector of a partition, which contains the code that is executed when that partition is booted.
To use bootlace.com, you need to run it from a DOS environment. You can use a DOS boot disk, a Windows 98/ME startup disk, or a Windows XP/Vista/7/8/10 recovery console. You can also use a DOS emulator like DOSBox or FreeDOS. Alternatively, you can use WINGRUB, which is a graphical interface for bootlace.com that runs on Windows.
Once you have booted into DOS, navigate to the folder where you extracted the grub4dos files. Then run the following command:
bootlace.com X:
where X: is the drive letter of your hard disk or partition. For example, if you want to install grub4dos to the MBR of your first hard disk, run:
bootlace.com 0x80
If you want to install grub4dos to the PBR of your second partition on your second hard disk, run:
bootlace.com 0x81,1
The bootlace.com program will ask you to confirm your choice and then write the grub4dos code to the MBR or PBR. After that, you can reboot your computer and you should see the grub4dos menu.
Installing grub4dos to a floppy disk or USB drive
If you don't want to modify your hard disk, you can also install grub4dos to a floppy disk or a USB drive. This way, you can boot grub4dos from any computer that supports booting from these devices.
To install grub4dos to a floppy disk or a USB drive, you need to format it with FAT16 or FAT32 file system. You can use Windows Disk Management or any other partitioning tool for this purpose. Then copy the grldr and menu.lst files from the grub4dos folder to the root directory of your floppy disk or USB drive. Optionally, you can also copy other files and folders, such as grldr.mbr, grldr.pbr, WINGRUB, etc.
After that, you need to make your floppy disk or USB drive bootable with grub4dos. You can use one of the following methods:
Use bootlace.com as described above, but specify the drive letter of your floppy disk or USB drive instead of your hard disk or partition.
Use WINGRUB as described below, but select your floppy disk or USB drive instead of your hard disk or partition.
Use RMPrepUSB, a utility that can create bootable USB drives with various options and features.
Use UNetbootin, a utility that can create bootable USB drives with various Linux distributions and other tools.
After you make your floppy disk or USB drive bootable with grub4dos, you can insert it into any computer and boot from it. You should see the grub 4dos menu.
Installing grub4dos from Linux using syslinux, grub or kexec
If you already have a Linux system installed on your computer, you can also use it to install grub4dos. You can use one of the following methods:
Use syslinux, a boot loader for Linux that can load Linux kernel images and other bootable files. You can install syslinux on your Linux system using your package manager or by compiling it from source. Then copy the grldr and menu.lst files from the grub4dos folder to the /boot directory of your Linux system. Optionally, you can also copy other files and folders, such as grldr.mbr, grldr.pbr, WINGRUB, etc. Then edit the /boot/syslinux.cfg file and add an entry for grub4dos, such as:
LABEL grub4dos MENU LABEL Grub4dos KERNEL /boot/grldr
Use grub, the original GNU GRUB boot loader. You can install grub on your Linux system using your package manager or by compiling it from source. Then copy the grldr and menu.lst files from the grub4dos folder to the /boot directory of your Linux system. Optionally, you can also copy other files and folders, such as grldr.mbr, grldr.pbr, WINGRUB, etc. Then edit the /boot/grub/menu.lst file and add an entry for grub4dos, such as:
title Grub4dos root (hd0,0) kernel /boot/grldr
Use kexec, a utility that can load another kernel and execute it without rebooting. You can install kexec on your Linux system using your package manager or by compiling it from source. Then copy the grldr and menu.lst files from the grub4dos folder to the /boot directory of your Linux system. Optionally, you can also copy other files and folders, such as grldr.mbr, grldr.pbr, WINGRUB, etc. Then run the following command as root:
kexec -l /boot/grldr --append="root=/dev/ram0 rw" kexec -e
After you use one of these methods, you can reboot your computer and you should see the grub4dos menu.
How to configure grub4dos
Once you have installed grub4dos, you can configure it to suit your needs. There are two main ways to configure grub4dos: editing the menu.lst file and using the command-line interface.
Editing the menu.lst file
The menu.lst file is the main configuration file for grub4dos. It contains the entries for the boot menu and the settings for each entry. You can edit this file with any text editor, such as Notepad or nano. The menu.lst file is located in the same directory as the grldr file, which is usually the root directory of your boot device.
The menu.lst file has a simple syntax. Each line can be either a comment, a command, or a title. A comment is a line that starts with # and is ignored by grub4dos. A command is a line that starts with a keyword and has one or more arguments. A title is a line that starts with title and marks the beginning of a new entry in the boot menu.
Here is an example of a menu.lst file:
# This is a comment timeout 10 # This is a command that sets the timeout to 10 seconds default 0 # This is a command that sets the default entry to 0 color black/cyan yellow/cyan # This is a command that sets the colors of the menu title Windows XP # This is a title for an entry root (hd0,0) # This is a command that sets the root device to (hd0,0) chainloader +1 # This is a command that chainloads the boot sector of (hd0,0) title Ubuntu Linux # This is another title for another entry root (hd0,1) # This is another command that sets the root device to (hd0,1) kernel /boot/vmlinuz root=/dev/sda2 ro quiet splash # This is another command that loads the kernel image initrd /boot/initrd.img # This is another command that loads the initial ramdisk image title ISO Image # This is another title for another entry map /iso/ubuntu.iso (hd32) # This is another command that maps an ISO image to a virtual disk map --hook # This is another command that hooks the BIOS disk emulation root (hd32) # This is another command that sets the root device to (hd32) chainloader (hd32) # This is another command that chainloads the boot sector of (hd32)
You can find more information about the syntax and commands of the menu.lst file in the grub4dos manual or the grub4dos wiki.
Using the command-line interface
The command-line interface is another way to configure grub4dos. You can access it by pressing c at the grub4dos menu or by adding commandline as an entry in the menu.lst file. The command-line interface allows you to enter grub4dos commands interactively and see the results immediately. You can use it to test different settings, troubleshoot problems, or perform advanced tasks.
The command-line interface has a prompt that shows the current device and partition, such as (hd0,0)>. You can enter grub4dos commands after the prompt and press Enter to execute them. You can also use the Tab key to complete commands or filenames, and the Up and Down arrow keys to recall previous commands. You can use the help command to see a list of available commands and their usage.
Here are some examples of using the command-line interface:
(hd0,0)> geometry (hd0) # This command shows the geometry of the first hard disk drive 0x80(LBA): C/H/S=1023/255/63, Sector Count/Size=312581808/512 Partition num: 0, active, Filesystem type is fat, partition type 0xc Partition num: 1, Filesystem type is ext2fs, partition type 0x83 Partition num: 2, Filesystem type unknown, partition type 0x82 Partition num: 3, Filesystem type is ntfs, partition type 0x7 (hd0,0)> find /grldr # This command finds the file grldr on all devices (hd0,0) (hd1,0) (hd0,0)> cat /menu.lst # This command displays the contents of the file menu.lst # This is a comment timeout 10 # This is a command that sets the timeout to 10 seconds default 0 # This is a command that sets the default entry to 0 color black/cyan yellow/cyan # This is a command that sets the colors of the menu title Windows XP # This is a title for an entry root (hd0,0) # This is a command that sets the root device to (hd0,0) chainloader +1 # This is a command that chainloads the boot sector of (hd0,0) title Ubuntu Linux # This is another title for another entry root (hd0,1) # This is another command that sets the root device to (hd0,1) kernel /boot/vmlinuz root=/dev/sda2 ro quiet splash # This is another command that loads the kernel image initrd /boot/initrd.img # This is another command that loads the initial ramdisk image title ISO Image # This is another title for another entry map /iso/ubuntu.iso (hd32) # This is another command that maps an ISO image to a virtual disk map --hook # This is another command that hooks the BIOS disk emulation root (hd32) # This is another command that sets the root device to (hd32) chainloader (hd32) # This is another command that chainloads the boot sector of (hd32) (hd0,0)> reboot # This command reboots the computer
You can find more information about the syntax and commands of the command-line interface in the grub4dos manual or the grub4dos wiki.
Using the graphical interface (WINGRUB)
The graphical interface (WINGRUB) is a Windows program that provides a graphical user interface for grub4dos. You can use it to install, configure, and manage grub4dos from Windows. You can also use it to create and edit menu.lst files, backup and restore MBRs and PBRs, and more.
To use WINGRUB, you need to copy it from the grub4dos folder to your Windows system. Then run it as an administrator. You should see a window like this:
The WINGRUB window has several tabs and buttons. Here are some of them:
The Install tab allows you to install grub4dos to your hard disk or partition using bootlace.com. You can select your target device from the drop-down list and click Install.
The Config tab allows you to edit your menu.lst file and change the settings on the fly. You can also use WINGRUB to backup and restore your MBR and PBR, and to create and edit menu.lst files.
To use WINGRUB, you need to copy the WINGRUB folder from the grub4dos folder to your Windows system. Then run the WINGRUB.exe file as an administrator. You should see a window like this:
The WINGRUB window has several tabs and buttons. Here are some of them:
The Install tab allows you to install grub4dos to your hard disk or partition using bootlace.com. You can select your target device from the drop-down list and click Install.
The Config tab allows you to edit your menu.lst file. You can add, modify, or delete entries in the boot menu. You can also change the settings for each entry, such as the root device, the kernel image, the initrd image, etc.
The Backup tab allows you to backup and restore your MBR and PBR. You can select your source and destination devices from the drop-down lists and click Backup or Restore.
The Create tab allows you to create a new menu.lst file. You can select a template from the drop-down list and click Create. You can also edit the template before creating the file.
The Edit tab allows you to edit an existing menu.lst file. You can browse for the file or drag and drop it into the window. You can also use the syntax highlighting, search and replace, undo and redo functions.
You can find more information about WINGRUB in the WINGRUB manual or the WINGRUB wiki.
How to boot various operating systems with grub4dos
One of the main advantages of grub4dos is that it can boot almost any operating system that you have on your computer or on an external device. In this section, we will show you some examples of how to boot various operating systems with grub4dos.
Booting Windows XP/Vista/7/8/10
To boot Windows XP/Vista/7/8/10 with grub4dos, you need to know which partition contains your Windows system files (usually C:\). Then you need to add an entry in your menu.lst file like this:
title Windows root (hdX,Y) chainloader +1
where (hdX,Y) is the device and partition number of your Windows partition. For example, if your Windows partition is on the first partition of your first hard disk, use (hd0,0). If it is on the second partition of your second hard disk, use (hd1,1).
After you add this entry, you can reboot your computer and select Windows from the grub4dos menu. Grub4dos will chainload the Windows boot loader and start Windows normally.
Booting Linux distributions
To boot Linux distributions with grub4dos, you need to know which partition contains your Linux system files (usually /). Then you need to add an entry in your menu.lst file like this:
title Linux root (hdX,Y) kernel /boot/vmlinuz root=/dev/sdXY ro initrd /boot/initrd.img
where (hdX,Y) is the device and partition number of your Linux partition, and /dev/sdXY is the corresponding Linux device name. For example, if your Linux partition is on the first partition of your first hard disk, use (hd0,0) and /dev/sda1. If it is on the second partition of your second hard disk, use (hd1,1) and /dev/sdb2.
You also need to know the location and name of your kernel image (usually /boot/vmlinuz) and your initial ramdisk image (usually /boot/initrd.img). You can find these information by running ls -l /boot in your Linux system or by mounting your Linux partition in another system.
After you add this entry, you can reboot your computer and select Linux from the grub4dos menu. Grub4dos will load the kernel image and the initial ramdisk image and start Linux normally.
Booting ISO images
To boot ISO images with grub4dos, you need to have an ISO image file stored on your hard disk or on an external device. Then you need to add an entry in your menu.lst file like this:
title ISO map /path/to/iso/file.iso (hd 32) # This is a command that maps an ISO image to a virtual disk map --hook # This is a command that hooks the BIOS disk emulation root (hd32) # This is a command that sets the root device to (hd32) chainloader (hd32) # This is a command that chainloads the boot sector of (hd32)
where /path/to/iso/file.iso is the location and name of your ISO image file. For example, if your ISO image file is stored on the root directory of your first partition of your first hard disk, use /iso/file.iso. If it is stored on the second partition of your second hard disk, use (hd1,1)/iso/file.iso.
After you add this entry, you can reboot your computer and select ISO from the grub4dos menu. Grub4dos will map the ISO image to a virtual disk and boot from it as if it were a real CD-ROM.
Booting DOS and other legacy systems
To boot DOS and other legacy systems with grub4dos, you need to have a bootable floppy disk image or a bootable hard disk image stored on your hard disk or on an external device. Then you need to add an entry in your menu.lst file like this:
title DOS map /path/to/floppy/disk/image.img (fd0) # This is a command that maps a f