Hello everyone,
I’m currently running NixOS with libvirt for virtualization. I have encountered a problem where the refresh rate of the GTK display in my QEMU virtual machine is capped at 33Hz. I would like to increase this to 60Hz to improve the smoothness of the display.
After some research, I’ve found that I need to modify a value in the QEMU source code (GUI_REFRESH_INTERVAL_DEFAULT
in include/ui/console.h
) from 30 to 16. However, I’m having trouble figuring out how to apply this change in NixOS.
I’ve tried to create an overlay as follows:
self: super: {
qemu = super.qemu.overrideAttrs (oldAttrs: {
postPatch = ''
sed -i 's/GUI_REFRESH_INTERVAL_DEFAULT 30/GUI_REFRESH_INTERVAL_DEFAULT 16/g' include/ui/console.h
'';
});
}
I also have tried:
virtualisation.libvirtd.qemu.package = pkgs.qemu_full;
nixpkgs.overlays = with pkgs; [
(self: super: {
qemu_full = super.qemu_full.overrideAttrs (oldAttrs: {
postPatch = oldAttrs.postPatch + ''
sed -i 's/GUI_REFRESH_INTERVAL_DEFAULT 30/GUI_REFRESH_INTERVAL_DEFAULT 16/g' include/ui/console.h
'';
});
})
];
But it still can’t work.
But I’m not sure if this is actually modifying the QEMU package used by libvirt, or even if this is the correct way to apply such a modification. As far as I tried, my win10 vm still display with a low frame rate.
Could anyone provide guidance on how to properly apply this modification to the QEMU source code used by libvirt in NixOS? Any help or pointers in the right direction would be greatly appreciated.
Thanks in advance.