Topic: ISO Boot  (Read 16310 times)

ISO Boot
« on: September 28, 2012, 11:41:00 PM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Make your build and directly use your final ISO created  by copying it to the root of your drive (usb, disk whatever) (do not change the name of the iso).
And get your ISO boot via grub4dos isolinux etc. with following menu:

grub4dos example:
Code: [Select]
iftitle [find /ISO/Win7PE_x86.ISO] Find and Load Win7PESE ISO
find --set-root --ignore-floppies /ISO/Win7PE_x86.ISO
map (hd0) (hd1)
map (hd1) (hd0)
map /ISO/Win7PE_x86.ISO (0xff)
map --hook
root (0xff)
chainloader (0xff)/BOOTMGR

the lines:
Code: [Select]
map (hd0) (hd1)
map (hd1) (hd0)

are important for running System Recovery and for that it detects the host operating system.

Imdisk is required, enable the script (with or Without RamDisk) when building.
At Startup, if imdisk and ISO file are available, the ISO will automatically mount to drive Y:
With files, Apps (Not in RAM, boot.wim) and inside ISO accessible and shortcuts available.


For this, the program CdUsb.exe has evolved and was renamed to MountPEmedia

and 2 additional options are available in Win7PESE:
- In Create ISO script, new option "Boot from an ISO file: Subfolder (Blank for root)" (ex: ISO for \ISO\Win7PE_X86.iso).
- In Copy to USB-Device, "Use .ISO boot" .option.

# For Non-ISO boot (bootmgr, bcd, boot.sdi, boot.wim), the method remains the same as CdUsb.exe with the flag file CdUSb.Y searched to mount your CD\DVD, USB... on drive Y: (%MountDrive%)

# For ISO boot (grub4dos, isolinux, etc.), you must enable imdisk script (with or without RAM Disk option).
Note that, the grub4dos, Isolinux entries for OtherOS scripts are not written.

--> When building, an ini file "MountPEmedia.ini" is created Inside boot.wim and ISO.
with the name, path of your ISO and others useful info.

MountPEmedia.ini
Code: [Select]
[Settings]
ProjectName=Win7PESE
MountDrive=Y:
SearchFlagFile=Yes
FlagFileName=CdUSB.Y
SearchExternalIniFile=Yes
ExternalIniFileName=Win7PESE.ini
DesktopWarningLabel=Win7PESE Warning

[IsoInfo]
IsoName=\Images\Win7PE_X64.iso

[onerror]
Line1=CdUSB.Y or ISO NOT found !
Line2=Win7PESE can not mount and access files of your CD/DVD, USB, ISO on drive Y:
....and useful infos.

--> An other ini file "Win7PESE.ini" is created outside ISO file with also the ISO name, path (created in ISO folder at build time).
To put at the root of your media. Useful if the name or path of the ISO is modified without rebuilding.

# At startup, if imdisk and ISO file are found, the ISO will automatically mount to Y:
With files, apps not in RAM (boot.wim) accessible and shortcuts to the CD/USB drive (Y:) available 

IF CdUsb.Y or ISO are not found, a shorcut is created on Desktop with the log file (exclamation icon).

MountPEmedia is configurable, it can be used, if desired, by other projects.

Code: [Select]
MountPEmedia.exe usage:
[-ini Inifile]   ex: MountPEmedia.exe -ini x:\Windows\System32\MountPEmedia.ini (could be BootPE.ini with the same ini structure).
   otherwise search: "ProgramName Without Extenssion"ini in Working Dir then System Dir.
[-h | /h]   Help'

(*) Requires Imdisk installed to mount ISO file.


Thanks to JFX for the original CdUsb program and to Lancelot for sharing ideas

It is not on server but will be in the next Win7PE_SE update. Thank you for your feedback.
Mini win7pese package : https://rapidshare.com/files/599284470/Projects_20120929.7z
MountPEmedia alone: https://rapidshare.com/files/3252064347/MountPEmedia_20120929.7z

:cheers:
« Last Edit: October 09, 2012, 11:26:11 AM by ChrisR »

Re: ISO Boot
« Reply #1 on: September 29, 2012, 06:31:09 AM »

Doberman

  • Jr. Chef
  • **
  • Date Registered: Oct 2011
  • Posts: 84
Hi ChrisR! :great:
I wanted to ask:
WinVblock - not working ? :confused:
FiraDisk - not working ?  :confused:

Must be present in the root:
"MountPEmedia.ini"  :mad:

Re: ISO Boot
« Reply #2 on: September 29, 2012, 07:29:59 AM »

