• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 599
  • Last Modified:

How to boot a Linux loopback file from Windows boot manager.

I'm trying to create a small linux filesystem(25MB) within a loopback file then boot it from the Windows boot manager(boot.ini).
I know it's possible(Ubuntu has a Windows installer that does this). Does anyone know to pull this off?
  • 2
  • 2
1 Solution
Windows boot manager is very unfriendly for 3rd party booting. Maybe You should consider using 3rd party bootmanager or linux's grub?
What You mean by "within loopback"? Where is the real device for linux root filesystem?
jasonzxAuthor Commented:
Since this will be installed on machines that will be cloned using Zen imaging or Ghost, Grub isn't an option as both of them break Grub.
And when I say "within a loopback file" I mean:
 create a zero file of 25MB using dd
 format the file with mkfs.ext3
 mount the file
 copy initrd, vmlinuz, etc to the mounted file
 install grub to the file

I've got most of the procedure figured out but I'm not sure I'm installing Grub properly as when I try to do things this way and select 'Linux' from boot.ini the screen just goes blank.
I see.
You will not boot such "file" from windows boot.ini - no such support.

Next question, where this file is put? ext3 linux filesystem? NTFS?
The problem is that such file has to be mounted as loop or hdd first.
IMHO Your options are:
virtual machine;
bootlader which can do that(but I doubt);
special initrd which will mount the host filesystem(where the file lives), loop it, mount it and switch root to newly created mountpoint - yet the kernel/initrd has to be placed somewhere else - not in the loop-file itself. Yet You still will not boot it from boot.ini
Image the system with an initial bootloader whose sole purpose is to run a script to properly install grub.

Wait... you just said ubuntu does this.
Why not just use the Ubuntu installer then, modify the results to be exactly what you need, and copy them to the target system?

Ubuntu Wubi  does not load Linux directly from bootback, it uses a DOS-based bootloader  ala  loadlin

From there,  custom scripts in an init ramdisk (initrd), presumably  mount the loopback file  and load the operating root file system and system services.
jasonzxAuthor Commented:
Yeah, it was the Wubi installer I was thinking of and when I looked into it, it was a little more complicated than I could figure out. It seems to create some kind of mbr file and boot.ini points to this which is the jumping off point for the whole thing. How this mbr file is create, I've no idea.
I looked into loadlin but everything I read seems to say that it doesn't work with XP's ntldr.
However, I did find that pointing boot.ini at grldr(from the grub4dos) package will let me either boot a loopback file or load my ramdisk and kernel.

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now