I want to put a .iso file of a bootable linux CD on the harddrive of my computer. I want to have it boot using grub (or lilo), and have it boot from the .iso file as if the .iso was a real CD in the CDROM drive.

Here is a page that makes reference to doing this, but instead of a .iso file it is a .img file of a floppy or a whole harddisk installation:


That page makes reference to "cdrom emulation is not supported", but I don't know if it is not supported in grub, or if what want to do is completely impossible.

Apparently Epidemic Linux (and maybe Knoppix ?) have a "bootfrom" parameter:

"Using the parameter “bootfrom=/partition/path” you can start Epidemic from an ISO image located anywhere on the HD without having to create a DVD. This is very handy for testing the system."

(From www.epidemiclinux.org/ )


P.S. I am NOT interested in installing the CD on the harddrive. If I could have a dozen .iso's on the harddrive, I would like to be able to select them from grub and boot each of them.


Looks like grub 0.95 or later can. http://ubuntuforums.org/showthread.php?t=799253&page=2 http://forums.whirlpool.net.au/forum-replies-archive.cfm/925285.html

Grub2 can boot iso's, but the docs are really sketchy so far, (even though it is the default for Ubuntu 9.10).

Google about, in some senses, as CDs are bootable via bios, no reason it is hard.

Google it.

http://michael-prokop.at/blog/2009/05/25/boot-an-iso-via-grub2/ http://en.gentoo-wiki.com/wiki/Grub2


GRUB can not completely emulate CDROM, but it can load kernel from it. Extract kernel and ramdisk image (initrd in linux) from ISO manually and ask GRUB to boot it. For the file names and params look at isolinux.cfg, it's common iso loader for the linux distros so I bet it present in your too.

Later share mounted ISO i.e. via NFS and perform the install or what you want to do. Some distros also can load the main part via HTTP or from the external hard drive. It depends only on what developers have inserted in the ramdisk.

It's probably also possible to find some kernel+ramdisk modification which can automatically extract a new kernel+ramdisk from the ISO and then boot it, but you may do this manually very easy. However there is no any middle-software which can do a 100% CDROM emulation except to boot this ISO inside the virtual machine. You should always tweak the distro.


A great tutorial on doing this with GRUB2.

If you're thinking about storing your ISOs on an LVM volume, keep in mind that although GRUB2 itself can access LVM volumes, not all live cds can. For example, the ubuntu livecds are incapable of this. That means that you won't, IIUC, be able to boot such an ISO using this method if the ISO is stored on an LVM volume. In order for this to work, LVM itself needs to be built in to the root filesystem stored in the initrd so that after the kernel starts up it can actually find and access the ISO. If you decompress the initrd (it's a CPIO archive) you can check for /sbin/lvm to find out whether or not it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.