Linux’s GRUB2 boot loader can boot Linux ISO files directly from your hard drive. Boot Linux live CDs or even install Linux on another hard drive partition without burning it to disc or booting from a USB drive.
Jun 26, 2017 Run Command Prompt under Admin and go to the grub-2.02-for-windows directory that you extracted above. Cd /d C:grub-2.02-for-windows; Check the number of hard disk you will install, be it USB or HDD. Run diskmgmt.msc to open Disk Management. Here I will install Grub2 for USB. In Disk Management is Disk 2, we will remember number 2 here.
We performed this process on Ubuntu 14.04 — Ubuntu and Ubuntu-based Linux distributions have good support for this. Other Linux distributions should work similarly.
Get a Linux ISO File
RELATED:How to Configure the GRUB2 Boot Loader’s Settings
This trick requires you have a Linux system installed on your hard drive. Your computer must be using the GRUB2 boot loader, which is a standard boot loader on most Linux systems. Sorry, you can’t boot a Linux ISO file directly from a Windows system using the Windows boot loader.
Download the ISO files you want to use and store them on your Linux partition. GRUB2 should support most Linux systems. if you want to use them in a live environment without installing them to your hard drive, be sure to download the “live CD” versions of each Linux ISO. Many Linux-based bootable utility discs should also work.
Check the Contents of the ISO File
You may need to look inside the ISO file to determine exactly where specific files are. For example, you can do this by opening the ISO file with the Archive Manager/File Roller graphical application that comes with Ubuntu and other GNOME-based desktop environments. In the Nautilus file manager, right-click the ISO file and select Open with Archive Manager.
Locate the kernel file and the initrd image. If you’re using a Ubuntu ISO file, you’ll find these files inside the casper folder — the vmlinuz file is the Linux kernel and the initrd file is the initrd image. You’ll need to know their location inside the ISO file later.
Determine the Hard Drive Partition’s Path
GRUB uses a different “device name” scheme than Linux does. On a Linux system, /dev/sda1 is the first partition on the first hard disk — a means the first hard disk and 1 means its first partition. In GRUB, (hd0,1) is equivalent to /dev/sda0. The 0 means the first hard disk, while the 1 means the first partition on it. In other words, in a GRUB device name, the disk numbers start counting at 0 and the partition num6ers start counting at 1 — yes, it’s unnecessarily confusing. For example, (hd3,6) refers to the sixth partition on the fourth hard disk.
You can use the fdisk -l command to view this information. On Ubuntu, open a Terminal and run the following command:
sudo fdisk -l
You’ll see a list of Linux device paths, which you can convert to GRUB device names on your own. For example, below we can see the system partition is /dev/sda1 — so that’s (hd0,1) for GRUB.
Create the GRUB2 Boot Entry
The easiest way to add a custom boot entry is to edit the /etc/grub.d/40_custom script. This file is designed for user-added custom boot entries. After editing the file, the contents of your /etc/defaults/grub file and the /etc/grub.d/ scripts will be combined to create a /boot/grub/grub.cfg file — you shouldn’t edit this file by hand. It’s designed to be automatically generated from settings you specify in other files.
You’ll need to open the /etc/grub.d/40_custom file for editing with root privileges. On Ubuntu, you can do this by opening a Terminal window and running the following command:
sudo gedit /etc/grub.d/40_custom
Feel free to open the file in your favorite text editor. For example, you could replace “gedit” with “nano” in the command to open the file in the Nano text editor.
Unless you’ve added other custom boot entries, you should see a mostly empty file. You’ll need to add one or more ISO-booting sections to the file below the commented lines.
Here’s how you can boot an Ubuntu or Ubuntu-based distribution from an ISO file. We tested this with Ubuntu 14.04:
menuentry “Ubuntu 14.04 ISO” {
set isofile=”/home/name/Downloads/ubuntu-14.04.1-desktop-amd64.iso” loopback loop (hd0,1)$isofile linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=${isofile} quiet splash initrd (loop)/casper/initrd.lz }
Customize the boot entry to contain your desiredmenu entry name, the correct path to the ISO file on your computer, and the device name of the hard disk and partition containing the ISO file. If the vmlinuz and initrd files have different names or paths, be sure to specify the correct path to those files, too.
(If you have a separate /home/ partition, omit the /home bit, like so: set isofile=”/name/Downloads/${isoname}”).
Important Note: Different Linux distributions require different boot entries with different boot options. The GRUB Live ISO Multiboot project offers a variety of menu entries for different Linux distributions. You should be able to adapt these example menu entries for the ISO file you want to boot. You can also just perform a web search for the name and release number of the Linux distribution you want to boot along with “boot from ISO in GRUB” to find more information.
If you want to add more ISO boot options, add additional sections to the file.
Save the file when you’re done. Return to a Terminal window and run the following command:
sudo update-grub
The next time you boot your computer, you’ll see the ISO boot entry and you can choose it to boot the ISO file. You may have to hold Shift while booting to see the GRUB menu.
Download Grub Bootloader For Pc
If you see an error message or a black screen when you attempt to boot the ISO file, you misconfigured the boot entry somehow. Even if you got the ISO file path and device name right, the paths to the vmlinuz and intird files on the ISO file may not be correct or the Linux system you’re booting may require different options.
READ NEXT
Active5 years, 1 month ago
How can I boot into an ISO file in GRUB? The ISO file is on a reiserfs partition and GRUB can access it (already tested that).
Albert
AlbertAlbert
3,13477 gold badges3232 silver badges4545 bronze badges
2 Answers
The biggest problem with booting an ISO file is that ISOs that are designed to be booted are almost always designed to be booted from a CD. As explained on Marco's blog regarding Grub 2 (emphasis mine):
GRUB can read ISO9660 (”iso”) images. It can for example load the first few sectors and boot it. But most people do not realize is “what then?”. What would the loaded operating system do? It will most likely look for a CDROM, which it won’t find, and fail.
So the dead-simple-est way to boot from some random ISO file is to load it into a virtual machine (VirtualBox, VMware, or Virtual PC) as a virtual CD and boot it there. That should almost always work, because to the VM, it's not an ISO file -- it's a real CD on real CD hardware.
Booting from an ISO file on bare metal is much harder. How you do this depends on which version of Grub you're using, and results can differ depending on what ISO you're using and how it was configured to boot. This is why most boot-ISO-from-USB tools (Unetbootin, WinToFlash, etc) usually extract the ISO contents to the drive -- because that way they can be accessed directly, without confusing the OS being booted.
Grub 1Fix Grub Bootloader
.. not sure. If possible, menu entries will probably look a lot like Grub4DOS, though I think the 'map --hook' command is a Grub4DOS enhancement. On the plus side, Grub has wider filesystem support than Grub4DOS.
A note on Grub with reiserfs (unconfirmed) indicates you 'have to mount your partition with
notail for it to work'.
Nov 20, 2003 Lowrider Review. Despite its lack of polish or depth in just about every facet of its execution, Lowrider has a lot of heart and is notable for at least trying something new. Lowrider games for pc.
Memdisk is an option; see below.
Grub4DOS
Grub4DOS offers some experimental 'CD emulation' that works with some ISOs. Unfortunately, Grub4DOS only reads FAT32/NTFS filesystems. Download Grub4DOS.
Here's a sample entry (source):
Supposedly the Win7 ISO can be booted with this entry:
Other ISOs can be booted with Memdisk:
Grub Bootloader Windows 10
You can also use a menu configurator like MultiBootISOs.exe from PenDriveLinux. Place ISOs on the flash drive, and run the utility to install the bootloader and configure the boot menu.
Here's a Hak5 episode on installing Grub4DOS.
Grub 2
Here's a couple of example Grub2 entries. chainloader doesn't work to boot an ISO at present, so these entries must (1) use loopback to 'mount' the ISO, and (2) add something like iso-scan or findiso to the linux line that specifies the ISO file.
Unfortunately, there's no generic way to do this. Each different boot entry must be customized to the target ISO's contents. Most Linux LiveCDs use ISOLINUX as a bootloader; find the isolinux.cfg and examine that boot entry to see what it usually boots.
Example entries (source):
If you're trying to boot a non-Linux LiveCD, you may be out of luck. Again, Memdisk may help:
quack quixotequack quixote
Grub 2 Bootloader
36.1k1111 gold badges9090 silver badges123123 bronze badges
You can use dd from the terminal to write an iso file to a partition. Just be careful, if you use dd wrong you can wipe everything. It should look something like this:dd if=Desktop/LinuxCDFile.iso of=/Path/To/Partition
Grub2 Bootloader Iso
Naos parthNaos parth
Not the answer you're looking for? Browse other questions tagged bootgrubiso-image or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |