Jump to content











Photo
- - - - -

Multiboot UEFI boot-capable thumb drive for Win 7/8 & Linux installation


  • Please log in to reply
44 replies to this topic

#26 cyphersmith

cyphersmith

    Newbie

  • Members
  • 22 posts
  •  
    United States

Posted 16 January 2013 - 07:15 PM

The proposed strategy Installs one version of Windows at a time on drive of local harddisk and virtualization is not used.

Ok, I misunderstood what you were proposing.  You're talking about booting Windows 8 on the thumb drive (NOT the installer).  I hadn't thought of that.  I think it would be easier than what I am proposing, and I could just create shortcuts on the desktop for each version of Windows.  I hadn't considered that because I haven't done a "live USB" Windows install before.



#27 wimb

wimb

    Gold Member

  • Developer
  • 2,167 posts
  •  
    Netherlands

Posted 16 January 2013 - 07:36 PM

USB thumb drive does not have enough speed and may be too small to contain the Setup ISO files of all Windows versions that you want to use for Install.

Portable USB-harddisk is more suitable for this purpose (much more speed and capacity).



#28 cyphersmith

cyphersmith

    Newbie

  • Members
  • 22 posts
  •  
    United States

Posted 16 January 2013 - 09:15 PM

USB thumb drive does not have enough speed and may be too small to contain the Setup ISO files of all Windows versions that you want to use for Install.

Portable USB-harddisk is more suitable for this purpose (much more speed and capacity).

My final thumb drive will be a 64GB USB 3.0 thumb drive.  Plenty fast, and enough room.



#29 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1,672 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 17 January 2013 - 09:42 AM

I'm not committed to multiple partitions, I'm committed to multiple versions of Windows.

Ok.

 

If I can't boot them from ISO, which seems to be the case currently with UEFI, I have to find some other way to boot them.

(U)EFI doesn't involve INT 0x13.  That means that using MEMDISK or GRUB4DOS is out of the question.  It would be possible to write a (U)EFI driver that can allow .ISOs to be attached as virtual optical discs, but I'm not aware of anyone having written such a driver.  (Hmmm...!)

 

Multiple partitions was an idea because if the Windows ISO is extracted to a thumb drive it requires that it be in the root of the partition.

Is that so?  The BCD controls the paths and names of the files involved.  It seems to me that it would be possible for you to extract the files to different directories, combine the BCDs of the various Windows .ISOs into a single BCD, change the paths and/or filenames accordingly, then use the EFI BootMgr to boot any of them.  This wouldn't help you with your Linux stuff, though, but Linux should be more flexible, anyway.

 

Can the filter driver be loaded during install?

Yes.  If it's located on the first partition, you can install it, then remove and re-insert the USB flash storage device to obtain the other partitions.

 

I think my idea of using EFI shell scripts is the best way for now, until there is a way to "mount" an ISO from UEFI.  You can do this with GRUB2 via loopback, but loopback doesn't work for Windows and some flavors of Linux.

Well I don't know which flavours of Linux you've found that don't have loopback support, but there are at least three Windows drivers that are commonly referenced in these forums that can be used to provide a virtual optical disc from an .ISO: WinVBlock, Firadisk, ImDisk.  You could load any of these from the USB flash storage device's partition and then mount the .ISO.



#30 cdob

cdob

    Silver Member

  • Expert
  • 974 posts

Posted 18 January 2013 - 05:54 AM


Specifically, we do platform compatibility validation. This means we are often installing OS's onto our systems. Because UEFI is becoming more prevalent (especially with the changes introduced in Windows 8), some of those installs MUST be done with UEFI enabled to ensure that everything works right. 

 

Windows and EFI have restrictions.

 

Can you clarify:

Do you have any software restrictions?
Can you use drivers like diskmod, WinVBlock, Firadisk, ImDisk?
Do you use default windows ISO images?
Which file size goes to the windows ISO images? Are all below 4 GB?
Can you edit the windows ISO images?
Can you edit the file boot.wim?

