diff --git a/README.md b/README.md index 1f9d68a..95bdee3 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # pop!_OS-win10-KVM-setup -THIS IS NOW A **COMPLETED** GUIDE. I will be providing periodic changes, updates and fixes to this repo as I see fit. +THIS IS NOW A **COMPLETED** GUIDE. I will be providing periodic changes, updates, and fixes to this repo as I see fit. -***I would like to provide thanks to Noah, Isaiah and Joey for taking the time out of their day to gloss over this document and aid me in the creation of this repo.*** +***I would like to provide thanks to Noah, Isaiah, and Joey for taking the time out of their day to gloss over this document and aid me in the creation of this repo.*** Nov-5-21 This still works on Pop 21.04. -LAST UPDATE: 4/3/23 1:08 PM EST - Merged some PRs with grammar fixes. Thank you for thosee. +LAST UPDATE: 4/3/23 1:08 PM EST - Merged some PRs with grammar fixes. Thank you for those. I would also like to personally thank every person who has viewed and used this guide in any capacity. I never thought something I made would help this much. Remember to also look at the guides that my own guide was inspired from below! @@ -56,7 +56,7 @@ This is a repository that contains a tutorial and the necessary scripts to creat You don't *need* strong terminal skills to do this, but it is highly recommended that you know basic terminal commands to get yourself through this. This is especially true if you are not using user-friendly desktop environments or plan to do this entirely through the Terminal. If you don't have good terminal skills I suggest [this](https://ubuntu.com/tutorials/command-line-for-beginners#1-overview) article. -I have moderate terminal knowledge, so this was a breeze for me; but I understand new users who want to get into the KVM environment after switching to Linux for the myriad of reasons that they may have(I don't blame you for moving. [Welcome to Linux!](https://livebook.manning.com/book/linux-in-action/chapter-1/10)). +I have moderate terminal knowledge, so this was a breeze for me, but I understand new users who want to get into the KVM environment after switching to Linux for the myriad of reasons that they may have(I don't blame you for moving. [Welcome to Linux!](https://livebook.manning.com/book/linux-in-action/chapter-1/10)). If you are a seasoned UNIX/Linux/related user, this may not be the guide for you, as this will be a more verbose guide. If you are a more experienced user, I suggest going to the [Arch KVM wiki](https://wiki.archlinux.org/index.php/KVM) or alternatively going to the guides listed [below](https://github.com/mr2527/pop_OS-win10-KVM-setup#--guides). @@ -82,7 +82,7 @@ This KVM for Windows 10 will allow for PCIE and SATA devices to be passed throug My reasoning for creating this was that, at the time, I was a newer Linux user that was also a gamer, and I did not want my moving over to a better development environment to impact my ability to game. I also did not want to necessarily deal with the annoying dual booting that I had. It is just easier to pull my hair out for a few days and learn to set this up than dual booting. -I spent nearly a week sifting through various guides getting this environment to work (properly) on my desktop, and I want to share the tips and tricks I've learned along the way and present how to establish a KVM / Virt-Manager set up (for windows 10) for inexperienced users in an easily digestible way. Some guides would get me halfway and then would not provide me with enough information on where to go next, others summed up the first but left delicate details out. All the guides I have read however are great and I want to give recognition to the individuals that helped me get this environment to work. +I spent nearly a week sifting through various guides getting this environment to work (properly) on my desktop, and I want to share the tips and tricks I've learned along the way and present how to establish a KVM / Virt-Manager setup (for Windows 10) for inexperienced users in an easily digestible way. Some guides would get me halfway and then would not provide me with enough information on where to go next, others summed up the first but left delicate details out. All the guides I have read however are great and I want to give recognition to the individuals that helped me get this environment to work.

Guides: @@ -137,7 +137,7 @@ Below is a breakdown of my exact PC hardware setup. Please be aware that **there Hardware Requirements:

