feat: add proper QEMU guest support for memory ballooning
- Import NixOS qemu-guest.nix profile (sets up virtio modules in initrd) - Enable qemu-guest-agent service for VM management - Remove manual virtio_balloon config (now handled by profile) The qemu-guest profile properly configures: - virtio_balloon in boot.initrd.kernelModules (loads early) - virtio_console, virtio_rng, virtio_gpu - virtio_net, virtio_pci, virtio_blk, virtio_scsi Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,12 +2,15 @@
|
|||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
# imports = [ ./hw.nix ];
|
# Import NixOS QEMU guest profile for optimal virtio support
|
||||||
|
imports = [
|
||||||
|
"${modulesPath}/profiles/qemu-guest.nix"
|
||||||
|
];
|
||||||
|
|
||||||
# boot.loader.grub.device = "/dev/vda";
|
# boot.loader.grub.device = "/dev/vda";
|
||||||
# fileSystems."/" = {
|
# fileSystems."/" = {
|
||||||
@@ -20,8 +23,8 @@
|
|||||||
"console=tty1"
|
"console=tty1"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enable virtio balloon driver for dynamic memory resizing
|
# QEMU guest agent for VM management (memory stats, filesystem freeze, etc.)
|
||||||
boot.kernelModules = [ "virtio_balloon" ];
|
services.qemuGuest.enable = true;
|
||||||
|
|
||||||
systemd.services."serial-getty@ttyS0" = {
|
systemd.services."serial-getty@ttyS0" = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user