Dual Images windows 10 and Ubuntu 16 with UEFI

Soon we will receive new PCs with UEFI support, without BIOS legacy support.
Until now we have use only BIOS legacy mode in our computers and, until now, we only install W7, but the new architectures of the computers doesn’t support this OS and we must install the new computers with W10.

Really, W10 is not the problem, I have created a new image with this OS, UEFI and GPT partitions. My problem is when I need create a dual image, Ubuntu 16 with W10 under UEFI and GPT partitions.

I have install W10 with UEFI (secure boot disable), after this I have installed Ubuntu 16. I need repair the boot under Ubuntu with boot repair tool. Then, I have dual boot: Ubuntu and W10. It works fine.

with this config I can deploy this dual image to another PC but the boot doesn’t work fine. I can only boot from windows 10, the GRUB have desappeared :( I need to repair again the GRUB wiht th boot repair tool.

@sebastian-roth I have deployed the dual image to a different machine and … surprise! You are right, the machine boot directly under W10, in the next appears the grub and the posibility to boot under Ubuntu.

I have found a link about NVRAM, I suppose that will be a lot of them but was the first entry in google :) :

1- What all information is stored in UEFI VARIABLES?
All configuration setup, vendor information, language information, input/output console, error console, and boot order setting all these information are stored in these variables
2- How to get NVRAM variables
You can use UEFI bootable USB to boot the server. You need to have supported files which can give you UEFI shell once server boot from USB. Once you got the UEFI shell you can run UEFI command "dmpstore" to see the variable available in NVRAM. For more options or help just type “? dmpstore”. If you have Linux installed before in same server in UEFI mode. You can access the EFI partition. Give this command in UEFI shell "FS0:" Now your “/boot/efi “partition is mounted. You can see the content of this volume using ls/dir command. "dmpstore -all > myvariables" will collect all NVRAM variable to EFI partition. When you reboot your Linux box you will see this file in your /boot/efi location.
3- Analysis of variables
You will see lot of entries in the dump file. Variable name, access, data and many more. We will use this example:
Variable NV+RT+BS 'Efi:ConOut' DataSize = 36
This tells that Variable name is Console output which data size is 0X36 in HEX
. This variable is available at runtime (RT) and boot time (BS).
Runtime variable which are available after OS booted and boot time which are available before
OS boot.
4- Mapping of UEFI variables from BIOS to Linux OS.
You can see all these variables are mapped from Linux OS.UEFI variables are mapped through sys entry. Just see to this location /sys/firmware/efi/efivars . It will have all variables which was available in dump file.
All these variables depend on efivarfs kernel modules. If this module is not available you cannot access the variables. It is mounted as efivarfs file system on /sys/firmware/efi/efivars.
Parmeshwr_Prasad
Linux Engineer
Dell Inc (Bangalore)```

So the only solid solution is running that command in the windows environment. I was under the impression that the command altered something in the media that would be captured by FOG. So possibly a better solution would be to execute that bcdedit command via a FOG snapin.

I think only time will tell of this “hack” is forever or until the next reboot.

From my point of view the “hack” should be persistent (at least till the next major Windows update but maybe even beyond that) on that very same machine because bcdedit adds the entry to the NVRAM. But this is not what we transfer to other machines when we capture and deploy and image from/to disk…

@fernando-gietz Just for clarity and those who will be doing the same as you: Did you run that command before you recaptured the reference image, or did you add that bcdedit command to the setupcomplete.cmd file?

@quazz Great point!. I have another thread where I’m collecting drive geometry to help the devs understand what typical drive configurations look like. I ran into an issue where I wasn’t able to mount partitions of 2 of my home computers that are win10 EFI systems. I thought something changed in the Fall 2017 creators update to where FOS couldn’t mount the disk. Long story short is was the fast boot that was leaving the partitions marked as mounted and now allowing FOS to remount the partitions.

After I was clued in by Sebastian I turned off fast boot and was able to mount and map the partitions. Very annoying that feature is. Thank you, M$.

@fernando-gietz Does it consistently work after using George’s command? (even if you shutdown and do a ‘cold boot’?)

My theory is that if you have Windows 10 Fast Boot enabled it will skip that bootloader and boot straight to Windows, however that only happens if you shutdown -> boot as opposed to reboot. Windows 10 Fast Boot does a lot of annoying stuff like make it very hard (or impossible on certain devices) to get into BIOS during boot.

@sebastian-roth I don’t know very much about UEFI, until now the hardware had legacy support and we worked in this mode. But, the new hardware which is coming only support UEFI, then we need to learn to work under this new mode :( Thanks for the link, I will read it … what a pain!!!

I am not using the new hardware, I don’t know which will be, and to test the UEFI I am using HP 800 G2 eliteDesk. This hardware have compatibility with BIOS legacy.

So here we go. The boot order/list in real native UEFI systems is not on disk. So far we don’t capture the NVRAM state of a machine as far as I know. This is definitely something we need to add to the todo list. On Windows only systems it’s probably working out fine most times so we don’t see an issue. But for UEFI dual booting systems we need to find a solution.

So here we go. The boot order/list in real native UEFI systems is not on disk. So far we don’t capture the NVRAM state of a machine as far as I know. This is definitely something we need to add to the todo list. On Windows only systems it’s probably working out fine most times so we don’t see an issue. But for UEFI dual booting systems we need to find a solution.