Jump to content











Photo
- - - - -

usb token to autoselect boot option...


  • Please log in to reply
23 replies to this topic

#1 deatty

deatty

    Member

  • Members
  • 35 posts
  •  
    Italy

Posted 18 February 2015 - 06:02 AM

Hi at all,

i havo no skill with grub4dos. So i ask you some help.

i'd like to "auto-choose" boot option by the presence of a "token file" into usb drive without the interaction with a user interface (on screen only black screen without evidence of boot process)

Scenario:

1. boot grub4dos from mbr

2. check the presence of a "token file" into a usb pendrive (maybe by checking its hash, if possibile...)

3. if the check was positive point to submenu file into usb pendrive that boots a vhd windows 7 image ...

4. if the check was negative than boot windows 7 o.s into a partition of hdd (default case)

is it possibile with grub4dos or with another bootloader ?


thanks at all for your help



#2 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 18 February 2015 - 10:43 AM

Yes, this sounds possible in grub4dos

1. Are you booting from the USB or from the internal HDD?

2. Presumably all Windows versions are MBR-based (not UEFI)?

3. Grub4dos can check the CRC32 value of a file

 

 

Another way instead of a special file (unsure of your purpose) would be to have a secret key combination - e.g.  SHIFT+CTRL.

If this is not detected then it boots normally - if it is detected then it shows the grub4dos menu.

 

These may help:

 

http://www.rmprepusb...OC-Secret-menus

http://www.rmprepusb...c-grub4dos-menu



#3 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 18 February 2015 - 12:41 PM

If the thing is related to detecting *something* connected to the specific USB device and automatically do some or some other action, more generally, there are two main ways, one is what you call "token file" and that is generally referred when talking about this as "tag file" and another (cannot say if useful in your case) is to use the UUID of the volume.

Additionally you can use grub4dos features to check - say - for a disk signature or more generally for a known byte sequence within a file or within a given sector.

 

:duff:

Wonko



#4 deatty

deatty

    Member

  • Members
  • 35 posts
  •  
    Italy

Posted 18 February 2015 - 05:04 PM

Yes, this sounds possible in grub4dos

1. Are you booting from the USB or from the internal HDD?

2. Presumably all Windows versions are MBR-based (not UEFI)?

3. Grub4dos can check the CRC32 value of a file

 

 

Another way instead of a special file (unsure of your purpose) would be to have a secret key combination - e.g.  SHIFT+CTRL.

If this is not detected then it boots normally - if it is detected then it shows the grub4dos menu.

 

These may help:

 

http://www.rmprepusb...OC-Secret-menus

http://www.rmprepusb...c-grub4dos-menu

 

 

 

boot from hdd and yes, all windows version are actually MBR based.

 

Probably some pcs, have internal hub for usb ports...

Is this a problem or it is a problem only in the case of bootmanager install into the pendrive and boot from usb ?



#5 deatty

deatty

    Member

  • Members
  • 35 posts
  •  
    Italy

Posted 18 February 2015 - 05:08 PM

If the thing is related to detecting *something* connected to the specific USB device and automatically do some or some other action, more generally, there are two main ways, one is what you call "token file" and that is generally referred when talking about this as "tag file" and another (cannot say if useful in your case) is to use the UUID of the volume.

Additionally you can use grub4dos features to check - say - for a disk signature or more generally for a known byte sequence within a file or within a given sector.

 

:duff:

Wonko

 

the idea is enable the second "silent" boot for some users...



#6 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 18 February 2015 - 05:12 PM

OK

Well I suggest you install grub4dos and make a \menu.lst file that has the menu entries that you want.

Then add the code to look for the tag file and check the crc32 value

 

So you want the users to have a USB key as a 'key'  rather than use a password or secret key combination?



#7 deatty

deatty

    Member

  • Members
  • 35 posts
  •  
    Italy

Posted 18 February 2015 - 05:19 PM

 

So you want the users to have a USB key as a 'key'  rather than use a password or secret key combination?

 

exactly...

 

OK

