Skip to content

Instantly share code, notes, and snippets.

View ph1048's full-sized avatar
🎯
Focusing

Alex ph1048

🎯
Focusing
View GitHub Profile
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
<name>win10_silent</name>
<uuid>d21581f4-c186-4571-b1bc-d8c63a7be3b4</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/win/10"/>
</libosinfo:libosinfo>
</metadata>
<memory unit="KiB">16787456</memory>
<currentMemory unit="KiB">4194304</currentMemory>
@ph1048
ph1048 / VFIO Setup Guide.md
Created December 26, 2020 00:29 — forked from 0chroma/VFIO Setup Guide.md
Windows 10 VFIO QEMU Setup

VFIO Setup Guide

I play games regularly, and the sad reality is that it forces me to use Windows on my desktop. There's a Linux installation on there, but rebooting into it is such a massive interruption that I usually just move over to my laptop for programming. Working on a laptop leads to all sorts of ergonomic issues, and it felt like a massive waste to not develop on the desktop hardware I invested so much in. So after extensively researching what the VFIO community has been doing, I've deleted my Windows installation and moved all my gaming into a virtual machine on a Linux host.

Normally VMs are too slow for gaming, but thanks to a feature called VFIO you can run games at near-native performance by passing graphics cards and USB controllers directly to a virtual machine. The only requirement is that your board supports IOMMU, which most modern systems have. In this guide I'll wal

job := DllCall("CreateJobObject", "Ptr", 0, "Ptr", 0)
jobinfo := BufferAlloc(144, 0)
NumPut("UInt", 0x2000, jobinfo, 16)
setinfo := DllCall("SetInformationJobObject", "Ptr", job, "UInt", 9, "Ptr", jobinfo, "UInt", 144)
assigned := DllCall("AssignProcessToJobObject", "Ptr", job, "Ptr", DllCall("GetCurrentProcess"))
ProcessClose("Launcher.exe")
ProcessClose("SocialClubHelper.exe")
ProcessClose("LauncherPatcher.exe")
ProcessWaitClose("Launcher.exe", 30)
@ph1048
ph1048 / wsl_ssh.bat
Last active December 20, 2020 18:50
@echo off
SET name=kali-linux
SET port=2222
SET port2=8082
wsl -d %name% -u root -e /bin/bash -c "service ssh start"
SET getipcmd=wsl -d %name% -e /bin/bash -c "ifconfig eth0 | grep netm | grep -E '([0-9]{1,3}\.){3}[0-9]{1,3}' | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d:"
for /f "delims=" %%i in ('%getipcmd%') do set tgtip=%%i
netsh interface portproxy add v4tov4 listenport=%port% listenaddress=0.0.0.0 connectport=%port% connectaddress=%tgtip%