Trying to install to USB but installer apparently has UEFI bug - Is installing to USB through BIOS VM possible?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
BOplaid
Level 1
Level 1
Posts: 24
Joined: Thu Feb 08, 2024 9:24 am
Location: Iran
Contact:

Trying to install to USB but installer apparently has UEFI bug - Is installing to USB through BIOS VM possible?

Post by BOplaid »

Hi,
So I'm trying to install LM to a USB, but according to this tutorial by pbear, there's a bug in the installer(which I think is called ubiquity) that completely destroys the main system bootloader, if installing to a USB drive on a UEFI environment. I have VMware Workstation Pro 16, and I've been thinking. Since VMware has the option to make the VM BIOS, and can also connect USBs natively to the VM. So can I just make a BIOS VM using VMware, boot up the ISO, connect target USB to the VM, start ubiquity and select the drive for installation? Will that work?

And if it changes anything, the reason for me doing this is so that I can plug the USB to my host machine and use it. You may say that Live USB exists, but the data doesn't remain on it. And I know that pbear in the same article mentioned above, has shown some workarounds for this bug for UEFI users. I just want to see if this method that I just made up could work or not. And the reason I will not just plain use a VM to testdrive LM is because the VM is really slow (although it somehow manages to barely load YouTube 480p video), and I've checked with the live USB on the host system that it is much faster. I also checked that all the drivers work, which I was really surprised with. Even the keyboard backlight worked! And the touchscreen!

Anyways I'm getting offtopic, can I just use that VM method to install to the USB or not? (btw I'm going to sleep so I'll probably not respond for the next 12 hours. No I don't sleep that much it's that there are other things I obviously need to do after I wake up. So don't think I don't check for updates if I haven't replied in 2 hours! (which I usually do. I respond to messages pretty fast normally))
Last edited by BOplaid on Thu Jul 11, 2024 4:55 am, edited 2 times in total.
Trying to install LM on thumb drive so that I can testdrive more easily (and with less lag). Thread if you wanna help out.
IYmEVDc
Level 3
Level 3
Posts: 173
Joined: Mon Jan 27, 2020 8:27 pm

Re: Trying to install to USB, but installer apparently has UEFI bug - Is installing to USB through BIOS VM possible?

Post by IYmEVDc »

trying to do a full install to a usb in a vm sounds worth a try. the one thing i wonder about the plan to give your vm a bios is that the installer usually installs the system in the same way it was booted. meaning your usb would probably be a bios rather than uefi install. if your system can boot from a bios disk like that, then it sounds like it could work.

however, since you will be booting from an iso, i would think you could try giving the vm a uefi instead. because the iso gets mounted read-only, i don't think anything would happen to its booloader during the install process. though the installer may ask to unmount it, i don't recall that happening in regular installs. even if so, you could always download the iso again and try the install process in bios like you mentioned.

of course that is all only if you want the usb to be installed in uefi mode :)
User avatar
AndyMH
Level 21
Level 21
Posts: 14103
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Trying to install to USB, but installer apparently has UEFI bug - Is installing to USB through BIOS VM possible?

Post by AndyMH »

BOplaid wrote: Sun Jul 07, 2024 3:47 pm that completely destroys the main system bootloader, if installing to a USB drive on a UEFI environment.
All it does is put grub in the EFI partition on the system drive. It does not destroy the main system bootloader.

The workaround is simple.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
BOplaid
Level 1
Level 1
Posts: 24
Joined: Thu Feb 08, 2024 9:24 am
Location: Iran
Contact:

Re: Trying to install to USB, but installer apparently has UEFI bug - Is installing to USB through BIOS VM possible?

Post by BOplaid »