Galapo

  • Gena Baker
  • Grand Chef
  • *****
  • Location: Australia
  • Date Registered: Sep 2010
  • Posts: 2207
Thanks Chris! :thumbup:

I hope to use this in Gena soon to implement the same feature like you've done for Win7PE SE. Probably I can only get to that in a couple of weeks time. I'll be away with my family next week on a short break. My wife would kill me if I took the computer along!
:vacation:

Regards,
Galapo.
« Last Edit: September 29, 2012, 07:30:29 AM by Galapo »

Re: ISO Boot
« Reply #3 on: September 29, 2012, 07:43:37 AM »

gbrao

  • Chef
  • ***
  • Date Registered: Sep 2011
  • Posts: 258
what i would <i>really</i> like, if possible : an option to create a img/vhd rather than a iso which when booted from g4d (firadisk) boots as drive C:.

Re: ISO Boot
« Reply #4 on: September 29, 2012, 09:30:00 AM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Must be present in the root:
"MountPEmedia.ini"  :mad:
This is an oversight, I add it :

MountPEmedia.exe usage:
[-ini Inifile]   ex: MountPEmedia.exe -ini x:\Windows\System32\MountPEmedia.ini (could be BootPE.ini with the same ini structure).
   otherwise search: "ProgramName Without Extenssion"ini in Working Dir then System Dir.
[-h | /h]   Help'

(*) Requires Imdisk installed to mount ISO file.

what i would <i>really</i> like, if possible : an option to create a img/vhd rather than a iso which when booted from g4d (firadisk) boots as drive C:.

This is another topic to study:
I have not looked specifically img or vhd formats to see what they could bring to the project.
If you have any information on the subject, advantages, disadvantage, implementation in win7pe.


@Galapo
I understand the same thing for my wife  :wink:
I wish you a good break, vacation, with all the joys of being in family  :surfing:.

:cheers:

Re: ISO Boot
« Reply #5 on: September 30, 2012, 09:44:33 AM »

Galapo

  • Gena Baker
  • Grand Chef
  • *****
  • Location: Australia
  • Date Registered: Sep 2010
  • Posts: 2207
Thanks, Chris!

My girl is only 20 months old, so she doesn't know about holidays yet. I have a boy thats 5 and another thats 7 -- both are looking forward to going to a zoo and maybe exploring some caves (since the water here is still a bit too cold for a beach holiday).

Regards,
Galapo.

Re: ISO Boot
« Reply #6 on: September 30, 2012, 10:45:32 AM »

Doberman

  • Jr. Chef
  • **
  • Date Registered: Oct 2011
  • Posts: 84
Hi ChrisR! :great:

One problem. :confused:

After mounting the "iso"  as a "Y" does not work "RecEnv.exe".

Finds Host Windows? :ohmy:


Re: ISO Boot
« Reply #7 on: September 30, 2012, 10:28:31 PM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Can you give me your config Doberman, x86/x64, build model in RAM, not tested so far with build model Normal (flat files).

