Skip to main content
added 224 characters in body
Source Link

I've ran a few operating systems installed for dual-boot side-by-side with QEMU residing on disks, but I don't think ever one without a bootloader.

If you're booting with UEFI, you will need to use OVMF for QEMU, which means things have gotten much hairier and out of the scope of my knowledge.

Try installing & configuring GRUB on the Windows partition, or booting a Windows rescue/install media with QEMU (otherwise, Windows will eat GRUB) and reinstalling to get a Windows bootloader back. To install GRUB, use grub-install /dev/sdxY, mount the filesystem, and run grub-mkconfig -o /mnt/grub/grub.cfg. Then, copy over just what you need from your existing grub.cfg, and edit it as necessary -- feel free to ask for help in this thread.

Another option is doing some research on just installing a bootloader natively on Windows.

The nuclear option is to movesomething along the lines of creating an .img file the same size as your Windows filesystempartition with qemu-img, reinstalling Windows via QEMU to that file, and copying everything after a certain offset from the partition (probably just past the first 1024 cylinders or so) to the .img file with something like dd.

A very dangerous option is to continue using your existing GRUB to chain-boot into windows by using all of your disks with the read-only option. See @telcoM's comment on the OP; DO NOT RUN A VIRTUAL MACHINE ON A DISK THAT IS IN-USE BY THE HOST! THE FILESYSTEM WILL BE CORRUPTED AND UNRECOVERABLE! (ONLY unless it's used read-only by the guest.) Try qemu-xxxxxxx -drive file=/dev/sdxX,format=raw,readonly.

Nonetheless, QEMU can run a raw disk:

qemu-xxxxxxxx -drive file=/dev/sdxY,format=raw (see man 1 qemu & search for -drive for more information).

If you haven't much experience with QEMU/KVM, running & configuring it directly from the command-line can be intimidating and frustrating -- consider a front-end for your health.

I've ran a few operating systems installed for dual-boot side-by-side with QEMU residing on disks, but I don't think ever one without a bootloader.

If you're booting with UEFI, you will need to use OVMF for QEMU, which means things have gotten much hairier and out of the scope of my knowledge.

Try installing & configuring GRUB on the Windows partition, or booting a Windows rescue/install media with QEMU (otherwise, Windows will eat GRUB) and reinstalling to get a Windows bootloader back. To install GRUB, use grub-install /dev/sdxY, mount the filesystem, and run grub-mkconfig -o /mnt/grub/grub.cfg. Then, copy over just what you need from your existing grub.cfg, and edit it as necessary -- feel free to ask for help in this thread.

Another option is doing some research on just installing a bootloader natively on Windows.

The nuclear option is to move the Windows filesystem to a .img file with something like dd.

A very dangerous option is to continue using your existing GRUB to chain-boot into windows by using all of your disks with the read-only option. See @telcoM's comment on the OP; DO NOT RUN A VIRTUAL MACHINE ON A DISK THAT IS IN-USE BY THE HOST! THE FILESYSTEM WILL BE CORRUPTED AND UNRECOVERABLE! (ONLY unless it's used read-only by the guest.) Try qemu-xxxxxxx -drive file=/dev/sdxX,format=raw,readonly.

Nonetheless, QEMU can run a raw disk:

qemu-xxxxxxxx -drive file=/dev/sdxY,format=raw (see man 1 qemu & search for -drive for more information).

If you haven't much experience with QEMU/KVM, running & configuring it directly from the command-line can be intimidating and frustrating -- consider a front-end for your health.

I've ran a few operating systems installed for dual-boot side-by-side with QEMU residing on disks, but I don't think ever one without a bootloader.

If you're booting with UEFI, you will need to use OVMF for QEMU, which means things have gotten much hairier and out of the scope of my knowledge.

Try installing & configuring GRUB on the Windows partition, or booting a Windows rescue/install media with QEMU (otherwise, Windows will eat GRUB) and reinstalling to get a Windows bootloader back. To install GRUB, use grub-install /dev/sdxY, mount the filesystem, and run grub-mkconfig -o /mnt/grub/grub.cfg. Then, copy over just what you need from your existing grub.cfg, and edit it as necessary -- feel free to ask for help in this thread.

Another option is doing some research on just installing a bootloader natively on Windows.

The nuclear option is something along the lines of creating an .img file the same size as your Windows partition with qemu-img, reinstalling Windows via QEMU to that file, and copying everything after a certain offset from the partition (probably just past the first 1024 cylinders or so) to the .img file with dd.

A very dangerous option is to continue using your existing GRUB to chain-boot into windows by using all of your disks with the read-only option. See @telcoM's comment on the OP; DO NOT RUN A VIRTUAL MACHINE ON A DISK THAT IS IN-USE BY THE HOST! THE FILESYSTEM WILL BE CORRUPTED AND UNRECOVERABLE! (ONLY unless it's used read-only by the guest.) Try qemu-xxxxxxx -drive file=/dev/sdxX,format=raw,readonly.

Nonetheless, QEMU can run a raw disk:

qemu-xxxxxxxx -drive file=/dev/sdxY,format=raw (see man 1 qemu & search for -drive for more information).

If you haven't much experience with QEMU/KVM, running & configuring it directly from the command-line can be intimidating and frustrating -- consider a front-end for your health.

Source Link

I've ran a few operating systems installed for dual-boot side-by-side with QEMU residing on disks, but I don't think ever one without a bootloader.

If you're booting with UEFI, you will need to use OVMF for QEMU, which means things have gotten much hairier and out of the scope of my knowledge.

Try installing & configuring GRUB on the Windows partition, or booting a Windows rescue/install media with QEMU (otherwise, Windows will eat GRUB) and reinstalling to get a Windows bootloader back. To install GRUB, use grub-install /dev/sdxY, mount the filesystem, and run grub-mkconfig -o /mnt/grub/grub.cfg. Then, copy over just what you need from your existing grub.cfg, and edit it as necessary -- feel free to ask for help in this thread.

Another option is doing some research on just installing a bootloader natively on Windows.

The nuclear option is to move the Windows filesystem to a .img file with something like dd.

A very dangerous option is to continue using your existing GRUB to chain-boot into windows by using all of your disks with the read-only option. See @telcoM's comment on the OP; DO NOT RUN A VIRTUAL MACHINE ON A DISK THAT IS IN-USE BY THE HOST! THE FILESYSTEM WILL BE CORRUPTED AND UNRECOVERABLE! (ONLY unless it's used read-only by the guest.) Try qemu-xxxxxxx -drive file=/dev/sdxX,format=raw,readonly.

Nonetheless, QEMU can run a raw disk:

qemu-xxxxxxxx -drive file=/dev/sdxY,format=raw (see man 1 qemu & search for -drive for more information).

If you haven't much experience with QEMU/KVM, running & configuring it directly from the command-line can be intimidating and frustrating -- consider a front-end for your health.