Well I suggest you install grub4dos and make a \menu.lst file that has the menu entries that you want.

Then add the code to look for the tag file and check the crc32 value

 

 

 

can you help me with these ?

I actually boot vhd and other os, with windows 7 bootloader...



#8 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 18 February 2015 - 05:24 PM

How do you boot the VHD at the moment?



#9 deatty

deatty

    Member

  • Members
  • 35 posts
  •  
    Italy

Posted 18 February 2015 - 05:28 PM

How do you boot the VHD at the moment?

 

native boot into bcd



#10 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 18 February 2015 - 05:32 PM

the idea is enable the second "silent" boot for some users...

Yep :), this would be an added reason for using not a simple "tag file", but rather the UUID (as it is slightly less easy to duplicate).

And still, if there is *any* security involved, a slightly enhanced approach would be to password protect the boot menu.

This would add a layer, i.e. the second boot menu would be only accessible if the device UUID matches, and then to activate it you would need anyway a password (that can be encrypted).

 

:duff:

Wonko



#11 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 18 February 2015 - 05:34 PM

Well grub4dos can boot to bootmgr on the system hdd which would then show the BCD menu - but it won't boot straight to the 2nd VHD OS.

There would need to be another partition containing bootmgr + BCD which then points to the VHD on the hard disk.

This 2nd partition could be on the USB key (but you would need a different key for each system, I think), or a 2nd partition on the internal HDD.



#12 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 18 February 2015 - 05:35 PM

double post again! Wish forum software worked!



#13 deatty

deatty

    Member

  • Members
  • 35 posts
  •  
    Italy

Posted 18 February 2015 - 06:17 PM

Yep :), this would be an added reason for using not a simple "tag file", but rather the UUID (as it is slightly less easy to duplicate).

And still, if there is *any* security involved, a slightly enhanced approach would be to password protect the boot menu.

This would add a layer, i.e. the second boot menu would be only accessible if the device UUID matches, and then to activate it you would need anyway a password (that can be encrypted).

 

:duff:

Wonko

 

mmmh... i'd like use a pool of pendrive usb and in my case a preventive control of uuid it would be not guaranteed...

 

Instead a second level of authentication by password is a good idea if it's encrypted !


Edited by deatty, 18 February 2015 - 06:20 PM.


#14 deatty

deatty

    Member

  • Members
  • 35 posts
  •  
    Italy

Posted 18 February 2015 - 06:19 PM

Well grub4dos can boot to bootmgr on the system hdd which would then show the BCD menu - but it won't boot straight to the 2nd VHD OS.

There would need to be another partition containing bootmgr + BCD which then points to the VHD on the hard disk.

This 2nd partition could be on the USB key (but you would need a different key for each system, I think), or a 2nd partition on the internal HDD.

 

and if i install x64 firadisk driver into vhd os image ?



#15 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 18 February 2015 - 07:00 PM

Instead a second level of authentication by password is a good idea if it's encrypted !

See here (if needed):

http://reboot.pro/to...ssword-protect/

http://reboot.pro/to...ub-md-password/

 

:duff:

Wonko



#16 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 18 February 2015 - 07:39 PM

Lets get booting sorted first before we start looking at how to make it more secure...

 

Can you explain what you mean by 'native boot into VHD'?

So when the system boots, does the user see a bootmgr menu with two choices at the moment - one for the 'normal' Windows 7 and one for the VHD?

Where is the VHD located and how many partitions are there on the hard disk?

Could we create another Primary partition on the hard disk?



#17 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 18 February 2015 - 07:50 PM

I actually boot vhd and other os, with windows 7 bootloader...

How are machines configured? Can you boot from USB?
What about bootmgr and \boot at USB, and a special \boot\bcd configured to locate vhd at hdd?

#18 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 18 February 2015 - 07:52 PM

Are we talking about one system or is  there more than one system configured like this that you want to boot?



#19 deatty

deatty

    Member

  • Members
  • 35 posts
  •  
    Italy

Posted 20 February 2015 - 07:24 PM

Can you explain what you mean by 'native boot into VHD'?

 

 