I just tried in VMware (Win7 x86 + Win7pe_x86.iso (fr), seems to work.

ila_rendered

:cheers:

Re: ISO Boot
« Reply #8 on: September 30, 2012, 10:43:01 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
btw,

a simple intro on initial post would be nice for newbies also better "first touch" experiences, like:

Quote
make your build, put your final iso to the root of your drive (usb, disk whatever) (do not change iso name)
get your iso boot via grub4dos isolinux etc. with following menu
...







More Details and some features:
....

just and idea
:ymca:

Re: ISO Boot
« Reply #9 on: September 30, 2012, 11:14:06 PM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Yep  :thumbsup:

Re: ISO Boot
« Reply #10 on: October 01, 2012, 05:16:57 AM »

Doberman

  • Jr. Chef
  • **
  • Date Registered: Oct 2011
  • Posts: 84
ChrisR! :great:

In VmVare I also work.! :great:

Does not work on real machines? :confused:

Re: ISO Boot
« Reply #11 on: October 01, 2012, 12:59:18 PM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Hi Doberman,

Yep, in real computer (always better for testing :great:), I reproduced the same thing.
Recenv does not find the host windows.
I have the same thing too, by removing mount ISO with imdisk.

Everything else seems to work fine, I do not know why, no idea at the moment.
I hope that we will find why. Thanks for this good catch :thumbsup:

ps: I do not have a lot of time early this week but I do not forget to look.

:cheers:

Re: ISO Boot
« Reply #12 on: October 01, 2012, 11:43:31 PM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
I think that I found a track for Recenv, Seems to be related to the ISO format.
I tried with oscdimg and the following command:

Code: [Select]
oscdimg.exe  -h -m -n -o -b"%targetdir%\Boot\etfsboot.com" "%targetdir%" "%ISODir%\Win7PE_x86.iso"

The switches are to watch, it must be ISO 9660.

If you do not have oscdimg, you can easily retrieve it with GetWaikTools in Utils folder  :smile:

Currently CreateISO script use mkisofs, I'm a bit lost with all switches.
In any case, for ISO Boot, we must use Boot Manager = Auto or Standard (bootsector=etfsboot.com) and not Grub4Dos , IsoLinux  or BCDW.

:cheers:

Re: ISO Boot
« Reply #13 on: October 05, 2012, 02:21:02 PM »

Doberman

  • Jr. Chef
  • **
  • Date Registered: Oct 2011
  • Posts: 84
Hi ChrisR!

Exactly the same problem arises with the use WinVblock. :ohmy:

I tried your new method. But the problem remained. :ohmy:

Currently I'm using: "Erdlogon.exe"

Erdlogon.exe X:\sources\recovery\RecEnv.exe       - it works!  :cool:

Re: ISO Boot
« Reply #14 on: October 05, 2012, 10:33:57 PM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Hi Doberman,

Yep, use Imdisk or Firadisk to mount the ISO in Virtual disk remains quite similar in principle.

I'm a little confused, during my tests, I managed to make Recenv work in ISO Boot x64/x86 (reminder: need same arch as hostOS => the interest also of a x64 build).
I thought it was the ISO format but now I do not really know what is wrong.
Everything else looks good except Recenv and yes Dart works well.
I'll re-test next week, hoping to find the reason.

:cheers:

Re: ISO Boot
« Reply #15 on: October 07, 2012, 02:39:46 PM »

ginzu

  • Jr. Chef
  • **
  • Date Registered: Aug 2012
  • Posts: 28
Hi _ChrisR.:)

I have tried on usb.Mount Y: and working programs.Great job.:)Thanks a lot (ChrisR-jfx and-Lancelot) 
:thumbup: :clap: :cheers:
« Last Edit: October 07, 2012, 02:54:28 PM by ginzu »

Re: ISO Boot
« Reply #16 on: October 08, 2012, 10:17:01 AM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Thanks ginzu :thumbsup:

@Doberman,
I managed to get System Recovery in "ISO Boot" working again, in real computer x86 and x64  :cool:
I believe it had worked for me previously because I had tested with a USB hard drive.

To confirm, can you try by changing the menu.lst entry with:

Code: [Select]
iftitle [find /Win7PE_x64.iso] Find and Load Win7PE_x64.ISO
find --set-root --ignore-floppies /Win7PE_x64.ISO
map (hd0) (hd1)
map (hd1) (hd0)
map /Win7PE_x64.ISO (0xff)
map --hook
root (0xff)
chainloader (0xff)/BOOTMGR
(or with Win7PE_x86.iso if your HostOS is x86)

Add:
map (hd0) (hd1)
map (hd1) (hd0)
seems to solve the problem, at least for me.

:cheers:

Re: ISO Boot
« Reply #17 on: October 08, 2012, 11:25:05 AM »

Doberman

  • Jr. Chef
  • **
  • Date Registered: Oct 2011
  • Posts: 84
O Great ChrisR!!! :great: :tongue: :w00t: :thumbsup:

It works great! :thumbsup:


Oh my god! :thumbsup: :w00t:

Re: ISO Boot
« Reply #18 on: October 08, 2012, 01:09:14 PM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Great, thank you for your tests and to have seen it, happy end :thumbup:

I will continue with the first mini-package, at first post, by adding this and few things.

:cheers:

Re: ISO Boot
« Reply #19 on: February 17, 2013, 04:50:06 AM »

halikus

  • Jr. Chef
  • **
  • Date Registered: Feb 2013
  • Posts: 28
Hi all.  Its an old thread, but this is a different approach to the op.

If you want to boot an iso or img file, in grub4dos menu.lst add the following to automatically scan (you can change this) DVDROOT:\boot\ISO and DVDROOT:\boot\IMG to scan for files and ask you wich one to load.  Tested with Win7\8 x86\x64 WinPESE and Livexp (wimboot iso) in VMWare.  I included a small boot directory example of the newest grub4dos and Imdisk addon too, syslinux with ntfs support, and isolinux.  There are lots of different examples of how to boot isos in the lst files.

