Providing installation media via pxe booting for UEFI systems.
-
Hi,
My goal is to allow the users to do a fresh installation of their desired Linux distro directly from the FOG menu. (Users don’t have access to FOG credentials). I want to learn how to build these installation media so that FOG can use them.
This post explains how to create favourite installer images for legacy systems. I want to know if the same thing can be achieved for UEFI systems and newer Ubuntu Desktop versions such as 22.04.
On the Canonical page, they provide some guidance on the netbooting can be achieved in the newer releases but I can’t translate that to something that FOG could use. Can someone explain if that is possible?
-
@mashina I guess you will need to decide your best method for deploying these linux distros to the target computer.
- As in the referenced post netboot into the native linux distro installer and install linux that way.
- Create a standard image and capture that standard image for the user’s to deploy.
The method you use is really dependent on the skill of the user that will install linux. Both methods have their advantages. With option 1 you get the most flexability, but also requires more technical skills on the user. Option 2 you can create a custom linux install with all of the required apps preinstalled.
-
Thanks for your response.
I’ve explored various FOG capturing methods without success. The complexity led me to consider using installation media. Here’s a summary of my goal:
- Default: Windows 11 on disk one (nvme0n1).
- Users occasionally need Linux on the second disk.
- Users should be able to delete the Linux drive later while keeping Windows on disk one intact.
So the main challenge at this moment is having Windows and Linux coexist. When I deploy a Linux (from a disk image - Single disk - Everything) to disk2, the system doesn’t boot the Linux, possibly due to the EFI partition on disk1 lacking the necessary boot entries. To address this, I captured our Windows 11 image (single disk- Everything) after I had deployed Linux, ensuring the EFI partition had the required entries. The results were the same. The Linux doesn’t appear in the UEFI firmware as a boot entry. (Our new computers have only UEFI)
So, I thought using an installation media might fix the bootloader issue. But before testing, I’m curious to know what will happen when we delete the Linux disk.
The funny thing is that our older FOG server is handling all the requirements I mentioned above perfectly. The differences are that the default image is a Windows 10 and the client computers have BIOS.
Any insights on achieving this would be greatly appreciated.
-
@mashina Running this dual boot environment is always a pain to manage. Its probably best/quickest to do this with a virtual machine.
I know this will look like a lot of steps to test out an idea, but if it works then it will also help you with your deployment workflow.
So how I would go about trying to figure this out is to go ahead and deploy/create windows 11 to disk 0 on your mother computer and capture that with FOG single disk resizable.
Now deploy/create linux to your mother computer and capture that with FOG using single disk resizable. This may/will overwrite the windows 11 install with linux on the mother computer.
So what you will have is 2 images (1 Windows and 1 Linux) both captured from disk 0. This will be a complete and bootable image with the efi partition intact.
Now create a target computer (VM) with 2 hard drives. Register that target computer with FOG, and set the target disk to disk 0 (/dev/sda for a sata disk or the nvme disk name for a nvme drive) in the host configuration. Now deploy the windows image to this target computer. Once the deployment is done, verify the computer boots. Go into the fog ui and the host configuration for this target computer, and change the target disk to disk 1 (/dev/sdb). Deploy the linux OS to disk 2. Note: there are other ways to go about this but the goal is to have 2 hard drives with a complete OS with UEFI partition on each disk.
Now that you have the groundwork in place, go into the target computer’s uefi firmware. The uefi firmware should see both disks with valid uefi bootable disks on it. If you made it this far and the firmware can see both disks as uefi bootable, then exit out of the firmware setup and reboot the computer. The next step is to access the target computer’s uefi boot manager. On Dell computers you keep pressing hit the F12 key quickly as soon as you see the Dell logo. In the uefi boot manger you should be able to pick windows 11 or linux boot disk. Test both operating systems. If you can boot both without issue then you are 90% of the way done.
The next decision is how you want the user to select which OS to boot.
- The UEFI firmware boot manager via F12 key
- The windows boot manager
- The linux boot manager (grub)
- If you PXE boot through FOG, you can create a boot menu using refind (FOG’s UEFI exit boot manager)
Now on the workflow moving forward. The target computer’s configuration still points to disk 1 for all new image deployment. So any new images will be deployed to disk 1 (remember that windows is on disk 0). So if you have it setup the user can pick any OS images from the list and they will always be deployed to disk 1 (the transient disk) without touching the windows boot image.
-
This post is deleted! -
Thank you for the clear explanation. I have successfully deployed the images as I intended and have gained some understanding of the process.
I have a question regarding the current situation: when I attempt to boot Ubuntu for the first time (by selecting it from the UEFI boot menu using F9 on the HP machine), I encounter a “Reset System” message and the machine reboots. However, upon reboot, it successfully boots into Ubuntu. Is this behaviour normal?
-
@mashina said in Providing installation media via pxe booting for UEFI systems.:
I encounter a “Reset System” message and the machine reboots
I can say I’ve never seen this before. When you see this message what is the default boot device? Is it the hard drive or PXE booting. Its not clear if its the UEFI firmware or iPXE/rEFInd (fog’s boot loader) that is throwing this error.
This is only a guess, but I might think it the uefi firmware saying “hey something changed from the last boot” should I fix up the boot settings with the new information?
It would be interesting to know if you reimaged the target computer again with the same FOG image would you also get that message, or do you only get the message when you change image formats (i.e. Windows was previously the boot image and now its ubuntu?)
-
@george1421 Hello again,
The issue arises solely when Windows is on disk0 and Ubuntu is deployed on disk1. Hence, I believe your assessment is accurate. It’s possible that UEFI is readjusting itself due to these modifications.
Interestingly, the problem doesn’t occur when Ubuntu is already present, and then Windows is deployed. Anyway, that is not a big problem at this moment.
There’s another problem.
Your suggestion works well for putting Linux on Disk1, but if the user needs to reinstall Windows, it’ll also go to /dev/nvme1n1, messing everything up
Any suggestions?
-
@mashina said in Providing installation media via pxe booting for UEFI systems.:
Interestingly, the problem doesn’t occur when Ubuntu is already present, and then Windows is deployed. Anyway, that is not a big problem at this moment.
But in this case the uefi firmware has already registered ubuntu as a bootable OS. So it just goes, oh hello I see you again on disk1. But if the entry doesn’t exist then it needs to be fixed up. You might be able to test this on a working system, go into the uefi firmware and delete the entry for ubuntu on the second disk, only leaving windows in the uefi boot manager. Upon reboot does it need to fix itself up again?
Just be aware that FOG doesn’t touch the uefi firmware or boot manager. BUT you can do that with in a FOG post install script and using the linux uefi manager (not the actual name) app. You can add remove uefi boot manager entries at your need.
Your suggestion works well for putting Linux on Disk1, but if the user needs to reinstall Windows, it’ll also go to /dev/nvme1n1, messing everything up
True it will mess everything up. But also I took your inital post as you will load windows once and then could potentially reload ubuntu or the OS on the second drive multiple times. If you “had to” you could write a FOG preinstall script to ask what drive do you want to send the image too, but that gets a bit messy, but its possible.