boot with the windows driver licensed with W7 Ultimate

 

 

So when the system boots, does the user see a bootmgr menu with two choices at the moment - one for the 'normal' Windows 7 and one for the VHD?

 

yes
 

 

Where is the VHD located and how many partitions are there on the hard disk?

Could we create another Primary partition on the hard disk?

 

 

i have different situations in some pcs

 

Generally i have no possibility to create another primary partition...

 

Are we talking about one system or is  there more than one system configured like this that you want to boot?

 

 more than one


Edited by deatty, 20 February 2015 - 07:28 PM.


#20 deatty

deatty

    Member

  • Members
  • 35 posts
  •  
    Italy

Posted 20 February 2015 - 07:28 PM

How are machines configured? Can you boot from USB?
What about bootmgr and \boot at USB, and a special \boot\bcd configured to locate vhd at hdd?

 

no. Not directly from bios....

 

i tried to boot from usb with plop but in some pcs no boot device was detected...

I think that in this case there is a internal usb hub (i read that plop does't support usb hub driver)



#21 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 20 February 2015 - 07:30 PM

What type of VHD is it? Dynamic, or fixed size? 



#22 deatty

deatty

    Member

  • Members
  • 35 posts
  •  
    Italy

Posted 21 February 2015 - 04:15 PM

What type of VHD is it? Dynamic, or fixed size? 

 

fixed



#23 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 21 February 2015 - 04:48 PM

OK, as an experiment, can you try the following.

 

Use RMPrepUSB to make a bootable USB Flash drive - choose

Size=Max

Volume name = anything

Boot = bootmgr

Options = FAT32 + Boot as HDD

Files - empty

Click Prepare

Now install grub4dos using RMPrepUSB - install grub4dos - choose MBR.

Now download latest version of grub4dos 0.4.6a from here and overwrite the \grldr file on the USB drive with the one from the grub4dos download.

 

Now boot to the bootable USB drive on the target system that has the VHD.

You should get to the grub4dos shell.

In the grub4dos shell type

map /xxx/yyyyy.vhd (hd0)   
map (hd0) (hd31)
map --hook
root (hd0,0)
ls /
chainloader (hd0,0)/bootmgr
boot

this assumes your VHD has bootmgr and a correctly configured BCD within it. Also that the boot partition inside the VHD is on the 1st partition.

If it does not boot then you could add a BCD and bootmgr into the VHD by using bcdboot?

 

Use a system that will boot from USB.

 

Alternatively, why not just set the BCD of each system with a 1 second timeout and use a blank entry for the name of the VHD option? This gives the user 1 second to select the 2nd (blank) option.



#24 deatty

deatty

    Member

  • Members
  • 35 posts
  •  
    Italy

Posted 25 February 2015 - 03:54 PM

OK, as an experiment, can you try the following.

 

Use RMPrepUSB to make a bootable USB Flash drive - choose

Size=Max

Volume name = anything

Boot = bootmgr

Options = FAT32 + Boot as HDD

Files - empty

Click Prepare

Now install grub4dos using RMPrepUSB - install grub4dos - choose MBR.

Now download latest version of grub4dos 0.4.6a from here and overwrite the \grldr file on the USB drive with the one from the grub4dos download.

 

Now boot to the bootable USB drive on the target system that has the VHD.

You should get to the grub4dos shell.

In the grub4dos shell type

map /xxx/yyyyy.vhd (hd0)   
map (hd0) (hd31)
map --hook
root (hd0,0)
ls /
chainloader (hd0,0)/bootmgr
boot

this assumes your VHD has bootmgr and a correctly configured BCD within it. Also that the boot partition inside the VHD is on the 1st partition.

If it does not boot then you could add a BCD and bootmgr into the VHD by using bcdboot?

 

Use a system that will boot from USB.

 

Alternatively, why not just set the BCD of each system with a 1 second timeout and use a blank entry for the name of the VHD option? This gives the user 1 second to select the 2nd (blank) option.

 

 ok. i'll try this evening...






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users