AndyMH wrote: Sun Jul 07, 2024 5:46 pm
BOplaid wrote: Sun Jul 07, 2024 3:47 pm that completely destroys the main system bootloader, if installing to a USB drive on a UEFI environment.
All it does is put grub in the EFI partition on the system drive. It does not destroy the main system bootloader.
And what effects will that have? I remember someone saying that then it's not possible to boot to main OS without the USB inserted, which I certainly do not want. Correct me (or that guy) if I'm wrong though.
AndyMH wrote: Sun Jul 07, 2024 5:46 pm
BOplaid wrote: Sun Jul 07, 2024 3:47 pm that completely destroys the main system bootloader, if installing to a USB drive on a UEFI environment.
The workaround is simple.
Well what is the workaround? The things mentioned in pbear's post?
IYmEVDc wrote: Sun Jul 07, 2024 4:29 pm trying to do a full install to a usb in a vm sounds worth a try. the one thing i wonder about the plan to give your vm a bios is that the installer usually installs the system in the same way it was booted. meaning your usb would probably be a bios rather than uefi install.
Yeah, that'll probably be a problem.
IYmEVDc wrote: Sun Jul 07, 2024 4:29 pm if your system can boot from a bios disk like that, then it sounds like it could work.
I have high doubts about that one. One time an HP laptop (BIOS) died and I salvaged the HDD from it. It somehow still worked (explorer popped up with all the partitions). But then I tried to boot from it, and no matter what it just wouldn't show up. I tried to boot it using VMware's "Boot from physical disk" option to make sure that the EFI partition was intact, and yes it was. (though it took around 5 MINUTES for it to boot. From experience with the HP I knew that the HDD was extremely slow, and the virtualization layer didn't make it any better).
After a lot of thinking, I eventually figured out that maybe because of the EFI being BIOS it wouldn't boot. Which was probably the case.
From that I know that my system cannot boot from a BIOS formatted disk. At least if it's not in CSM or whatever it's called. (I'm not even sure if my system has that feature. I haven't dug through the settings that much.)
IYmEVDc wrote: Sun Jul 07, 2024 4:29 pm however, since you will be booting from an iso, i would think you could try giving the vm a uefi instead. because the iso gets mounted read-only, i don't think anything would happen to its booloader during the install process. though the installer may ask to unmount it, i don't recall that happening in regular installs. even if so, you could always download the iso again and try the install process in bios like you mentioned.
I don't really get what you're saying here. Why would the installer ask to unmount the ISO?
But anyways, I think I'm gonna do it. With the VM in UEFI. (btw, "booloader" sounds like a halloween styled thing)
Trying to install LM on thumb drive so that I can testdrive more easily (and with less lag). Thread if you wanna help out.
User avatar
AndyMH
Level 21
Level 21
Posts: 14103
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Trying to install to USB, but installer apparently has UEFI bug - Is installing to USB through BIOS VM possible?

Post by AndyMH »

And what effects will that have? I remember someone saying that then it's not possible to boot to main OS without the USB inserted, which I certainly do not want.
Partly correct, without the USB grub will load and then fail to find the / partition. Win is still available via your BIOS boot list.
Well what is the workaround?
You have two choices:
  • disconnect the main system drive before installing to the usb drive, or if this is physically difficult
  • disable the esp & boot flags on the EFI partition on the system drive. You do this with gparted before installing and re-enable the flags after install but before rebooting. gparted is the standard linux partition editor, there is a copy on your mint install iso. If you right click on your EFI partition you will see "manage flags".
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
BOplaid
Level 1
Level 1
Posts: 24
Joined: Thu Feb 08, 2024 9:24 am
Location: Iran
Contact:

Re: Trying to install to USB, but installer apparently has UEFI bug - Is installing to USB through BIOS VM possible?

Post by BOplaid »

AndyMH wrote: Mon Jul 08, 2024 6:38 am
And what effects will that have? I remember someone saying that then it's not possible to boot to main OS without the USB inserted, which I certainly do not want.
Partly correct, without the USB grub will load and then fail to find the / partition. Win is still available via your BIOS boot list.
Got it.
AndyMH wrote: Mon Jul 08, 2024 6:38 am
Well what is the workaround?
You have two choices:
  • disconnect the main system drive before installing to the usb drive, or if this is physically difficult
  • disable the esp & boot flags on the EFI partition on the system drive. You do this with gparted before installing and re-enable the flags after install but before rebooting. gparted is the standard linux partition editor, there is a copy on your mint install iso. If you right click on your EFI partition you will see "manage flags".
I knew that, I have read pbear's post. And yeah the first one is just plain not possible, as I'm pretty sure the laptop that I have has the memory directly soldered to the board. I'm not sure about this, but the laptop is crazy thin that I don't think a SATA SSD would fit in there.
And the EFI flag one? Well I don't really want to mess with the partitions. Especially the bootmanager/EFI partition. (Pretty sure the bootmanager is in the EFI in Win and the boot loader is in %SYSTEMROOT% or C: , right?)

Anyways, I tried the VM method, and it worked perfectly! At first when I installed LM to the drive, the installer in the VM (as always) asked to restart. I thought that maybe it does some post-install thing and it needs to restart? (which no, it's just to boot to it.) And I let it go. It took a long time to boot (Virtualization layer + not very good CPU + booting from USB), and after a bit I lost patience and force power off-ed the VM (VMware allows that). Then I restarted the host PC which was still in Win, held F2 (BIOS key) and then I immediately saw that there was a new option in the boot order saying UEFI: Partition 1 or something like that. I didn't bother with the boot order and went straight to the boot menu, and selected that option.

Only to panic.

The screen turned black and then immediately some text appeared in the lower right corner saying Reset system. I knew that by reset it didn't mean "factory reset", and rather it meant just a restart. But I still knew something was wrong. Panicked, I force power offed the system, and began contemplating what just happened. After a bit I did the same thing (boot to BIOS, select USB as boot menu) and the same thing happened. Reset system. But I didn't do anything and just let it sit. After 1 or 2 seconds, it automatically restarted and this time, the brand logo was just stuck on the screen for a good 5 seconds. After that some linux log appeared at the top left corner, and then the LM logo appeared. And it fully booted to the login screen just fine.

I then booted back to the BIOS to see what in the world that "Reset system" thing did, and I saw that now there were 2 boot options (besides win obviously). One literally called ubuntu and the other UEFI: Partition 1. I booted to ubuntu and it didn't say Reset system. Rather, it did the exact thing that happened after the restart in Reset system. (sit at logo for a few seconds, linux log, LM logo, boot, login screen). I also saw in the BIOS that ubuntu was higher in the boot order than windows. I thought that that Reset system thing did it. Then I booted to UEFI: Partition 1, and Reset system, reboot, sit at logo, linux log, LM logo, boot, cursor, login screen. From now on I always booted to ubuntu because... why should I boot to UEFI: Partition 1?

TL;DR: After some obstacles, it worked.
Trying to install LM on thumb drive so that I can testdrive more easily (and with less lag). Thread if you wanna help out.
BOplaid
Level 1
Level 1
Posts: 24
Joined: Thu Feb 08, 2024 9:24 am
Location: Iran
Contact:

Re: Trying to install to USB but installer apparently has UEFI bug - Is installing to USB through BIOS VM possible?

Post by BOplaid »

Uhh...

So, I was updating LM on the drive, (which took a while. why in the world were there around 200 updates?) and then at the end of it... this popped up.

Code: Select all

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-113-generic
Found initrd image: /boot/initrd.img-5.15.0-113-generic
Found linux image: /boot/vmlinuz-5.15.0-91-generic
Found initrd image: /boot/initrd.img-5.15.0-91-generic
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/sda1@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
done
Should I be worried about this? I haven't tried booting to win yet, I'm writing this on the LM USB.
And yes, I used apt update and apt upgrade, not the Update Manager.
Trying to install LM on thumb drive so that I can testdrive more easily (and with less lag). Thread if you wanna help out.
IYmEVDc
Level 3
Level 3
Posts: 173
Joined: Mon Jan 27, 2020 8:27 pm

Re: Trying to install to USB but installer apparently has UEFI bug - Is installing to USB through BIOS VM possible?

Post by IYmEVDc »

it may help if you can clarify what you think might be worrisome in that output. it looks like fairly standard output for the command update-grub that might be run at the end of a big update and upgrade like you mentioned. is it the part about os-prober and windows boot manager?
Telyx
Level 2
Level 2
Posts: 70
Joined: Sat Mar 29, 2014 7:04 pm

Re: Trying to install to USB but installer apparently has UEFI bug - Is installing to USB through BIOS VM possible?

Post by Telyx »

I recently installed Windows on a new SSD in my Dell 990 refurb, then connected my Mint SSD alongside the Windows SSD. Booted into Mint, ran the grub update so it would detect Windows, and saw that exact message. It's nothing to worry about- basically it's just telling you what it's doing and that's looking for other bootloaders in order to include them in the grub boot menu.
Post Reply

Return to “Installation & Boot”