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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.