0

Hello Stack Overflow Community, I'm encountering a recurring problem where Windows 11 becomes unbootable after I install Ubuntu alongside it using a custom autoinstall.yaml file. Despite careful configuration to preserve the Windows partitions, each time I perform the installation, the issue persists.

Here's what happens: After the Ubuntu installation completes, I attempt to boot into Windows 11. Instead of successfully booting, the system hangs indefinitely with the Windows loading circle. It appears the boot process initiates but never completes, suggesting a possible corruption or misconfiguration in the boot loader or the EFI partition.

I've checked the partition integrity and configurations, and everything seems in order, with no partitions deleted or formatted unintentionally. Here's the content of my autoinstall.yaml file that I'm using for the Ubuntu installation:

#cloud-config
autoinstall:
  version: 1
  locale: en_US
  storage:
    grub:
      reorder_uefi: False
    config:
      - type: disk                   # Always install OS on our largest SSD disk
        match:
          size: largest              # Select the largest available SSD
          ssd: true
        id: os-drive
        ptable: gpt
        preserve: true
        name: ''
        grub_device: false
      - type: partition              # Preserve an EFI partition /boot/efi
        number: 1
        id: efi-partition
        device: os-drive
        size: 100M
        flag: boot
        grub_device: true            # This is the primary boot device
        preserve: true
      - type: format                 # Format the EFI partition with FAT32
        id: efi-format
        volume: efi-partition
        fstype: fat32
        label: ESP
        preserve: true
      - path: /boot/efi              # Mount the EFI partition
        device: efi-format
        type: mount
        id: mount-efi
      - type: partition              # Preserve the existing Microsoft Reserved Partition
        number: 2                     # Partition number for MSR (assuming it's the second partition)
        id: msr-partition
        device: os-drive
        flag: msftres                # Flag to indicate it's a Microsoft Reserved Partition
        preserve: true
        size: 16M
      - type: partition              # NTFS
        number: 3
        id: part1
        device: os-drive
        size: 319325M
        grub_device: false
        preserve: true
      - type: partition              # Create a BOOT partition /boot
        number: 4
        id: boot-partition
        device: os-drive
        size: 1G
        grub_device: false
        preserve: false
      - type: format                 # Format the BOOT partition with ext4
        id: boot-format
        volume: boot-partition
        fstype: ext4
        label: BOOT
        preserve: false
      - path: /boot                  # Mount the BOOT partition
        device: boot-format
        type: mount
        id: mount-boot
      - type: partition              # Create an LVM partition (PV)
        number: 5
        id: lvm-partition
        device: os-drive
        size: -1                     # Use all remaining space for LVM
        grub_device: false
        preserve: false
      - type: dm_crypt
        preserve: false
        volume: lvm-partition
        id: dm_crypt-0
        key: "key"
        dm_name: crypto
      - type: lvm_volgroup
        preserve: false
        id: lvm_volgroup-0
        devices:
          - dm_crypt-0
        name: system
      - name: root                   # Create LVM Logical Volume (root)
        preserve: false
        volgroup: lvm_volgroup-0
        size: 16G
        wipe: superblock
        type: lvm_partition
        id: lvm_partition-root
      - fstype: xfs 
        preserve: false
        volume: lvm_partition-root
        type: format
        id: format-root
      - path: /                      # Mount the root LV
        device: format-root
        type: mount
        id: mount-root
      - name: home                   # Create LVM Logical Volume (home)
        volgroup: lvm_volgroup-0     # Using the same volume group as the root
        size: -1                     # Use all remaining space in the volume group
        wipe: superblock             # Ensure the volume is clean before use
        preserve: false
        type: lvm_partition
        id: lvm_partition-home
      - fstype: xfs
        volume: lvm_partition-home
        preserve: false
        type: format
        id: format-home
      - path: /home                  # Mount the home LV
        device: format-home
        type: mount
        id: mount-home
    swap:
      swap: 4G                        # Allocate 4 GB for swap space

  # Installs the default ubuntu-desktop packages.
  # You can add additional packages if required.
  packages:
    - ubuntu-desktop

  # Sets up SSH server and authorizes a key for remote access.
  ssh:
    install-server: true
    authorized-keys: 
      - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIXzBWhyNmrpXT9yN+RgAyS1mQ6tapm3G80Znp2Q9I6oAVNrKOB5BVazb7X3e7atNMXQgm6QQYsMZzoii+DSHgrmgHQ160vihtsvwmFFRxHb8fsmo0+9cH/lMoDhxWIk+Q9bLe+bqcGxAywD3EO1qgytUcmTOPjFIDyuU+cngb9TWvhJosZaZ0J8CwfzlJAYyItD0IP7fTqlUl079UU3lkU19DC3ocX+nx0q0glofnhCeSTll12H+BuPTMcPW9AKezkk8rgHlT0F8awGXmUfDj2tBFcCPrS1uyAJILU5iLKTc1oeELsIZFeUuSDNu2px+L8EKbhcnGWnbu3j5BSbHX [email protected]

  # User setup
  identity:
    username: nox
    password: $6$Jd6zyTUa/TGBXgtd$cOJ8pWsZxaKDU1SAo6qX32AMtH3WRIBTqIEbBvAmJGcQ7i.kmr5IkMUuuclWjpNVw9jmkUJfaLhe0j3m1TNeE/
    hostname: nox-home-laptop

  late-commands:
    # Configures GRUB for a quiet splash screen on boot.
    - curtin in-target -- sed -i /etc/default/grub -e 's/GRUB_CMDLINE_LINUX_DEFAULT=".*/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"/'
    - curtin in-target -- update-grub
    