Code: [Select]

#iftitle [if exist /boot/ISO]     Boot any ISO in directory ISO\n  This will list ISOs in the directory ISO and allow you to boot them
title Boot any ISO in directory ISO\n  This will list ISOs in the directory ISO and allow you to boot them
ls /boot/ISO/
set /p MYISO=Which ISO do you want to boot?
ls /boot/ISO/%MYISO% || echo ISO %MYISO% NOT FOUND! && configfile /boot/grub/menu.lst
map /boot/ISO/%MYISO%.iso (0xff)
map --hook
chainloader (0xff)
boot



title Boot IMG in directory boot IMG\n  This will list IMGs in the directory IMG and allow you to boot them
ls /boot/IMG/
set /p MYIMG=Which IMG do you want to boot?
ls /boot/IMG/%MYIMG% || echo IMG %MYIMG% NOT FOUND! && configfile /boot/grub/menu.lst
map --mem /boot/IMG/%MYIMG%.IMG (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)



and you can add grub4dos and syslinux and isolinux to the bcd with this script.   save as a cmd and run in the same dir as your bcd file (usually DVDROOT:\boot).

Code: [Select]
@echo off
rem for VMWARE   firmware= "efi"
title Windows V 7 8 install.wim boot.wim and BCD manipulation
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getprivileges
if '%1'=='ELEV' (shift & goto gotPrivileges) 
setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
ECHO set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"
exit /B
:gotPrivileges
Set BCDEDIT=%SYSTEMROOT%\System32\BCDEDIT.exe
set BCD=%~dp0BCD

:DVDMBR
set STORE=/store %BCD%
rem %BCDEDIT% /createstore %BCD%
set WINLOAD=winload.exe
set PartitionLetter=boot
set Partition=boot
set Path=[boot]\sources
set SDI=[boot]\boot\boot.sdi
set choice=
set DisplayBootMenu=%BCDEDIT% %STORE% /set {bootmgr} DisplayBootMenu True
goto :GRUB4DOS



:GRUB4DOS
echo GRUB4DOS
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Grub4dos  (%PartitionLetter%\boot\grub\grldr)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\grub\grldr
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :SYSLINUX



:SYSLINUX
echo SYSLINUX
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Syslinux  (%PartitionLetter%\boot\syslinux\syslinux.bin) (USB)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\syslinux\syslinux.bin
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :ISOLINUX


:ISOLINUX
echo ISOLINUX
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Isolinux  (%PartitionLetter%\boot\isolinux\isolinux.bin) (CD\DVD)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\isolinux\isolinux.bin
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :LiveXP


:LiveXP
echo XP PE
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "LiveXP Mini PE (%partition%\boot\XP.wim)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\SETUPLDR.BIN
%BCDEDIT% %STORE% /displayorder %guid% /addlast

%BCDEDIT% %STORE%
pause




The iso switches i use are

win bootmgr
oscdimg -lWIN -u1 -h -m -k -oc -bootdata:2#p0,e,b.\boot\etfsboot.com#pEF,e,b.\efi\microsoft\boot\Efisys.bin .\ .\Win_BCD.iso

xp
mkisofs -bXP.bin -no-emul-boot -boot-load-seg 1984 -boot-load-size 4 -iso-level 2 -J -joliet-long -l -D -relaxed-filenames -N -V XP_SP3 -v -x .DS_Store -o %CD%\Win_XP.iso %CD%

isolinux
mkisofs -J -R -T -v -l -b boot/syslinux/isolinux.bin -c boot/syslinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -volid 'ISOSYSLINUX' -o %CD%\ISOSYSLINUX.iso %CD%

grub4dos
mkisofs -J -R -T -v -l -b boot/grub/grldr -c boot/grub/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -volid 'Grub' -o %CD%\Grub4dos.iso %CD%

and to have syslinux boot the usb, i use

set usb=%cd%
cls
echo.
echo   Wich USB drive letter?
echo.
set _choiceusb=
set /p _choiceusb=Enter a drive letter :
if "%_choiceusb%" equ "" goto exit
if "%_choiceusb%" gtr "0" goto :syslinuxbin
:syslinuxbin
cls
@echo on
%~dp0syslinux.exe -f -d /boot/syslinux %_choiceusb%: %~dp0syslinux.bin
%~dp0syslinux.exe -m -a -d /boot/syslinux %_choiceusb%:
exit
« Last Edit: February 17, 2013, 05:03:58 AM by halikus »

 

Powered by EzPortal