Skip to content

Instantly share code, notes, and snippets.

Running Windows 10/11 Guest with GPU Passthrough using laptop running Fedora

Abstract

This is a full guide for people who wanted to set up Windows 10/11 VM with QEMU/KVM hypervisor enhancements for a laptop that is configured with hybrid graphics card like Intel/AMD + NVIDIA. This process will take about 1 to 2 hours, depending on your system's performance and your patience =)

There is another comprehensive guide you can follow here (shoutout to asus-linux team who made supergfxctl which is a very important tool for this guide). It is more up-to-date than mine. I would probably incorporate those information into my guide, but you are welcome to use this one as a reference!

Before we proceed:

  • This guide is exclusively for Fedora users because this distro is quite different to set up than other distro such as Arch. I would say Arch is easier to setup than Fedora, but sometimes you like to use Fedora than Arc
@mak3r
mak3r / open-captive-portal.sh
Created November 17, 2024 18:48
Open a captive portal on linux. Captive portals tend to be used for Hotels and on Airplanes. Find the SSID and select it. In other OS, it automatically opens the browser or a window to login. In linux you must run this script to open the captive portal in the browser.
#!/bin/sh
# Open the captive portal of the current wifi
xdg-open http://$(ip --oneline route get 1.1.1.1 | awk '{print $3}') &
@mak3r
mak3r / README.md
Created July 1, 2024 14:17
Explicitly kill all k3s containers at system shutdown

Explicitly kill all k3s containers at system shutdown

Put the file in /etc/systemd/system/shutdown-k3s.service and then enable the service using

systemctl enable shutdown-k3s.service

Also note that this service name shutdown-k3s must not start with k3s-, otherwise the k3s-killall.sh script would also try to stop this service and cause problems.

@mak3r
mak3r / kiosk.yaml
Last active June 6, 2024 15:20
configuration to run a gui container using startx
apiVersion: v1
kind: Namespace
metadata:
name: kiosk
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kiosk
namespace: kiosk
@mak3r
mak3r / tls-rancher-ca-checksum
Created September 6, 2023 15:45
Reverse engineer rancher front end insecure cert from cert-manager
kubectl get secret -n cattle-system tls-rancher -o jsonpath='{.data.tls\.crt}' | base64 -d | sha256sum | cut -d" " -f 1
@mak3r
mak3r / list-git-remotes.sh
Created June 2, 2023 16:53
get a list of remotes in git repos on the file system
#!/bin/sh
for f in $(ls -1); do
pushd $f;
echo -e "\n\n******" >> ~/dev/remotes.txt;
echo $f >> ~/dev/remotes.txt;
echo "******" >> ~/dev/remotes.txt;
git remote show origin >> ~/dev/remotes.txt 2>&1;
popd;
@mak3r
mak3r / README.md
Last active October 7, 2022 14:19
k3s-basic-config

Install a standard k3s configuration

  • Run the command below to install a standard k3s configuration into the /etc/rancher/k3s directory.
  • This will set the kubeconfig permissions bits and setup to overwrite the install users ~/.kube/config file with the k3s kubeconfig
  • The user executing the script must have sudo privileges

Usage

  1. Install the config file
  • curl -sfL https://gist.github.com/mak3r/5e53406d303f46aa3c31af1cc792fe42/raw/install-k3s-config.sh | sh -
@mak3r
mak3r / copy-to-card.sh
Created May 6, 2022 08:27
Copy and unpack an .xz image to a block device - linux
#!/bin/sh -x
usage() {
echo "Usage:"
echo "$0 <url to .xz image> <device e.g. /dev/sda>"
echo ""
echo "Warning: Make sure you pass the device you really want to overwrite."
echo "\tit will get wiped."
}
@mak3r
mak3r / legacy-mac-brew.sh
Last active March 29, 2022 21:58
List any brew installed software that is still using x86 architecture
#!/bin/bash
for i in $(brew list --formula); do which $i | xargs file | grep x86 ; done
for i in $(brew list --cask); do which $i | xargs file | grep x86 ; done
@mak3r
mak3r / arm64-base-config
Created December 7, 2021 16:43
Testing RancherOS2 builds on currently unsupported aarch64 architecture
#cloud-config
rancheros:
install:
# An http://, https://, or tftp:// URL to load as the base configuration
# for this configuration. This configuration can include any install
# directives or OEM configuration. The resulting merged configuration
# will be read by the installer and all content of the merged config will
# be stored in /oem/99_custom.yaml in the created image.
# configURL: http://example.com/machine-cloud-config
# Turn on verbose logging for the installation process