I'm wondering if anyone else has encountered this problem and how you resolved it. Specifically, I need to know:

Any common mistakes in the configuration that might affect the Windows boot loader.
Tips for ensuring that the GRUB and Windows Boot Manager can coexist without issues.

Any advice or guidance would be greatly appreciated!

Additionally, here is the output of lsblk which shows the current partition layout on my system:

ox@nox-home-laptop:~$ lsblk -f
NAME              FSTYPE      FSVER    LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
loop0             squashfs    4.0                                                         0   100% /snap/bare/5
loop1             squashfs    4.0                                                         0   100% /snap/core22/1380
loop2             squashfs    4.0                                                         0   100% /snap/firefox/4173
loop3             squashfs    4.0                                                         0   100% /snap/firmware-updater/127
loop4             squashfs    4.0                                                         0   100% /snap/gnome-42-2204/176
loop5             squashfs    4.0                                                         0   100% /snap/snap-store/1124
loop6             squashfs    4.0                                                         0   100% /snap/gtk-common-themes/1535
loop7             squashfs    4.0                                                         0   100% /snap/snapd/21465
loop8             squashfs    4.0                                                         0   100% /snap/snapd-desktop-integration/157
nvme0n1                                                                                            
├─nvme0n1p1       vfat        FAT32          2C42-63E8                                63.6M    34% /boot/efi
├─nvme0n1p2       ext4        1.0      BOOT  fc32e31d-d5f7-4274-b042-d5c43cb2ffa4                  
├─nvme0n1p3       ntfs                       E0822C78822C5576                                      
├─nvme0n1p4       ext4        1.0      BOOT  f45bcb02-c9a5-4702-ba9e-b78afe7a80b9    805.4M    10% /boot
└─nvme0n1p5       crypto_LUKS 2              0c1c84b3-3d41-49d2-b60f-ac06d0802ab6                  
  └─crypto        LVM2_member LVM2 001       QHzgdx-09hy-C1bz-QXwh-FJ5k-oHKX-u1zNxq                
    ├─system-root xfs                        9c32585f-fc83-44f3-88ab-bb61dd613006     10.2G    36% /var/snap/firefox/common/host-hunspell
    │                                                                                              /
    └─system-home xfs                        4f1b56b2-6b44-4592-8b00-3996f3d7abbc    612.5G     2% /home
nox@nox-home-laptop:~$ 

1

0

You must log in to answer this question.

Browse other questions tagged .