Which bootloader do you use? Can you choose a own first bootloader at USB drive? Do you have to use default OS bootloader, e.g. boot to bootmgr?



#31 cyphersmith

cyphersmith

    Newbie

  • Members
  • 22 posts
  •  
    United States

Posted 18 January 2013 - 06:40 PM

Windows and EFI have restrictions.

 

Can you clarify:

Do you have any software restrictions?
Can you use drivers like diskmod, WinVBlock, Firadisk, ImDisk?
Do you use default windows ISO images?
Which file size goes to the windows ISO images? Are all below 4 GB?
Can you edit the windows ISO images?
Can you edit the file boot.wim?

Which bootloader do you use? Can you choose a own first bootloader at USB drive? Do you have to use default OS bootloader, e.g. boot to bootmgr?

The software I use must be legal, and legally obtained.  In trying to get this to work, I have used Firadisk and ImDisk.  And they work great, except with 64 bit Win8 (unless there's a way to turn off driver signing during installation). I don't think that most of them will work with UEFI, though.  I have only seen them called from syslinux and grub4dos, not grub2, and those both require real mode, which isn't available with grub2 in UEFI.

 

As long as the drivers are open source, I can use them.

 

I generally use default Windows ISO images.

 

 

I have the tools to edit the ISO images, and boot.wim, but very little experience with doing so   I had to add drivers to the Windows 7 image, for example, to test installing the OS via USB 3.0 since it doesn't have a native driver.

 

I use bootmgr.  Though I have tried grub2 for this project.  I have also tried rEFInd, which is a boot manager, as are grub4dos and syslinux.



#32 cyphersmith

cyphersmith

    Newbie

  • Members
  • 22 posts
  •  
    United States

Posted 19 January 2013 - 01:35 AM

Ok, dbob's questions gave me an idea.  At least, I think it was his questions.  I haven't finished setting this up yet, but I did some research, and found that you can add additional versions of Windows to the install.wim file.  Of course, with the number of versions of Windows that I am trying to use, that made the install.wim file too big to fit on a FAT32 drive.  After some more research, I found that the install.wim file can be split into a number of .swm files, and that the Windows installer can boot to them.  I tested it, and found that it was automatically booting to the original version of Windows in the install.  More research time.  Found out that the ei.cfg file that Windows 7 uses isn't there on Windows 8, and if it's put in on a Windows 8 install with the right parameters, it will allow you to choose which version of Windows to install, and it won't ask for a key until after the install is complete.  So, here's the steps:

 

  1. I downloaded the Windows 8 ADK and installed it.
  2. I used the install disk for Windows 8 RTM 64 bit, to make sure that I would be at a starting point to do both normal and EFI installs.  I extracted the ISO to the root directory of my thumb drive, which had been formatted as FAT32.
  3. I copied the install.wim file to a temporary directory on my hard drive.
  4. I then used DISM.exe to extract the Pro and standard installs for Windows 8 RTM 32 bit and put them into the 64 bit install, using information from here to figure out the commands.
  5. I also did this with Windows 7 SP1 32 and 64 bit.
  6. Then, I used DISM.exe to split the resulting install.wim into pieces, again using information from the site I mentioned above to figure out how to do it, putting the resulting files into the \sources directory.

That's what I have done so far.  I have tested this to do installs of Windows, and it works, except with a 32bit install in UEFI.

 

My next step will be to install grub, put Linux installs onto the thumb drive and create a menu to either boot the Windows installer or the Linux distributions I put onto it.



#33 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1,672 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 19 January 2013 - 07:22 PM

If you can boot BootMgr on (U)EFI and BIOS (which you obviously can), then as mentioned previously, you can have a BCD which allows you to boot whatever boot.wim file you want.  Once the PE has booted, you can use one of the fine, open-source drivers that were mentioned to mount whatever .ISO you want.  WinVBlock and ImDisk do not require GRUB4DOS in order to mount an .ISO from within Windows, but I can't say whether or not Firadisk does, or if Firadisk would require some changes to the BCD or .WIM file.

 

Or, you can potentially use GRUB's loopback support to boot a BootMgr inside one of the .ISOs, then once again, use one of the Windows drivers from within the PE to mount the .ISO.



#34 cdob

cdob

    Silver Member

  • Expert
  • 974 posts

Posted 20 January 2013 - 09:14 PM

There is plenty of space at a 64 GB flash.
Windows mount first partition only by default.
There is no need to use a AIO approach, hence ISO file size should be below 4 GB.

A full installed Windows 8 can mount a ISO file.
As far as I know it's not upported at default boot.wim.

http://technet.micro...y/hh848706.aspx
Adding Waik powershell to boot.wim may help, haven't done this so far.

Has anyone a solution to mount a ISO at windows 8 default boot.wim?

Idea:
Use a fat32 partition, size about 30 GB.
This parttion holds boot files and windows install files.
There are windows \boot and \efi files.
This includes BIOS and EFI boot mode.
Store several windwows ISO images.
Extract several boot.wim and store them to the fat32 partition.
Edit boot\bcd and \efi\microsoft\boot\bcd configuration file and adjust accordingly.
*nix files are at following patition(s).

Example:
\bootmgr
\bootmgr.efi
\boot\bcd
\boot\boot.sdi
\efi\microsoft\boot\bcd
\efi\boot\bootx64.efi
\boot\ISO\W7_SP1_x64.iso
\boot\ISO\W7_SP1_x64.wim
\boot\ISO\W7_SP1_x86.iso
\boot\ISO\W7_SP1_x86.wim
\boot\ISO\W8_x64.iso
\boot\ISO\W8_x64.wim
\boot\ISO\W8_x64.iso
\boot\ISO\W8_x86.wim

If need be, the default ISO files can be written to a DVD still.
Therefore the USB stick is a backup too.

As sor testing purposes:
you may use two Windows 7 boot.wim (default and with USB3 drivers) and connect to the same ISO file.

Edit the *.wim files: mount a .iso file to a drive.
ImDisk can mount a .iso file http://www.ltr-data....de.html/#ImDisk
It's open source, appropiate at a commercial environment. And there is a signed 64 bit driver.

It is possible to define ISO file name at BCD too.
http://www.911cd.net...showtopic=23337

bcdedit.exe /store \boot\bcd /set {default} LoadOptions " ISO=\images\W8_x64.iso"


Next step incorperate another bootloaders
e.g. rEFInd, syslinux, grub4dos

Do you write batches? Are you afraid about a black cmd window?
I'm writing some batches currently.



#35 wimb

wimb

    Gold Member

  • Developer
  • 2,167 posts
  •  
    Netherlands

Posted 21 January 2013 - 07:00 PM

Windows 8 Recovery boot.wim can be used also.

Such USB-stick Recovery Drive can be made easily with few mouseclicks from Windows 8 Configuration > Recovery Menu

 

After booting with Win8 Recovery USB-stick then I used Advanced Options and Command prompt of ramdisk X:

to Install XP on local harddisk by using WinNTSetup2 and via R-mouse mounted XP Setup ISO file.

WinNTSetup2 can also be used in batch command mode if desired.

 

http://reboot.pro/to...e-2#entry166256

 

 

In Recovery environment using command prompt, I can launch notepad and via File open get Explorer browser GUI
and can launch with R-mouse menu as administrator any 64-bits program e.g. WinNTSetup2_x64.exe to Install any Windows version ......
by mounting with R-mouse any Windows Setup ISO file.


#36 cdob

cdob

    Silver Member

  • Expert
  • 974 posts

Posted 28 January 2013 - 05:30 PM

@cyphersmith

Do you have to support UEFI Secure Boot?
I've no UEFI Secure Boot hardware.

Shim by Matthew Garrett
http://mjg59.dreamwidth.org/17542.html

There are Fedora and Ubuntu approaches:
https://fedoraprojec...wiki/Secureboot
https://help.ubuntu.com/community/UEFI

UEFI Secure Multi Boot is another challenge.
How to keep chain of trust at one USB with Fedora and Ubuntu?
Booted the shim loader: how to validate Windows 8 bootx64.efi?

Fedora 18 DVD: http://download.fedo...ive-Desktop.iso
boot\EFI\bootx64.efi 1370230 bytes
boot\EFI\grubx64.efi 826246 bytes

http://www.nic.funet...fc18.x86_64.rpm
boot\EFI\fedora\shim.efi 1370230 bytes

http://www.nic.funet...fc18.x86_64.rpm
boot\EFI\fedora\gcdx64.efi 826246 bytes

Config file \EFI\BOOT\grub.cfg is used.

Fedora dosn't support loopback, copy grub2 modules to EFI\BOOT\x86_64-efi and insert a 'insmod loopback'
Does this break chain of trust?

#37 cyphersmith

cyphersmith

    Newbie

  • Members
  • 22 posts
  •  
    United States

Posted 28 January 2013 - 09:00 PM

@cyphersmith

Do you have to support UEFI Secure Boot?
I've no UEFI Secure Boot hardware.

Shim by Matthew Garrett
http://mjg59.dreamwidth.org/17542.html

There are Fedora and Ubuntu approaches:
https://fedoraprojec...wiki/Secureboot
https://help.ubuntu.com/community/UEFI

UEFI Secure Multi Boot is another challenge.
How to keep chain of trust at one USB with Fedora and Ubuntu?
Booted the shim loader: how to validate Windows 8 bootx64.efi?

Fedora 18 DVD: http://download.fedo...ive-Desktop.iso
boot\EFI\bootx64.efi 1370230 bytes
boot\EFI\grubx64.efi 826246 bytes

http://www.nic.funet...fc18.x86_64.rpm
boot\EFI\fedora\shim.efi 1370230 bytes

http://www.nic.funet...fc18.x86_64.rpm
boot\EFI\fedora\gcdx64.efi 826246 bytes

Config file \EFI\BOOT\grub.cfg is used.

Fedora dosn't support loopback, copy grub2 modules to EFI\BOOT\x86_64-efi and insert a 'insmod loopback'
Does this break chain of trust?

I don't think we'll be doing much validation of Secure Boot, though it is possible.  However, I'll only have one OS installed at any one time, so I don't know that it will cause me problems.  I need to take a closer look at that, though.



#38 cyphersmith

cyphersmith

    Newbie

  • Members
  • 22 posts
  •  
    United States

Posted 13 March 2013 - 10:02 PM

So, I found out about some firmware modifications that can be done on the thumb drive I'm using which allows for the creation of an optical partition on the thumb drive.  I also found software on the controller manufacturer's website that can burn any image to that partition that you want.  This made life much easier.  I am still using a basic grub4dos menu on the regular partition on the drive, but that's mostly for DOS booting and easier installation of OS's in Legacy mode.

 

The controller on my thumb drive is the Innostor IS902E, and I found AIBurn.exe on the Innostor website.  To modify the firmware options, I used a tool that we received from Innostor, so I don't think this is a workable option for other people as I don't think that tool is generally available.

 

I do have one other question.  I can't find any grub4dos menu entry examples for either OpenSuSE 12.2 or Fedora 18, anyone know how to set them up?



#39 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,276 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 13 March 2013 - 10:35 PM

If you are booting from a writeable storage medium (flash or hdd) that has the 4th ptn entry free in the partition table, then this grub4dos will work for nearly all linux isos.

 

title xxx.iso
partnew (hd0,3) 0x00 /_ISO/Linux/xxx.iso
map  /_ISO/Linux/xxx.iso (0xff)
map --hook 
root (0xff) 
chainloader (0xff) 


#40 cyphersmith

cyphersmith

    Newbie

  • Members
  • 22 posts
  •  
    United States

Posted 15 March 2013 - 11:31 PM

If you are booting from a writeable storage medium (flash or hdd) that has the 4th ptn entry free in the partition table, then this grub4dos will work for nearly all linux isos.

 

title xxx.iso
partnew (hd0,3) 0x00 /_ISO/Linux/xxx.iso
map  /_ISO/Linux/xxx.iso (0xff)
map --hook 
root (0xff) 
chainloader (0xff) 

That did Ubuntu better than the method I was using, but the Fedora 18 Live CD image didn't like it.  I get some mount errors, and when I look at the journalctl, it appears that it is trying to read an area of the partition that doesn't exist, so it errors out, dropping me at the emergency console.



#41 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,276 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 16 March 2013 - 10:23 AM

That is strange? On a real system (not a VM) it works fine with Fedora-17-i686-Live-SoaS.iso  ???

Did you test on a real system or a VM?



#42 laddanator

laddanator

    Frequent Member

  • Advanced user
  • 337 posts
  • Location:Virginia
  • Interests:Writing code and getting stuff to work when no one else can! Wrote a Windows Vista, 7, and 8 legal activation tool in VBscript and compiled it to exe. First project of this undertaking. Working on an AIO legal activation tool that includes XP.
  •  
    United States

Posted 16 March 2013 - 11:15 AM

If you are booting from a writeable storage medium (flash or hdd) that has the 4th ptn entry free in the partition table, then this grub4dos will work for nearly all linux isos.

 

 

But not from a (U)EFI machine? Grub4dos is not supported, correct?



#43 cyphersmith

cyphersmith

    Newbie

  • Members
  • 22 posts
  •  
    United States

Posted 19 March 2013 - 06:25 PM

That is strange? On a real system (not a VM) it works fine with Fedora-17-i686-Live-SoaS.iso  ???

Did you test on a real system or a VM?

Real system.  I was using Fedora-18-x86_64-Live-Desktop.iso.



#44 wimb

wimb

    Gold Member

  • Developer
  • 2,167 posts
  •  
    Netherlands

Posted 19 March 2013 - 09:54 PM

I do have one other question.  I can't find any grub4dos menu entry examples for either OpenSuSE 12.2 or Fedora 18, anyone know how to set them up?

 

 

In case of Fedora-18 then the LABEL of the drive must be given in the boot command
 
 
Booting in BIOS mode with Fedora LiveOS folder on USB partition with LABEL 2_BOOT 
then we can use Grub4dos with entry in menu.lst

 

title Fedora-18 LIVE USB 2_BOOT

find --set-root /LiveOS/vmlinuz0
kernel /LiveOS/vmlinuz0 root=live:LABEL=2_BOOT ro rd.live.image quiet rhgb 
initrd /LiveOS/initrd0.img
 
UEFI Secure Multi-Boot of Fedora-18 and Windows 8 is possible using Grub2 Menu
 
:cheers:


#45 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,276 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 19 March 2013 - 10:01 PM

This is my menu for Fedora 17 with persistence - it uses UUID instead of LABEL

 

 
#Extract the \LiveOS files to the USB drive
#Copy the vmlinuz0 and initrd0.img files from the \isolinux folder to the USB \LiveOS folder
#For persistency, use the RMPrepUSB Make Ext2FS button and copy the file to USB drive  \LiveOS folder
# See www.rmprepusb.com  Tutorial 67 for details
 

 

title FEDORA + PERSISTENCY
uuid () > nul
set UUID=%?%
echo %UUID%
if not exist /LiveOS/overlay-LIVE-%UUID% echo WARNING: Changes will not be remembered unless a /LiveOS/overlay-LIVE-%UUID% ext2 file is created! && pause
kernel /liveos/vmlinuz0 root=live:UUID=%UUID% rootfstype=auto rw liveimg overlay=UUID=%UUID% quiet  rhgb rd.luks=0 rd.md=0 rd.dm=0 xdriver=vesa nomodeset
initrd /liveos/initrd0.img

 

 
 

  • wimb likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users