Help Installing Windows on top of Fedora

Hey y’all, I have been trying to get windows to install on top of Fedora for a while now and I couldn’t get it to work. First as anyone would probably thing, I just took the ISO of windows made it bootable in a USB and tried to install it and It didn’t work.

We will talk about the specification later or what might be the cause

New my big brain kicked to action and I thought why don’t I just use my SSD inside a virtual machine and wipe it there instead. well It did work and I was able to boot to windows but only inside the virtual machine I couldn’t boot to windows from my laptop and I couldn’t get the boot entry to show on GRUB (well I did only once though since I tried to reinstall it many times trying different things.


As for my setup I have a MSI Workstation Laptop, I have a NVME SSD and a Normal 2.5" SSD. I have Fedora 40 Installed on my NVME and as for the 2.5" one It has windows (new install so its fine If I need to remove it). I was hoping anyone here could help me get Windows (evil OS) running with GRUB. More info about my setup:
❯ sudo fdisk -l
Disk /dev/sda: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk model: GIGABYTE GP-GSTF
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B4BF64C3-A973-4873-B1E9-E01C592EB1DB

Device Start End Sectors Size Type
/dev/sda1 2048 206847 204800 100M EFI System
/dev/sda2 206848 239615 32768 16M Microsoft reserved
/dev/sda3 239616 233322495 233082880 111.1G Microsoft basic data
/dev/sda4 233322496 234438655 1116160 545M Windows recovery environment

Disk /dev/nvme0n1: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk model: THNSN5128GPU7 TOSHIBA
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 9D78AB35-283C-445E-B9A2-B1460DE74A10

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1230847 1228800 600M EFI System
/dev/nvme0n1p2 1230848 3327999 2097152 1G Linux extended boot
/dev/nvme0n1p3 3328000 250068991 246740992 117.7G Linux filesystem

Disk /dev/zram0: 8 GiB, 8589934592 bytes, 2097152 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

❯ sudo os-prober
/dev/sda1@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
❯ lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT
NAME        FSTYPE   SIZE MOUNTPOINT
sda                111.8G 
├─sda1      vfat     100M 
├─sda2                16M 
├─sda3      ntfs   111.1G 
└─sda4      ntfs     545M 
zram0                  8G [SWAP]
nvme0n1            119.2G 
├─nvme0n1p1 vfat     600M /boot/efi
├─nvme0n1p2 ext4       1G /boot
└─nvme0n1p3 btrfs  117.7G /home

For anyone curious about how I got the SSD to run inside the VM here is the command:
sudo virt-install --name windows_install \
  --memory 4096 \
  --vcpus 2 \
  --disk /dev/sdX,bus=sata \
  --cdrom /path/to/installationFile.iso \
  --os-variant win10 \
  --connect qemu:///system \
  --boot uefi \
  --features smm=on \
  --machine q35

Replace the X in ‘/dev/sdX’ with your own drive id or whatever

Added windows

well to get Windows dual boot there is multiple steps t get it running and the first and important step is Windows need to be installed first and then Linux it just wont work if you try to install Windows after Linux

better option is to run WIndows inside Linux VM make it bootable on boot and just run both same time

Ain’t no way bro :skull:, I need windows to be running on the machine since I am gonna be using it I need access to its hardware (GPU and stuff)

Well that’s the facts you can install windows first as dual boot or run it as VM and passthrough what you need and make the VM boot/start on boot

Not so much more there to do or run

Running passthroughs on that is going to be headaches and trya ND errors involved to testing re installing using looking class, virt manager, tweaking setting and scripts

I am sure there is a way right ? I mean I did boot to windows but I got a recovery screen with errors. What If I just remove the current boot partition which is the one inside the NVME (fedora) and then install windows ? The thing is that windows keeps detecting the NVME and ignoring the SSD

Windows will always try to install onto the first drive it detects.
Maybe the approach to force windows onto the SSD would involve removing the NVME device, install windows onto the SSD, then reinstall the NVME drive.

From that point it should be relatively simple to boot fedora on the nvme device and use sudo grub2-mkconfig -o /boot/grub2/grub.cfg to reconfigure grub to find and allow booting of windows.

Booting to fedora for the first time after installing windows may require using the bios boot menu or setting fedora as the first option in the boot order in bios setup.

3 Likes

I mean isn’t that the same as installing windows to the SSD via the Virtual machine ?

Windows on a virtual machine is not the same as windows on the SSD.

If you need the devices directly available to windows it should be on the SSD. If it works with everything needed then a VM may work.

This is a no no. Your fedora would no longer be able to boot.

The recommended (and necessary way) is to install windows before installing linux. If you already have fedora installed on the NVME device and want windows on the SSD then the suggestion I made above is probably the only option. Otherwise plan on installing windows then potentially reinstalling fedora.

A VM uses a virtual drive and cannot use the actual physical drive directly.

2 Likes

you can use physical drives, but that goes to part of complicated and passthrough alot of stuff like you are running still VM but as Native as possible using passthrough methods with additional apps like looking class just for example, but this dosent work on laptops still

Based on the way you phrased that sentence I don’t think you understood what I said, What I meant is isn’t it the same installation process. When I install it via the VM to my physical SSD I do get the files and all. It does run inside the VM bit It doesn’t when I try to boot to it with my laptop, I get a bluescreen saying something is missing Its the windows error thingy.


I do get Windows's boot entry to show up in GRUB. there must be a way right ? Since my laptop has allergies to WinPE LMAO, I tried to use winPE to fix the boot but I couldn't even get WinPE to boot. or maybe I should just give up and remove the NVME

how you can boot and run Windows from local SSD using VM that is operated from Linux? this is where the VM and passthrouhg comes and what Jeff says is easiest way to achieve your setup if you want to dual boot

can you specify which part of what he said ? the part about removing my NVME ? well my laptop is not that easy to disassemble and I am already waiting to get a new NVME. I don’t wanna have to keep disassembling it.
Edit: if there is no solution then I will have to do it

This one

yeah that one about removing the SSD, Since I don’t wanna reinstall fedora. well I guess I gonna get a screwdriver