hakuna-m / wubiuefi

fork of Wubi (https://launchpad.net/wubi) for UEFI support and for support of recent Ubuntu releases
GNU General Public License v2.0
1.07k stars 152 forks source link

An error has occured reading the existing display boot order problem in HP systems. #286

Closed rounk-ctrl closed 3 years ago

rounk-ctrl commented 3 years ago

image


08-19 17:00 DEBUG  WindowsBackend: efi_arch=x64
08-19 17:00 ERROR  TaskList: Error executing command
>>command=C:\WINDOWS\sysnative\bcdedit.exe /copy {bootmgr} /d Ubuntu
>>retval=1
>>stderr=An error has occurred reading the existing display order.

Element not found.

>>stdout=
Traceback (most recent call last):
  File "\lib\wubi\backends\common\tasklist.py", line 197, in __call__
  File "\lib\wubi\backends\win32\backend.py", line 818, in modify_bcd
  File "\lib\wubi\backends\common\utils.py", line 68, in run_command
Exception: Error executing command
>>command=C:\WINDOWS\sysnative\bcdedit.exe /copy {bootmgr} /d Ubuntu
>>retval=1
>>stderr=An error has occurred reading the existing display order.

Element not found.

>>stdout=
08-19 17:00 DEBUG  TaskList: # Cancelling tasklist
08-19 17:00 DEBUG  TaskList: New task modify_bcd
08-19 17:00 ERROR  root: Error executing command
>>command=C:\WINDOWS\sysnative\bcdedit.exe /copy {bootmgr} /d Ubuntu
>>retval=1
>>stderr=An error has occurred reading the existing display order.

Element not found.

>>stdout=
Traceback (most recent call last):
  File "\lib\wubi\application.py", line 58, in run
  File "\lib\wubi\application.py", line 132, in select_task
  File "\lib\wubi\application.py", line 158, in run_installer
  File "\lib\wubi\backends\common\tasklist.py", line 197, in __call__
  File "\lib\wubi\backends\win32\backend.py", line 818, in modify_bcd
  File "\lib\wubi\backends\common\utils.py", line 68, in run_command
Exception: Error executing command
>>command=C:\WINDOWS\sysnative\bcdedit.exe /copy {bootmgr} /d Ubuntu
>>retval=1
>>stderr=An error has occurred reading the existing display order.

Element not found.

>>stdout=
08-19 17:00 DEBUG  TaskList: ## Finished modify_bootloader
08-19 17:00 DEBUG  TaskList: # Finished tasklist
08-19 17:01 INFO   root: === wubi 20.04.2.0 rev342 ===```
hakuna-m commented 3 years ago

Wubi(uefi) uses Windows command bcdedit to change menu entries.

So it is necessary to analyze the view of your menu entries with bcdedit.

  1. Start command prompt as administrator with e.g the following method:
  1. Type bcdedit /enum all

  2. Copy the result to your next comment. Especially, the menu entry for {bootmgr} should be important for your issue.

rounk-ctrl commented 3 years ago


Firmware Boot Manager
---------------------
identifier              {fwbootmgr}
timeout                 0

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume3
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-GB
inherit                 {globalsettings}
integrityservices       Enable
default                 {current}
resumeobject            {13d0f7d5-d9a7-11eb-bb8a-fc3fdb8ea19f}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {13d0f7d3-d9a7-11eb-bb8a-fc3fdb8ea19f}
device                  ramdisk=[C:]\Recovery\WindowsRE\Winre.wim,{13d0f7d4-d9a7-11eb-bb8a-fc3fdb8ea19f}
path                    \windows\system32\winload.efi
description             Windows Recovery Environment
locale                  en-US
inherit                 {bootloadersettings}
displaymessage          Recovery
osdevice                ramdisk=[C:]\Recovery\WindowsRE\Winre.wim,{13d0f7d4-d9a7-11eb-bb8a-fc3fdb8ea19f}
systemroot              \windows
nx                      OptIn
bootmenupolicy          Standard
winpe                   Yes

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \WINDOWS\system32\winload.efi
description             Windows 11
locale                  en-GB
inherit                 {bootloadersettings}
recoverysequence        {13d0f7d8-d9a7-11eb-bb8a-fc3fdb8ea19f}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
flightsigning           Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \WINDOWS
resumeobject            {13d0f7d5-d9a7-11eb-bb8a-fc3fdb8ea19f}
nx                      OptIn
bootmenupolicy          Standard
hypervisorlaunchtype    Off

Windows Boot Loader
-------------------
identifier              {13d0f7d8-d9a7-11eb-bb8a-fc3fdb8ea19f}
device                  ramdisk=[\Device\HarddiskVolume2]\Recovery\WindowsRE\Winre.wim,{13d0f7d9-d9a7-11eb-bb8a-fc3fdb8ea19f}
path                    \windows\system32\winload.efi
description             Windows Recovery Environment
locale                  en-US
inherit                 {bootloadersettings}
displaymessage          Recovery
osdevice                ramdisk=[\Device\HarddiskVolume2]\Recovery\WindowsRE\Winre.wim,{13d0f7d9-d9a7-11eb-bb8a-fc3fdb8ea19f}
systemroot              \windows
nx                      OptIn
bootmenupolicy          Standard
winpe                   Yes

Resume from Hibernate
---------------------
identifier              {13d0f7d5-d9a7-11eb-bb8a-fc3fdb8ea19f}
device                  partition=C:
path                    \WINDOWS\system32\winresume.efi
description             Windows Resume Application
locale                  en-GB
inherit                 {resumeloadersettings}
recoverysequence        {13d0f7d8-d9a7-11eb-bb8a-fc3fdb8ea19f}
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
filedevice              partition=C:
custom:21000026         partition=C:
filepath                \hiberfil.sys
bootmenupolicy          Standard
debugoptionenabled      No

Windows Memory Tester
---------------------
identifier              {memdiag}
device                  partition=\Device\HarddiskVolume3
path                    \EFI\Microsoft\Boot\memtest.efi
description             Windows Memory Diagnostic
locale                  en-GB
inherit                 {globalsettings}
badmemoryaccess         Yes

EMS Settings
------------
identifier              {emssettings}
bootems                 No

Debugger Settings
-----------------
identifier              {dbgsettings}
debugtype               Local

RAM Defects
-----------
identifier              {badmemory}

Global Settings
---------------
identifier              {globalsettings}
inherit                 {dbgsettings}
                        {emssettings}
                        {badmemory}

Boot Loader Settings
--------------------
identifier              {bootloadersettings}
inherit                 {globalsettings}
                        {hypervisorsettings}

Hypervisor Settings
-------------------
identifier              {hypervisorsettings}
hypervisordebugtype     Serial
hypervisordebugport     1
hypervisorbaudrate      115200

Resume Loader Settings
----------------------
identifier              {resumeloadersettings}
inherit                 {globalsettings}

Device options
--------------
identifier              {13d0f7d4-d9a7-11eb-bb8a-fc3fdb8ea19f}
description             Windows Recovery
ramdisksdidevice        partition=C:
ramdisksdipath          \Recovery\WindowsRE\boot.sdi

Device options
--------------
identifier              {13d0f7d9-d9a7-11eb-bb8a-fc3fdb8ea19f}
description             Windows Recovery
ramdisksdidevice        partition=\Device\HarddiskVolume2
ramdisksdipath          \Recovery\WindowsRE\boot.sdi
hakuna-m commented 3 years ago

IMHO, your issue is that the firmware (UEFI) boot manager contains no default menu entry.

Firmware Boot Manager
---------------------
identifier              {fwbootmgr}
timeout                 0

....should contain at least {bootmgr}.....

Firmware Boot Manager
---------------------
identifier              {fwbootmgr}
displayorder            {bootmgr}
timeout                 0

It should be possible that you add that menu entry with

bcdedit /set {fwbootmgr} displayorder {bootmgr} /addfirst

Is your BCD configuration the result of a fresh install of Windows 11 or is it the result of upgrades and changes ?

If it is the default configuration of a lot of Windows 11 systems and the bcdedit command above fixes it, we should add that command to Wubiuefi.

rounk-ctrl commented 3 years ago

Is your BCD configuration the result of a fresh install of Windows 11 or is it the result of upgrades and changes ?

well i did use mbr2gpt to convert from legacy to UEFI so there's that I think its because of that.

hakuna-m commented 3 years ago

Well, I assume that mbr2gpt did not create a standard configuration. Of course, the configuration works if you do not need UEFI boot manager because there is only one boot option for Windows.

But Wubiuefi needs UEFI boot manager that you can select Ubuntu after install. The result after the changes of Wubiuefi is someting like that

Wubiuefi creates a second "Windows Boot Manager" for Ubuntu and adds that entry to "Firmware Boot Manger". It sets also timeout from 0 to 10 hoping that every firmware displays boot menu for 10 seconds.......

So you only need the additional line in section "Firmware Boot Manager":

displayorder {bootmgr}

As I wrote in a previous comment, you can use bcdedit to add that entry:

bcdedit /set {fwbootmgr} displayorder {bootmgr} /addfirst

rounk-ctrl commented 3 years ago

image ok so it worked.