Soo… Apologies if this is in the wrong place. Still new and unfamiliar to Lemmy. 😊 I could not find a specific vm community, so chat is hopefully ok? Posting this with Jerboa on iusearchlinux.fyi (hopefully?)

I have an issue with booting a windows vm from a physical drive and I hope this community might be able to help.

I run arch on my desktop where I have 2 nvme drives. One with Linux and the other with win10. This us the first time I am using systemd-boot for dual boot setup. I normally use grub but this I went with systemd. Possibly a mistake…

I have used these drives and the win10 install with several Linux installs over the years on this motherboard. Both as a dual boot, but also for vfio virtual machine. This works like a charm. But not this time… Dual boot works great, but the vm boot is not working atm.

I normally pass the entire windows drive to qemu, pass the spare Nvidia card and if we go. Usually controlled with looking-glass. It’s sweet and work like a charm.

But for some reason I cannot boot the windows drive like this anymore. I suspect systemd-boot does something but I am not familiar enough to tell for sure.

Anyone with a similar setup with a success story to share? Is this possible with systemd? Or is my best bet to go back to grub?

Cheers all!

  • Alfaspyke@iusearchlinux.fyiOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Yes that’s basically it. But the vfio can be ignored for now because currently the windows install cannot be booted from libvirtd. I will deal with gpu passthrough and performance later. No error messages from libvirtd while booting the windows instance, I get dropped to a standard efi shell. Does systemd-boot do something extra with the boot sectors when booting from separate drives in dual boot?

    Any thoughts you have to share on this is highly appreciated

    • Flaky@iusearchlinux.fyi
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      I don’t think so. In fact, I’m not sure if systemd-boot should even be doing anything here. Did you configure anything different between GRUB and systemd-boot - e.g. the PCI IDs to passthrough?

      • Alfaspyke@iusearchlinux.fyiOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Not on purpose.

        As far as I know I have done the same as always when setting up these things. Only variation is updated Arch and systemd as boot manager

        Tech details.

        • The disk lives on pcie 03:00 and I pass this as a pci passthrough in virt-manager
        • The drive has 3 partitions: EFI, data “C:”, boot
        • Booting with this gets me the tianocore bootscreen and then dropped into UEFI interactive shell.
        • This shell has 4 entries. BLK0, BLK1, BLK2 and BLK3

        I am guessing the 4th one is unallocated space?

        But if systemd-boot shouldnt play into this at all I guess my problem lies elsewhere.

        Are you familiar with UEFI shell?

        The mapping looks strange https://imgur.com/MEOJU7m.png

        Shouldnt it say something about harddisk or blockdevice instead of just PciRoot?

        BLK1 to BLK3 are marked with gpt so appears to be partition info, but who knows.

        I might need to read up on uefi shell

        Anyway, typing exit in this shell gives the tianocore EFI menus.

        Here I can selct language, device manager, boot manager and boot maintenance manager.

        Selecting boot manager gives the option to select the actual Samsung drive to boot from, but nothing happens when I do this. The screen flashes once as if it tries to start something, gives up and goes back to the menu.

        • Flaky@iusearchlinux.fyi
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          While I don’t have that much experience with EFI Shell, that doesn’t look out of place. It’s showing the partitions just fine. Though seeing as you keep getting landed in the shell, it’s like it can’t see the contents of the ESP or something like that.

          Did you install Windows or set up the VM with Secure Boot? I think I had this or something very similar when I installed Windows on OVMF firmware that had Secure Boot.

          • Alfaspyke@iusearchlinux.fyiOP
            link
            fedilink
            English
            arrow-up
            0
            ·
            1 year ago

            I will have to check if secure boot is involved somehow. It’s not activated on purpose but who knows.

            The uefi shell shows no files or directories in any of the partitions available so you might be correct.

            • Flaky@iusearchlinux.fyi
              link
              fedilink
              English
              arrow-up
              2
              ·
              1 year ago

              Try browsing your Windows EFI partition on the Linux host, you should be able to with the VM switched off. If it’s blanked out or Linux complains, it might be an issue with the partition itself.

              • Alfaspyke@iusearchlinux.fyiOP
                link
                fedilink
                English
                arrow-up
                2
                ·
                1 year ago

                A breakthrough!! I could not find the efi information on the partition it should be on the windows disk This is a major hint. The efi partition on this disk was empty. The efi partition lives on the Linux disk and will happily boot both Linux and windows. I cannot recall moving it from the windows disk manually. So there is still something to dig into here.

                No wonder my virtual machine could not boot properly…

                Thank you very much for sparring with me in this topic. It is solved now, sort of. I still need to actually fix it, but the solution is ready.

                Check your partitions folks! They might not be where you think they are.

                🥳

                • Flaky@iusearchlinux.fyi
                  link
                  fedilink
                  English
                  arrow-up
                  2
                  ·
                  1 year ago

                  Yay! Glad to see the issue’s solved. You actually reminded me - yeah, Windows and I believe macOS too will just leech off whatever EFI partition it can find. I’ve had EFI partitions on data drives for whatever reason that they’ll just use. Part of why when I’ll install an OS on bare metal, I’ll disable everything but the drive being used (granted that’s probably harder on some motherboards).