-* Two graphics cards. (One for host system, One for guest system (passthrough)) +* Two graphics cards. (One for the host system, One for the guest system (passthrough)) * [Hardware that can support IOMMU](https://en.wikipedia.org/wiki/List_of_IOMMU-supporting_hardware) (Please read before proceeding). * A monitor with more than one input or more than one monitor (Will be discussed later). @@ -216,7 +216,7 @@ $ sudo apt-get install amdvlk ```bash $ sudo apt install libvirt-daemon-system libvirt-clients qemu-kvm qemu-utils virt-manager ovmf ``` -After this is completed, you are going to restart your PC and enter your BIOS. BIOS entry varies by manufacturer. In my case I can access it with F2, F8, or DEL. Enable the feature called `IOMMU`. Once this is completed you will then need to enable CPU virtualization. For Intel processors, you will need to enable `VT-d`. For AMD, look for something called `AMD-Vi` or in the case of my motherboard `SVM`/`SVM MODE` and enable it. Save your changes to the BIOS and then go back into pop! +After this is completed, you are going to restart your PC and enter your BIOS. BIOS entry varies by manufacturer. In my case, I can access it with F2, F8, or DEL. Enable the feature called `IOMMU`. Once this is completed you will then need to enable CPU virtualization. For Intel processors, you will need to enable `VT-d`. For AMD, look for something called `AMD-Vi` or in the case of my motherboard `SVM`/`SVM MODE` and enable it. Save your changes to the BIOS and then go back into pop! Once you are logged back in you are going to want to run **this** command: @@ -246,7 +246,7 @@ If you get output that looks like **this**, you should be ready.

-Once this is completed you will need to pass this hardware enabled IOMMU functionality into the kernel. You can read more about [kernel parameters here](https://wiki.archlinux.org/index.php/kernel_parameters). Depending on your boot-loader you will have to figure out how to do this yourself. For me, I can use [kernelstub](https://github.com/pop-os/kernelstub). Other people use grub, GRUB2 or rEFInd. +Once this is completed you will need to pass this hardware-enabled IOMMU functionality into the kernel. You can read more about [kernel parameters here](https://wiki.archlinux.org/index.php/kernel_parameters). Depending on your boot-loader you will have to figure out how to do this yourself. For me, I can use [kernelstub](https://github.com/pop-os/kernelstub). Other people use grub, GRUB2, or rEFInd. AMD: ```bash @@ -258,7 +258,7 @@ Intel: $ sudo kernelstub --add-options "intel_iommu=on" ``` -If you use [GRUB2](https://help.ubuntu.com/community/Grub2), you can do it by going into /etc/default/grub with sudo permissions and include it into the kernel parameter below. +If you use [GRUB2](https://help.ubuntu.com/community/Grub2), you can do it by going into /etc/default/grub with sudo permissions and include it in the kernel parameter below. AMD: ```bash @@ -272,7 +272,7 @@ GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on" As mentioned in [Bryan's guide](https://github.com/bryansteiner/gpu-passthrough-tutorial/blob/master/README.md), when planning the GPU passthrough setup, it was said to blacklist the NVIDIA/AMD drivers. {I don't think this has been mentioned yet in your own guide though} "The logic stems from the fact that since the native drivers can't attach to the GPU at boot-time, the GPU will be freed-up and available to bind to the vfio drivers instead." The tutorials will make you add a parameter called `pci-stub` with the PCI bus ID of the GPU you wish to use. I did not follow this approach and instead dynamically unbind the drivers and bind `VFIO-PCI` drivers to it. Alternatively, you can run this script to bind the `VFIO-PCI` drivers to the secondary card in your PC. But it is important to understand IOMMU groupings. The script provided by [Bryan here](https://github.com/bryansteiner/gpu-passthrough-tutorial/blob/master/kvm/scripts/iommu.sh) is perfectly adequate for finding IOMMU groups, but I found [this script](https://github.com/mr2527/pop_OS-win10-KVM-setup/blob/main/Scripts/iommu2.sh) to be better. -The reason we want to use either script is to find the devices we want to pass through (storage drivers, PCIe hardware, etc). [IOMMU](https://en.wikipedia.org/wiki/Input%E2%80%93output_memory_management_unit) is a reference to the chipset device that maps virtual addresses to physical addresses on the input/output of the devices. At the end of this step we want to make sure that we have appropriate IOMMU groupings. The reason for this is that you cannot separate the groupings. +The reason we want to use either script is to find the devices we want to pass through (storage drivers, PCIe hardware, etc). [IOMMU](https://en.wikipedia.org/wiki/Input%E2%80%93output_memory_management_unit) is a reference to the chipset device that maps virtual addresses to physical addresses on the input/output of the devices. At the end of this step, we want to make sure that we have appropriate IOMMU groupings. The reason for this is that you cannot separate the groupings. Run the script: ```bash @@ -283,7 +283,7 @@ If you cannot run the script, with or without sudo, then you should run: ```bash chmod +x ./iommu2.sh ``` -[chmod](https://en.wikipedia.org/wiki/Chmod) elevates permissions for files, and in this case would allow you to run this without complications. +[chmod](https://en.wikipedia.org/wiki/Chmod) elevates permissions for files, and in this case, would allow you to run this without complications. For AMD systems the output will look something like this: @@ -316,19 +316,19 @@ If you have the problem presented in the Intel example, you have 2 options: **PLEASE go to [Bryan's guide](https://github.com/bryansteiner/gpu-passthrough-tutorial/blob/master/README.md) and read how to do it there and understand the complications and implications.** -Since I did not need that part I will be skipping it. The next steps are applicable if you need the patch or not. Dynamic binding is not necessarily required. But it works in my case so I suggest looking into it. I will provide instructions below. +Since I did not need that part I will be skipping it. The next steps are applicable if you need the patch or not. Dynamic binding is not necessarily required. But it works in my case so I suggest looking into it. I will provide the instructions below.

OPTIONAL: VM Dynamic Binding

-How: Libvirt has a hook ([Libvirt Hooks](https://libvirt.org/hooks.html)) system that grants you access to running commands on startup or shutdown of the VM. The scripts that are located within the directory `/etc/libvirt/hooks`. If the directory cannot be found, or does not exist, create it. +How: Libvirt has a hook ([Libvirt Hooks](https://libvirt.org/hooks.html)) system that grants you access to running commands on startup or shutdown of the VM. The scripts that are located within the directory `/etc/libvirt/hooks`. If the directory cannot be found or does not exist, create it. ```bash $ sudo mkdir /etc/libvirt/hooks ``` -But lucky for us we have the [hook helper](https://passthroughpo.st/simple-per-vm-libvirt-hooks-with-the-vfio-tools-hook-helper/) which can be ran as followed: +But lucky for us we have the [hook helper](https://passthroughpo.st/simple-per-vm-libvirt-hooks-with-the-vfio-tools-hook-helper/) which can be run as followed: ```bash $ sudo wget 'https://raw.githubusercontent.com/PassthroughPOST/VFIO-Tools/master/libvirt_hooks/qemu' \-O /etc/libvirt/hooks/qemu $ sudo chmod +x /etc/libvirt/hooks/qemu @@ -435,7 +435,7 @@ Take a breather! We are almost there! Creating the VM in Virt-Manager -Once you are here we can begin the construction of our VM. If you are a new user I suggest the GUI approach that I will describe. Otherwise you can take a read [YuriAlek's series of GPU passthrough scripts](https://gitlab.com/YuriAlek/vfio). The scripting is obviously more involved and takes some skill to process. The GUI approach is easier. There is nothing wrong with this approach! +Once you are here we can begin the construction of our VM. If you are a new user I suggest the GUI approach that I will describe. Otherwise, you can take a read [YuriAlek's series of GPU passthrough scripts](https://gitlab.com/YuriAlek/vfio). The scripting is obviously more involved and takes some skill to process. The GUI approach is easier. There is nothing wrong with this approach! You can now start [Virt-Manager](https://virt-manager.org/), you will be presented with this screen: @@ -461,13 +461,13 @@ You will now configure your Memory (RAM) and CPU settings. In my case, I will de

-In this case you will be creating a custom storage for the Windows install. Select `Enable storage for this virtual machine` and then `Select or create custom storage` and then navigate the Storage Volume menu and create a storage volume with any size above 50GB. In this case you want to create a storage volume with any name you would like and with a format of `qcow2` the rest doesn't matter. It can be stored wherever you like. Once created select it and proceed with `Choose Volume` and lastly go `Forward`. +In this case, you will be creating a custom storage for the Windows install. Select `Enable storage for this virtual machine` and then `Select or create custom storage` and then navigate to the Storage Volume menu and create a storage volume with any size above 50GB. In this case, you want to create a storage volume with any name you would like and with a format of `qcow2` the rest doesn't matter. It can be stored wherever you like. Once created select it and proceed with `Choose Volume` and lastly go `Forward`.

-***NOTE***: I had a problem when I initially created this because I named it `win10`. I highly suggest NOT naming it this. Instead do `Windows10` if you really want. Lastly select `Customize configuration before install` and then `Finish`. +***NOTE***: I had a problem when I initially created this because I named it `win10`. I highly suggest NOT naming it this. Instead do `Windows10` if you really want. Lastly, select `Customize configuration before install` and then `Finish`. A new window will now appear called `$VM_NAME on QEMU/KVM`. This will allow you to configure more advanced options. You can alter these options through GUI or libvirt XML settings. Please ensure that while on the `Overview` page under `Firmware` you select `UEFI x86_64: /usr/share/OVMF_CODE_4M.fd` and none of the other options. @@ -475,13 +475,13 @@ A new window will now appear called `$VM_NAME on QEMU/KVM`. This will allow you

-Next up we will move to the `CPUs` tab. Here we are going to change under `Configuration` make sure `Copy host cpu configuration` is *NOT* checked, change `Model` to `host-passthrough` and select `Enable available CPU security flaw mitigations`. This is to prevent Spectre/Meltdown vulnerabilities. Don't bother with Topology yet. +Next up we will move to the `CPUs` tab. Here we are going to change under `Configuration` to make sure `Copy host cpu configuration` is *NOT* checked, change `Model` to `host-passthrough`, and select `Enable available CPU security flaw mitigations`. This is to prevent Spectre/Meltdown vulnerabilities. Don't bother with Topology yet.

-Next up you can remove a few options from the side. ***Remove*** `Tablet`, `Channel Spice` and `Console`. +Next up you can remove a few options from the side. ***Remove*** `Tablet`, `Channel Spice`, and `Console`. Select `Sata Disk 1` > `Advanced options disk bus` -> `VirtIO` @@ -489,13 +489,13 @@ Select `Sata Disk 1` > `Advanced options disk bus` -> `VirtIO`

-Navigate to `NIC` and change Device model to `virtio` +Navigate to `NIC` and change the Device model to `virtio`

-`Add Hardware`, add `Channel Device`, keep the default name, choose `Device type - Unix Socket`. +`Add Hardware`, add `Channel Device`, keep the default name, and choose `Device type - Unix Socket`.

@@ -527,7 +527,7 @@ Now we are going to have to get our hands dirty with editing the XML file. Go to

-If you are passing in an NVIDIA GPU to the VM you may run into [Error 43](https://passthroughpo.st/apply-error-43-workaround/). This is because NVIDIA doesn't enable virtualization on their GeForce cards. The workaround is to have hypervisor hide its existence. From here navigate to the `` section and add this. +If you are passing in an NVIDIA GPU to the VM you may run into [Error 43](https://passthroughpo.st/apply-error-43-workaround/). This is because NVIDIA doesn't enable virtualization on their GeForce cards. The workaround is to have the hypervisor hide its existence. From here navigate to the `` section and add this. ```bash @@ -570,15 +570,15 @@ Error 43 should no longer occur. Installing Windows 10 in the VM -This section will detail on how to install the Windows 10 VM and get ready to move forward with tweaks and updates to get your performance better. I will be pulling from [Aaron's guide](https://github.com/aaronanderson/LinuxVMWindowsSteamVR#windows-installation---part-1) in this section. +This section will detail how to install the Windows 10 VM and get ready to move forward with tweaks and updates to get your performance better. I will be pulling from [Aaron's guide](https://github.com/aaronanderson/LinuxVMWindowsSteamVR#windows-installation---part-1) in this section. START the VM. Click into the VM window and it should have your mouse and keyboard take over the window. Press enter when you are prompted to boot from the CDROM. If you are shown the UEFI shell then you weren't fast enough. If this is the case, type `exit` or go to `boot manager` -> `UEFI QEMU CDROM QM03` (There may be more than 1 zero in yours). -Select 'I don't have a product key' I highly suggest *not* putting a windows code in unless you are 100% completed with your installation and are fine with the performance. Reinstallation is not out of the ordinary. +Select 'I don't have a product key' I highly suggest *not* putting a Windows code in unless you are 100% completed with your installation and are fine with the performance. Reinstallation is not out of the ordinary. -On the installation screen for windows, select `Custom: Install Windows Only (advanced)`. This is because Windows does not have VirtIO drivers included. This will restrict your VM from seeing the drive. Click load driver, browse for your drive. In my case it was `E:` but for you it may be different. It should say: `E: virtio-win-0.1.173`, once here select the folder `amd64\w10`. +On the installation screen for Windows, select `Custom: Install Windows Only (advanced)`. This is because Windows does not have VirtIO drivers included. This will restrict your VM from seeing the drive. Click load driver, and browse for your drive. In my case, it was `E:` but for you, it may be different. It should say: `E: virtio-win-0.1.173`, once here select the folder `amd64\w10`. -Once this is done and the installation goes on, you can then try to shutdown the VM before Windows auto-restarts. If you get stuck on a black screen due to an AMD GPU bug then force your VM off and put the host to sleep then wake up the host. +Once this is done and the installation goes on, you can then try to shut down the VM before Windows auto-restarts. If you get stuck on a black screen due to an AMD GPU bug then force your VM off and put the host to sleep then wake up the host.

Adding a VBIOS to Your Guest (Windows 10) VM @@ -593,7 +593,7 @@ $ sudo chown root:root /etc/firmware/EVGA.RTX3070.8192.201019.rom $ sudo chmod 744 /etc/firmware/EVGA.RTX3070.8192.201019.rom ``` -I use vim so: +I use Vim so: ```bash $ sudo vi /etc/apparmor.d/abstractions/libvirt-qemu ``` @@ -602,14 +602,14 @@ append this to the very end and the SPACES ARE IMPORTANT!!! ```bash /etc/firmware/* r, ``` -Once written and you're ready to quit (on vim) shift + : then type `:wq!`, this will write and quit. If you write `:Wq!` it will not work. +Once written and you're ready to quit (on Vim) shift + : then type `:wq!`, this will write and quit. If you write `:Wq!` it will not work. run: ```bash $ sudo systemctl restart apparmor.service ``` -Now navigate back to your virt-manager and find the PCI device that you added that your GPU is under. Click xml and edit the xml to include this: +Now navigate back to your virt-manager and find the PCI device that you added that your GPU is under. Click XML and edit the XML to include this: ```bash @@ -620,7 +620,7 @@ Now navigate back to your virt-manager and find the PCI device that you added th ``` -The important bit is the `` This will be different depending on your IOMMU grouping, your graphics card and your VBIOS so please keep an eye open and add the appropriate content. +The important bit is the `` This will be different depending on your IOMMU grouping, your graphics card, and your VBIOS so please keep an eye open and add the appropriate content.

@@ -633,18 +633,18 @@ This is a problem that some may experience and I do not have the answer as to wh Start the VM

-Finish the Windows installation. Use the KVM and connect the second gpu to any monitor to ensure you're getting output. If you are that is good. Otherwise you may have missed a step or did not configure correctly. +Finish the Windows installation. Use the KVM and connect the second GPU to any monitor to ensure you're getting output. If you are that is good. Otherwise, you may have missed a step or did not configure correctly. Open the Windows Search and type Device Manager. There will be missing drivers. I updated the missing drivers manually. Ignore the `unknown device` missing drivers. That is the QEMU bug. -Select the PCI Device `VEN_1AF4&DEV_1045 (balloon)`, select update driver, browse to My Computer, select `E:\Balloon\w10\amd64`. Next select the PCI `Simple Communications Controller`, update driver, E:\vioserial\w10. You may also be missing your ethernet connectivity. Go to the ethernet device and update the driver manually by selecting the E: drive, this will automatically find the correct driver. All should be set now. If your gpu is not appearing in the task manager do not freak out yet. We still have some more to do. If you are getting output that is good enough for now. +Select the PCI Device `VEN_1AF4&DEV_1045 (balloon)`, select update driver, browse to My Computer, and select `E:\Balloon\w10\amd64`. Next select the PCI `Simple Communications Controller`, update driver, E:\vioserial\w10. You may also be missing your ethernet connectivity. Go to the ethernet device and update the driver manually by selecting the E: drive, this will automatically find the correct driver. All should be set now. If your gpu is not appearing in the task manager do not freak out yet. We still have some more to do. If you are getting output that is good enough for now.

- If you would like to backup your xml: + If you would like to backup your XML:

-[Check out Aaron's method](https://github.com/aaronanderson/LinuxVMWindowsSteamVR#backup-1), or alternatively, go to your XML through virt-manager and copy / paste it to an xml file though the text editor of your choice. +[Check out Aaron's method](https://github.com/aaronanderson/LinuxVMWindowsSteamVR#backup-1), or alternatively, go to your XML through virt-manager and copy/paste it to an XML file though the text editor of your choice. Ex: ```bash @@ -659,14 +659,14 @@ to save it.

- From this point you can play with your new KVM: + From this point, you can play with your new KVM:

-***I will provide my final XML [here](https://github.com/mr2527/pop_OS-win10-KVM-setup/blob/main/Scripts/POP_TO_Windows_XML.xml) but make sure you are appropriately creating these entries relative to your hardwares topology. I have a 12 core 24 thread cpu and some sections will not look the same for you.*** +***I will provide my final XML [here](https://github.com/mr2527/pop_OS-win10-KVM-setup/blob/main/Scripts/POP_TO_Windows_XML.xml) but make sure you are appropriately creating these entries relative to your hardware topology. I have a 12 core 24 thread CPU and some sections will not look the same for you.*** If you are pulling my XML do NOT just copy my config and put it into your XML spot. It will 90% not work unless you are using the same hardware that I am using and even then there may be incompatibility with your topology versus mine. You have been warned. -Boot into your VM and double check the drivers. Make sure everything is working correctly. +Boot into your VM and double-check the drivers. Make sure everything is working correctly. Now we can begin editing the XML for some changes that will boost performance! @@ -686,7 +686,7 @@ Do not apply yet. Go all the way to the bottom of the XML and under the ` ``` -Now apply. These new insertions should stay. If you did it incorrectly they will disappear after applying. Double check to make sure that it sticks. Proceed with the instructions in the next section. +Now apply. These new insertions should stay. If you did it incorrectly they will disappear after applying. Double-check to make sure that it sticks. Proceed with the instructions in the next section.

CPU Pinning (ONLY if you are [multithreaded](https://en.wikipedia.org/wiki/Multithreading_(computer_architecture))): @@ -781,7 +781,7 @@ Now we will go down to the end of `` and edit `` by adding the f ``` This is based on the topology of your CPU and will vary. This is how I set it up for my AMD Ryzen 9 3900x as it will allocate 1 socket with 6 physical cores and 2 threads per core. -As [Bryan](https://github.com/bryansteiner/gpu-passthrough-tutorial#----cpu-pinning) states, "If you're wondering why I tuned my CPU configuration this way, I'll refer you to this section of the Libvirt domain XML format.16 More specifically, consider the cputune element and its underlying vcpupin, emulatorpin, and iothreadpin elements. The Arch Wiki recommends pinning the emulator and iothreads to host cores (if available) rather than the VCPUs assigned to the guest. In the example above, 12 out of my 24 threads are assigned as vCPUs to the guest and from the remaining 12 threads on the host, 4 are assigned to the emulator and 8 are assigned to an iothread see below." +As [Bryan](https://github.com/bryansteiner/gpu-passthrough-tutorial#----cpu-pinning) states, "If you're wondering why I tuned my CPU configuration this way, I'll refer you to this section of the Libvirt domain XML format.16 More specifically, consider the cputune element and its underlying vcpupin, emulatorpin, and iothreadpin elements. The Arch Wiki recommends pinning the emulator and iothreads to host cores (if available) rather than the VCPUs assigned to the guest. In the example above, 12 out of my 24 threads are assigned as vCPUs to the guest, and from the remaining 12 threads on the host, 4 are assigned to the emulator and 8 are assigned to an iothread see below."

If you need disk tuning: @@ -789,7 +789,7 @@ As [Bryan](https://github.com/bryansteiner/gpu-passthrough-tutorial#----cpu-pinn See how [Bryan](https://github.com/bryansteiner/gpu-passthrough-tutorial#----disk-tuning) does it. -In my case I did not need or use this method so I will not be going over it. +In my case, I did not need or use this method so I will not be going over it.

Benchmarking: @@ -797,12 +797,12 @@ In my case I did not need or use this method so I will not be going over it. This is the end. You did it. Everything should be working. It is now up to you to find your way and tweak anything else that you may need to get your device set up and working exactly the way that you want it to. -The last thing that I did was add all of my PCI devices that controlled my USB I/O so I can plug and play usb ports for my VM and make use of my DAC/AMP for audio instead of using the GPU. It works for me but may not work for you. So have fun and enjoy the VM. +The last thing that I did was add all of my PCI devices that controlled my USB I/O so I can plug and play USB ports for my VM and make use of my DAC/AMP for audio instead of using the GPU. It works for me but may not work for you. So have fun and enjoy the VM. - [Windows KVM performance](https://www.userbenchmark.com/UserRun/40099278) - 2/21/21 - [Windows 10 Native]() - coming soon -I'm hopeful that you will get great performance with your KVMs and hardware. If your CPU is not getting the performance you would like: look over the tweaks, topology and lastly if you can afford it, overclock your CPU. I have my CPU in a custom watercooling loop so I'm pushing varying voltages and clock speeds. +I'm hopeful that you will get great performance with your KVMs and hardware. If your CPU is not getting the performance you would like: look over the tweaks, topology and lastly if you can afford it, overclock your CPU. I have my CPU in a custom water-cooling loop so I'm pushing varying voltages and clock speeds.

Credits & Resources: @@ -845,27 +845,27 @@ These are the sources I used to get my KVM running. There are a ton more and I s This will be a personal discussion section where I will discuss any personal problems or interesting things that I may encounter with the KVM. -~~So as of 3/22/21 I may have found a fix with a problem that I've been encountering with entirely random intervals and no way (that I know of) of figuring out why I'm getting hard crashes.~~ +~~So as of 3/22/21 I may have found a fix for a problem that I've been encountering with entirely random intervals and no way (that I know of) of figuring out why I'm getting hard crashes.~~ -UPDATE: 4/1/2021 (NOT a cruel April fools joke) I have found a fix for my specific problem. READ BELOW PLEASE! +UPDATE: 4/1/2021 (NOT a cruel April Fools joke) I have found a fix for my specific problem. READ BELOW PLEASE! -Explanation: I will be using the KVM to play my games and maybe do some coding with C# and microsoft related applications and with entirely random intervals/chances my entire computer will turn off. This includes the host. It will act as a hard reset and take me to my BIOS where the PC reboots as normal with no problems, errors, or messages of any kind. My first thought is that there was or is something wrong with a PCIE device conflicting with the HOST and GUEST OS. I'm not sure if that is or isn't the problem but I tried removing and adding different devices with no fixes. +Explanation: I will be using the KVM to play my games and maybe do some coding with C# and Microsoft-related applications and with entirely random intervals/chances my entire computer will turn off. This includes the host. It will act as a hard reset and take me to my BIOS where the PC reboots as normal with no problems, errors, or messages of any kind. My first thought is that there was or is something wrong with a PCIE device conflicting with the HOST and GUEST OS. I'm not sure if that is or isn't the problem but I tried removing and adding different devices with no fixes. ~~***Possible fix?***: I went back into the XML file for the project and removed pinning from CPU 0. I read on an obscure forum that removing the pinning from 0 fixed the problem. I am not entirely sure if this has fixed my problem but I have yet to encounter a hard crash. I ran a very demanding CPU stress test to see if that could cause a crash but doing so before or after the CPU pinning change did not result in any crashes. I will continue to monitor any complications that I get from this point forward.~~ -Keeping this here for history sake. +Keeping this here for history's sake. -I found the *actual* answer to the variable crashing rates. So the problem is best summarized in this post on reddit from [u/yona_docova](https://www.reddit.com/r/Amd/comments/kw1o9f/psa_having_random_black_screen_crashes_under/). The biggest "wow this is exactly the problem I'm having" moment was this mention. +I found the *actual* answer to the variable crashing rates. So the problem is best summarized in this post on Reddit from [u/yona_docova](https://www.reddit.com/r/Amd/comments/kw1o9f/psa_having_random_black_screen_crashes_under/). The biggest "wow this is exactly the problem I'm having" moment was this mention. "You play a game and randomly you will get a black screen crash for no apparent reason, and the PC restarts and you get back into the game, only not to have none, or another crash in 5 minutes or 4 hours later into the game. It's totally random and impossible to predict." -This got my brain jogging. I had searched for hours/days about potential fixes that did not do anything for me. I reinstalled my VM, cloned different VMS tried different boot options, different passthrough options and none of those fixes worked except this (***PLEASE NOTE:*** Although this worked for me ***IT MAY NOT WORK FOR YOU*** please consider trying everything before throwing in the towel. I understand how frustrating this can be as it happened to myself. With patience and persistence you may find the answer that you are looking for.) +This got my brain jogging. I had searched for hours/days about potential fixes that did not do anything for me. I reinstalled my VM, cloned different VMS tried different boot options, and different passthrough options, and none of those fixes worked except this (***PLEASE NOTE:*** Although this worked for me ***IT MAY NOT WORK FOR YOU*** please consider trying everything before throwing in the towel. I understand how frustrating this can be as it happened to me. With patience and persistence you may find the answer that you are looking for.) -11/05/21 - I've tested this configuration and reinstallation on the 21.04 update and did not run into any complications with the installation process. I did however notice that there was some performance degredation but I figured out it was due to being on an older BIOS version. Once I updated it was a better experience. Consistent performance, no crashing. I still use Scream to get audio through since I dont have enough space for a dedicated onboard DAC. It works good for what it's worth. Free, slightly annoying to set up. But it works. +11/05/21 - I tested this configuration and reinstallation on the 21.04 update and did not run into any complications with the installation process. I did however notice that there was some performance degradation but I figured out it was due to being on an older BIOS version. Once I updated it was a better experience. Consistent performance, no crashing. I still use Scream to get audio through since I don't have enough space for a dedicated onboard DAC. It works well for what it's worth. Free, and slightly annoying to set up. But it works.

The Fix: @@ -873,9 +873,9 @@ This got my brain jogging. I had searched for hours/days about potential fixes t So here are the steps that I took to ensure that my KVM went back to its perfect working state: -1. Backup your data just in case. You never know... I suggest [Timeshift](https://github.com/teejee2008/timeshift). +1. Back up your data just in case. You never know... I suggest [Timeshift](https://github.com/teejee2008/timeshift). 2. Flash your BIOS to the newest stable version, if you are on the newest stable version and are experiencing this WITH the changes below, consider a beta branch or a downgrade. NOTE: Each BIOS is different. Your installation process may vary so PLEASE read your manual or go to your appropriate driver page to get the appropriate files and instructions. If you have an EZ flash functionality you can use that as well and you will be fine. -3. Enter into your BIOS and change your `Vcore` voltage to `normal` or if that setting does not exist, set it to `manual` and change the offset to `0v`. This may produce an offset with an incredibly small number which is fine as long as you inputted '0'. +3. Enter into your BIOS and change your `Vcore` voltage to `normal` or if that setting does not exist, set it to `manual` and change the offset to `0v`. This may produce an offset with an incredibly small number which is fine as long as you input '0'. 4. Suggestion - In the case of a BIOS reset being required, if your motherboard supports it, I would create a profile that can be saved to the BIOS that will save all of your configurations that will keep all of your options for overclocking and general settings. This has fixed all of my problems up to this point and has removed the stress off of wondering if I can even play games with my friends or alone. @@ -885,25 +885,25 @@ This has fixed all of my problems up to this point and has removed the stress of Having Audio complications?

-Problem: I do not have a PCIE based audio controller. Instead, I own a DAC and Amplifier for powering my collection of headphones. The problem that comes from this is that I either have to pass in the entire USB controller which causes mild conflicts OR pass the individual USB in which has the possibility of producing the exact problem I had. +Problem: I do not have a PCIE-based audio controller. Instead, I own a DAC and Amplifier for powering my collection of headphones. The problem that comes from this is that I either have to pass in the entire USB controller which causes mild conflicts OR pass the individual USB which has the possibility of producing the exact problem I had. -If you pass a USB audio device regardless of the sound quality disregarding the hz or bitrate you will get a crunchy, distorted, demonic, decepticon level of audio. This is unbearable and destroys the quality of any media that is trying to be digested. I will detail below the fixes. +If you pass a USB audio device regardless of the sound quality disregarding the hz or bitrate you will get a crunchy, distorted, demonic, Decepticon level of audio. This is unbearable and destroys the quality of any media that is trying to be digested. I will detail below the fixes.

EASY FIX (Bandaid?)

-I spent equally as long trying to fix the crashing problem as I was trying to fix my distorted, demonic sounding audio. I'm going to cut to the chase with TWO fixes for you. One of the simplest fixes is to pass in the entire USB controller device but this causes problems if you want to be able to use your Linux host AND your Windows guest at the same time. Otherwise you can do the next fix which I think is the coolest. +I spent equally as long trying to fix the crashing problem as I was trying to fix my distorted, demonic-sounding audio. I'm going to cut to the chase with TWO fixes for you. One of the simplest fixes is to pass in the entire USB controller device but this causes problems if you want to be able to use your Linux host AND your Windows guest at the same time. Otherwise, you can do the next fix which I think is the coolest.

Better Fix For Me:

-The best fix that I encountered for getting the best audio out of the VM is using [SCREAM](https://github.com/duncanthrax/scream). SCREAM is "a virtual device driver for Windows that provides a discrete sound device. Audio played through this device is published on your local network as a PCM multicast stream." So essentially you're broadcasting your audio over the network and connecting to it through your HOST machine via the terminal or script. The install is simple enough and running it is even easier. Just follow the directions presented in the git repo provided in the hyperlink above! +The best fix that I encountered for getting the best audio out of the VM is using [SCREAM](https://github.com/duncanthrax/scream). SCREAM is "a virtual device driver for Windows that provides a discrete sound device. Audio played through this device is published on your local network as a PCM multicast stream." So essentially you're broadcasting your audio over the network and connecting to it through your HOST machine via the terminal or script. The installation is simple enough and running it is even easier. Just follow the directions presented in the git repo provided in the hyperlink above! -***NOTE:*** If you are going to use the SCREAM method and you are deadset on getting the absolute fastest speed of audio without any type of delay at all for any professional level of gameplay then this is not the fix for you. You may be better off passing the entire controller. Since SCREAM uses your network to broadcast audio, you WILL have a slight delay. Think of bluetooth. It's a very small amount of delay. I can play high octane games just fine with barely any noticeable impact on gameplay. listening to audio or watching videos is not impacted in the slightest. I have noticed however during playing Rhythm games I just don't hit the notes perfectly as I usually do. That is an easy for for some games by creating a slight offset of a few milliseconds. +***NOTE:*** If you are going to use the SCREAM method and you are deadset on getting the absolute fastest speed of audio without any type of delay at all for any professional level of gameplay then this is not the fix for you. You may be better off passing the entire controller. Since SCREAM uses your network to broadcast audio, you WILL have a slight delay. Think of Bluetooth. It's a very small amount of delay. I can play high-octane games just fine with barely any noticeable impact on gameplay. listening to audio or watching videos is not impacted in the slightest. I have noticed however during playing Rhythm games I just don't hit the notes perfectly as I usually do. That is easy for some games by creating a slight offset of a few milliseconds. -TL:DR if you do not want a delay. Do not use SCREAM. Find an alternative or pass the entire controller for audio which as the drawback of locking you out of your Linux host unless you have a proper work around +TL:DR if you do not want a delay. Do not use SCREAM. Find an alternative or pass the entire controller for audio which is the drawback of locking you out of your Linux host unless you have a proper workaround

SSD/HDD passthrough Disconnecting @@ -914,14 +914,14 @@ TL:DR if you do not want a delay. Do not use SCREAM. Find an alternative or pass If you are still having this problem some potential fixes are as follows: 1. Downgrade your BIOS - 2. Turn off USB/PCI sleep in windows power management under advanced settings + 2. Turn off USB/PCI sleep in Windows power management under advanced settings 3. Turn off Power Saving modes in power management settings -**NOTE: I did find that turning off the USB power management settings actually helped my USB device pass through from turning off and disconnecting from the VM. Worked great and I have not had a single problem since.** +**NOTE: I did find that turning off the USB power management settings actually helped my USB device pass-through from turning off and disconnecting from the VM. Worked great and I have not had a single problem since.** -At this point (4/23/21) this works functionally as a proper near bare-metal-performance Windows 10 machine. It can play everything just fine considering I passed 16gb, 12 cores and my RTX 3070. +At this point (4/23/21) this works functionally as a proper near bare-metal-performance Windows 10 machine. It can play everything just fine considering I passed 16gb, 12 cores, and my RTX 3070. -I encounter some general Windows 10 problems here and there. If you encounter something extraordinarly strange it may be in your best interest to start breaking down the problem into some type of hierarchy. I will provide you with my breakdown of how I problem solved my harder complications. +I encounter some general Windows 10 problems here and there. If you encounter something extraordinarily strange it may be in your best interest to start breaking down the problem into some type of hierarchy. I will provide you with my breakdown of how I problem solved my harder complications.

General Troubleshooting @@ -933,7 +933,7 @@ If you don't understand exactly what the problem is then that may cause a larger 2. Check for a Windows update (CONTROVERSIAL!) -So a Windows update ***MIGHT*** fix the problem or it might cause even more. In this case be prepared to make a backup, snapshot, ISO, whatever you want to preserve your data in the case of further complications. +So a Windows update ***MIGHT*** fix the problem or it might cause even more. In this case be prepared to make a backup, snapshot, ISO, or whatever you want to preserve your data in the case of further complications. 3. Check for drivers. @@ -941,11 +941,11 @@ This is a no-brainer. Just check to see if there's a driver that may be causing 4. For larger problems such as the Audio / SSD problems. -START by checking your XML and general KVM setup. Is there an incorrect setting? Is there wrong topology? There can be plenty of problems here. If you have done some research by going to various websites or checking plenty of online boards then it may be time to consider moving to the next step. +START by checking your XML and general KVM setup. Is there an incorrect setting? Is there a wrong topology? There can be plenty of problems here. If you have done some research by going to various websites or checking plenty of online boards then it may be time to consider moving to the next step. 5. BIOS updates. -***BE CAREFUL HERE*** - If you are going to update a BIOS it may be a good habit to write down your current problems. This will help in the instance of a BIOS update or BIOS setting causing more problems than solving. This was my problem with the SSD's dropping their connection. My ***STABLE*** BIOS update provided by the manufacturer caused my SSD to drop connection for an unknown reason. I did not change any settings aside from updating the BIOS to the newest BETA version and this fixed ALL of my disconnect problems. If you do not know how to flash a BIOS, watch a video or read your motherboards manual. +***BE CAREFUL HERE*** - If you are going to update a BIOS it may be a good habit to write down your current problems. This will help in the instance of a BIOS update or BIOS setting causing more problems than solving. This was my problem with the SSDs dropping their connection. My ***STABLE*** BIOS update provided by the manufacturer caused my SSD to drop connection for an unknown reason. I did not change any settings aside from updating the BIOS to the newest BETA version and this fixed ALL of my disconnect problems. If you do not know how to flash a BIOS, watch a video or read your motherboard's manual. 6. Check your hardware. @@ -956,15 +956,15 @@ DANGER ZONE: You need to be pretty desperate to attempt these changes as it coul 7. Reinstall Pop! -Pretty straight forward and pretty annoying to deal with. Timeshift is your friend in cases like this though. +Pretty straightforward and pretty annoying to deal with. Timeshift is your friend in cases like this though. 8. Reinstall QEMU / Virt-Manager / your KVM -Honestly this is the last thing anyone wants to do but I have had to do it and it sucks but honestly sometimes it is just the right thing to do to get a fresh install of something. Follow the instructions again and try your best! There is no shame in starting over. +Honestly, this is the last thing anyone wants to do but I have had to do it and it sucks. Sometimes it is just the right thing to do to get a fresh install of something. Follow the instructions again and try your best! There is no shame in starting over. 9. Trying a different Linux Distro -10. Drop the KVM and install a dual boot to windows. +10. Drop the KVM and install a dual boot to Windows. This is an entirely valid fix as well. Do not feel like you are required to learn how to use and run a KVM just because you are on Linux. Never feel bad about using an OS. There is a learning curve to everything and some get it faster than others. You are not a failure. I have considered doing this when I couldn't find solutions to my problems. But it is so satisfying to find the fix and apply them. Keep at it, no one will judge you.