I am hoping you can help me. I am trying to get a linux based system called Batocera to boot via Grub2Win. I have tried putting in custom code to do so, but I cannt get it to work. Here is the wiki for it if you need it: https://wiki.batocera.org/doku.php?id=start
Any help would be greatly appreachiated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the reply. Sorry it's taken me a while to reply. Batocera does boot natively, but I cannt find a grub.cfg file. I did google Batocera grub.cfg afterwards and I found this code:
Thanks for the reply. Sorry it's taken me a while to reply.
Batocera does boot natively, but I cannt find a grub.cfg file.
I did google Batocera grub.cfg afterwards and I found this
code:
set default="0"
set timeout="0"
menuentry "batocera.linux" {
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0
vt.global_cursor_default=0
initrd /boot/initrd.gz
}
I used that as a custom code in Grub2Win, but it didn't work.
I don't know if that helps find a solution or not .
I don't agree. The Bat EFI code only gets executed if the machine is set to boot the USB on an EFI machine before Windows or Grub2Win. If the machine is booting Grub2Win a grub2 menu set up like I suggested should boot.
Have you actually booted Batocera using GNU Grub or Grub2Win to load it?
I have not had success.
Thing is, Batocera seems to have its own menu system for booting. See
the attached config file from the Batocera download.
Similar to GNU Grub, but using a different syntax and not compatible.
Dave
On 5/28/2020 12:52 PM, Ed P wrote:
I don't agree. The Bat EFI code only gets executed if the machine is
set to boot the USB before Windows or Grub2Win. If a grub2 menu is set
up like I suggested it should boot.
I have not, I don't have a spare flash drive. Have you tried the menu I posted?
I think a problem is how to get the img file to the flash drive. Their website mentioned it when I was lookng for the download but I didn't read it. I was hoping to try to boot it as an ISO but haven't tried that either. How did you write the file to the flash drive?
And yes I have seen the syslinux.cfg that was in the download. Grub4DOS maybe?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The only way I've been able to bring up Batocera is by booting the
Batocera EFI module directly from firmware. No Grub.
At this point, I've given up on booting Batocera via GNU Grub or Grub2Win.
Dave
On 5/28/2020 8:52 PM, Ed P wrote:
I have not, I don't have a spare flash drive. Have you tried the menu
I posted?
I think a problem is how to get the img file to the flash drive. Their
website mentioned it when I was lookng for the download but I didn't
read it. I was hoping to try to boot it as an ISO but haven't tried
that either. How did you write the file to the flash drive?
And yes I have seen the syslinux.cfg that was in the download.
Grub4DOS maybe?
As you might see from the post I have just made I have got it to work on my computer using Ed's advice.
Having a look though your conversation I thought I'll tell you how I have my computer set up so you can try it yourselves if you want.
I have Batocera installed on an internal hard drive in the computer if that makes any difference. So I have one hard drive with Windows 10 on it, and one hard drive with Batocera on it. Due to an issue I had installing Batocera on the hard drive via USB and then using Batocera to install on the hard drive in the System Settings, I actually flashed the Hard Disk using balenaEtcher, and then booted just that hard disk for it's set up.
In Grub2Win I have the code as a Custom Code, which is:
set default="0"
set timeout="0"
menuentry "batocera.linux" {
search -f /batocera-boot.conf --set=root
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
}
When I boot the computer up and select Grub2, I go to the Custom Code option. It runs the code and give me a new option called batocera.linux. I select that and it runs Batocera.
I hope that helps you both, and thank you both for your help with this, it is greatly appreciated. I am going to try this on other computer this weekend as well, which is set up the same as mine. I'll report back as well so you both know if that is successful as well or not.
If you have any other questions in the meantime, please do ask me and I'll try to answer them.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Suggestion, try a menu without the set default and set timeout. a. They have no impact on Grub2Win since they are outside the menuentry. And b. they have no impact on batocera since they are outside the grub2 menu entry. If that works you can use a more standard Grub2Win menu entry.
Thanks for reporting back and happy it is working for you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you very much for that. It now boots Batocera for me. I have to run the code each time I boot up the computer, but it then adds Batocera.Linux as a option, which boots it up.
In case anyone wants to look/know the code I have is:
set default="0"
set timeout="0"
menuentry "batocera.linux" {
search -f /batocera-boot.conf --set=root
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After some struggle, I was able to get the Batocera .img files copied to two partitions on a single MBR type drive. This should work for a BIOS / MBR system.
Partition 1. fat32 4 GB labeled "BATOCERA"
Partition 2. ext4 256 MB labeled "SHARE"
Then all you need is a Grub2Win custom code entry with the following three lines:
I tried the code on the other PC just now and it doesn't work. I haven't tried any of the other suggestions yet, but I thought I would let you both know first.
I noticed you both were talking about BIOS and the machine it does work out is BIOS, and the other one is EFI, which looking though your discussion I assume that is why I have an issue on the EFI computer.
I'll try out your suggestions and report back once I have.
Adam
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'll doubled check if secure boot is disabled, as I cannot remember off the top of my head, and I'll test your code as well Dave on another entry to see if that works as well.
Adam
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm confused Adam. In a prior post you said "I tried the code on the other
PC just now and it doesn't work." and now you're saying it does work.
Could you please post the code that works for you on both machines?
Sorry I've confused you. The code that works on the BIOS computer is:
set default="0"
set timeout="0"
menuentry "batocera.linux" {
search -f /batocera-boot.conf --set=root
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
}
The code that works on the EFI computer is:
getpartition file /batocera-boot.conf root
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
I hope that clears things up for you.
Adam
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am hoping you can help me. I am trying to get a linux based system called Batocera to boot via Grub2Win. I have tried putting in custom code to do so, but I cannt get it to work. Here is the wiki for it if you need it: https://wiki.batocera.org/doku.php?id=start
Any help would be greatly appreachiated.
Hi Adam,
I'm not really familiar with Batocera. Perhaps someone else on this board has used it and can help you out.
If you can boot Batocera natively, you may be able to copy the native grub.cfg file to Windows and import it into Grub2Win.
Please let me know how you make out.
Thanks,
Dave
Hey Dave,
Thanks for the reply. Sorry it's taken me a while to reply. Batocera does boot natively, but I cannt find a grub.cfg file. I did google Batocera grub.cfg afterwards and I found this code:
set default="0"
set timeout="0"
menuentry "batocera.linux" {
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
}
I used that as a custom code in Grub2Win, but it didn't work. I don't know if that helps find a solution or not .
Adam
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
Hi again Adam,
I downloaded Batocera to see how it was set up.
Batocera uses its own custom EFI boot modules and menu system
instead of using GNU Grub to load like most other Linux
distributions.
These custom EFI modules are loaded directly from the USB drive at
boot time.
Batocera does not appear to be bootable by either GNU Grub or
Grub2Win.
Sorry,
Dave
wrote:
I don't agree. The Bat EFI code only gets executed if the machine is set to boot the USB on an EFI machine before Windows or Grub2Win. If the machine is booting Grub2Win a grub2 menu set up like I suggested should boot.
menuentry "batocera.linux" {
search -f /batocera-boot.conf --set=root
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
}
-
hmmm
Could try replacing the linux and initrd lines with: chainloader /EFI/BOOT/bootx64.efi
We are talking about writing the vfat.img to the USB drive. Right?
Last edit: Ed P 2020-05-28
Hey Ed,
Have you actually booted Batocera using GNU Grub or Grub2Win to load it?
I have not had success.
Thing is, Batocera seems to have its own menu system for booting. See
the attached config file from the Batocera download.
Similar to GNU Grub, but using a different syntax and not compatible.
Dave
On 5/28/2020 12:52 PM, Ed P wrote:
I have not, I don't have a spare flash drive. Have you tried the menu I posted?
I think a problem is how to get the img file to the flash drive. Their website mentioned it when I was lookng for the download but I didn't read it. I was hoping to try to boot it as an ISO but haven't tried that either. How did you write the file to the flash drive?
And yes I have seen the syslinux.cfg that was in the download. Grub4DOS maybe?
Hey Ed,
Yes I tried it. No luck.
The only way I've been able to bring up Batocera is by booting the
Batocera EFI module directly from firmware. No Grub.
At this point, I've given up on booting Batocera via GNU Grub or Grub2Win.
Dave
On 5/28/2020 8:52 PM, Ed P wrote:
What did you use to write the img to the flash drive? balenaEtcher?
Did you try booting using chainloader? Similar to what my WindowsUSBRecoverydrive menu looks like.
Last edit: Ed P 2020-05-29
Hey guys,
As you might see from the post I have just made I have got it to work on my computer using Ed's advice.
Having a look though your conversation I thought I'll tell you how I have my computer set up so you can try it yourselves if you want.
I have Batocera installed on an internal hard drive in the computer if that makes any difference. So I have one hard drive with Windows 10 on it, and one hard drive with Batocera on it. Due to an issue I had installing Batocera on the hard drive via USB and then using Batocera to install on the hard drive in the System Settings, I actually flashed the Hard Disk using balenaEtcher, and then booted just that hard disk for it's set up.
In Grub2Win I have the code as a Custom Code, which is:
set default="0"
set timeout="0"
menuentry "batocera.linux" {
search -f /batocera-boot.conf --set=root
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
}
When I boot the computer up and select Grub2, I go to the Custom Code option. It runs the code and give me a new option called batocera.linux. I select that and it runs Batocera.
I hope that helps you both, and thank you both for your help with this, it is greatly appreciated. I am going to try this on other computer this weekend as well, which is set up the same as mine. I'll report back as well so you both know if that is successful as well or not.
If you have any other questions in the meantime, please do ask me and I'll try to answer them.
Excellent news Adam.
Suggestion, try a menu without the set default and set timeout. a. They have no impact on Grub2Win since they are outside the menuentry. And b. they have no impact on batocera since they are outside the grub2 menu entry. If that works you can use a more standard Grub2Win menu entry.
Thanks for reporting back and happy it is working for you.
You need to add a set of root to the drive BATOCERA is mounted on before the linux and initrd lines..
Something like:
search -f /batocera-boot.conf --set=root
(From \batocera-5.25-x86_64-20200310.img\vfat.img)
or
search -f /bootcode.bin --set=root
(From https://wiki.batocera.org/_media/etcher2.png)
Last edit: Ed P 2020-05-29
Hey Ed,
Thank you very much for that. It now boots Batocera for me. I have to run the code each time I boot up the computer, but it then adds Batocera.Linux as a option, which boots it up.
In case anyone wants to look/know the code I have is:
set default="0"
set timeout="0"
menuentry "batocera.linux" {
search -f /batocera-boot.conf --set=root
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
}
Hey again Adam,
After some struggle, I was able to get the Batocera .img files copied to two partitions on a single MBR type drive. This should work for a BIOS / MBR system.
Partition 1. fat32 4 GB labeled "BATOCERA"
Partition 2. ext4 256 MB labeled "SHARE"
Then all you need is a Grub2Win custom code entry with the following three lines:
getpartition file /batocera-boot.conf root
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
Grub2Win then boots Batocera directly from its menu.
I still have not been able to get it to work in an EFI / GPT environment.
Hope this helps,
Dave
Dave, on your 4 GB BATOCERA partition do you have the EFI folder that's in the vfat.img file?
Did you try:
getpartition file /batocera-boot.conf root
chainloader /EFI/BOOT/bootx64.efi
?
Is the drive GPT?
Last edit: Ed P 2020-05-29
Hey Ed,
This is a BIOS / MBR machine.
If you have the time to try and build an EFI configuration, you are welcome to try. This .img file is not easy to work with,
Thanks,
Dave
Dave,
I am able to open the img files using 7-zip. Why do you think the machine is BIOS? It is running Windows 10.
Ed
Hey again Dave and Ed,
I tried the code on the other PC just now and it doesn't work. I haven't tried any of the other suggestions yet, but I thought I would let you both know first.
I noticed you both were talking about BIOS and the machine it does work out is BIOS, and the other one is EFI, which looking though your discussion I assume that is why I have an issue on the EFI computer.
I'll try out your suggestions and report back once I have.
Adam
Hi Adam.
So you have Grub2Win installed on both machines. On the EFI machine you
have secure boot disabled?
Ed
https://sourceforge.net/p/grub2win/discussion/general/thread/2df55592d3/?limit=25#01ce
Hi again Adam,
Try a Grub2Win custom code entry on your EFI machine with the following two lines of code:
getpartition file /batocera-boot.conf root
chainloader /EFI/BOOT/bootx64.efi
Please let me know if this works for you.
Thanks,
Dave
Hey,
I have just tried this code from further up before I noticed your replies, and it works.
getpartition file /batocera-boot.conf root
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
I'll doubled check if secure boot is disabled, as I cannot remember off the top of my head, and I'll test your code as well Dave on another entry to see if that works as well.
Adam
I have checked for secure boot and I have CSM enabled, so secure boot should be disabed.
I also tried the two lines of code you posted above Dave and that didn't work. It said it couldn't find the signature if that is of any help.
The three lines of code I posted above is still working though, and I've booted though a few times now to make sure.
Thank you both so much for your help.
I'm confused Adam. In a prior post you said "I tried the code on the other
PC just now and it doesn't work." and now you're saying it does work.
Could you please post the code that works for you on both machines?
Last edit: Ed P 2020-06-01
Hey Ed,
Sorry I've confused you. The code that works on the BIOS computer is:
set default="0"
set timeout="0"
menuentry "batocera.linux" {
search -f /batocera-boot.conf --set=root
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
}
The code that works on the EFI computer is:
getpartition file /batocera-boot.conf root
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0
initrd /boot/initrd.gz
I hope that clears things up for you.
Adam
So you didn't try the BIOS computer without the two set commands.
The 3 lines of code you have for the EFI computer should work for both computers so only one menu to maintain.
Good luck Adam.