Thank you!!! @hexxotest
Following your suggestion with a little tweak, I finally got my 10 cores/64G Ram Windows10 VM boots up, from pressing RUN button in virt manager till I saw windows login session, within one minute.
The only downside is my machine took 5 hours to compile kernel, so I probably won’t do any kernel update unless it’s absolutely necessary, although not updating frequently on Archlinux makes me feel a bit weird.
My host environment is probably not very clean, compilation failed all the time saying something related to openssl
or libcrypto
. So I compiled it in chroot following this link .
Following are what I did, this works on my intel E5-2683v3 machine running archlinux as host. If you are using two nvidia card, you will need to use nvidia-drm for your custom kernel in order to use your primary nvidia card. check out this link for nvidia-drm
#grab ready to build source code from archlinux AUR
mkdir ~/linux-build
cd ~/linux-build
yay -G linux-vfio
#this will clone source code to linux-vifo sub folder, so PKGBUILD is in $HOME/linux-build/linux-vifo
#Change config and PKGBUILD
#PKGBUILD
# line 33 -> replace 2nd sha256sums with 'SKIP'
# or create and replace with a new checksum
#config
# add CONFIG_PREEMPT_VOLUNTARY=y
# comment out #CONFIG_PREEMPT=y
#create a clean and up-to-date env for build
mkdir ~/chroot
CHROOT=$HOME/chroot
mkarchroot $CHROOT/root base-devel
arch-nspawn $CHROOT/root pacman -Syu
#edit either ~/.makepkg.conf or $CHROOT/root/etc/makepkg.conf
# find and uncomment MAKEFLAGS in ARCHITECTURE, COMPILE FLAGS Section,
# and find COMPRESSZST in COMPRESSION DEFAULTS Section, change following to use as many thread as possible to compile
#
# MAKEFLAGS="-j$(nproc)"
# COMPRESSZST=(zstd -c -z -q - --threads=0)
#make sure you are in $HOME/linux-build/linux-vifo
#start compiling
makechrootpkg -c -r $CHROOT
#after successful compilation
makepkg -i
# now you should have a custom kernel in boot
# use this kernel, apply everything you did before for GPU passthrough, now windows vm should boots in reasonable time.
ls /boot | grep vmlinuz-linux-vfio