bedHedd's NixOS Adventure

The config worked and I had no issues with the controllers in my work area, but I kept getting controller drop outs with the dongle in the living room. I suspect the batteries were causing the drop outs, so until the replacement rechargeable batteries arrive, I looked into updating the controller firmware. I recalled that the arch wiki had this section

learning virtualization in NixOS

The arch wiki suggested using qemu and virtualbox.

I started by adding virtualbox to my packages, but I got the following vboxdrv error:

VirtualBox kernel driver not Installed. The vboxdrv kernel module was either not loaded, /dev/vboxdrv is not set up properly, or you are using EFI Secure Boot and the module is not signed in the right way for your system. If necessary, try setting up the kernel module again by executing '/sbin/vboxconfig' as root (VERR_VM_DRIVER_NOT_INSTALLED).
Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
ConsoleWrap
Interface:
IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8}

I asked chatgpt which suggested the following

Since chatgpt 5.1 has hallucinated more recently, I decided to look it up and found this thread

When I launched virtuabox again, I got the following error

AMD-V is disabled in the BIOS (or by the host OS) (VERR_SVM_DISABLED).
Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
ConsoleWrap
Interface:
IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8}

chatgpt recommended I enable it in my motherboard. Looking back, it must have gotten disabled when I flashed the new bios.

After enabling virtualization I got the following error:

Failed to acquire display parameter.
Unsupported resolution for screen shot: 0x0 (screen 0).
Result Code:
NS_ERROR_INVALID_ARG (0x80070057)
Component:
DisplayWrap
Interface:
IDisplay {14fd6676-ee6b-441a-988b-c83025ab693a}

At this point I decided it was more effort to setup virtualbox, so I pivoted to qemu. While reading the the nixos wiki page, I came across the section on quickemu

The wiki setup looked pretty straightforward, so I went ahead and followed the instructions
https://github.com/quickemu-project/quickemu/wiki/01-Installation#nix--nixos

The defaults worked for windows 10, but my xbox controller didn’t show up in the xbox accessories app in windows 10.

patch for windows 11

This section might be outdated, as there seems to be a new patch, but at the time of writing, the nix package hadn’t been updated

I decided to try again with windows 11 but I encountered some issues getting it installed to the vm
The first issue was booting into the installer.
I modified the windows-11 conf per the suggestion of this post

This is the conf that worked

#!/etc/profiles/per-user/bedhedd/bin/quickemu --vm
guest_os="windows"
disk_img="windows-11/disk.qcow2"
iso="windows-11/Win11_25H2_EnglishInternational_x64.iso"
# fixed_iso="windows-11/virtio-win.iso"
disk_size="64G"
tpm="on"
secureboot="off"

I was able to get into the installer, but then encountered the same issue of hardware recognition

I ran the script and selected the fixed drive. To launch the script I used this command with the suggestions
from

quickemu --vm windows-11.conf  --extra_args "--drive media=cdrom,index=3,file=windows-11/virtio-win.iso" -display spice

When selecting the driver, I picked the NetKVM drivers from the cd from the am64 folder. After applying these patches, I was able to boot into windows. When I tried passing my xbox controller with spice, Windows detected it initially then stopped working. Pairing with the bluetooth dongle worked, but I couldn’t update the controller firmware.

1 Like