refactor: Improve VM serial console and auto-login configuration

This commit is contained in:
2025-08-16 16:20:06 +02:00
parent bf18468eee
commit 1fdf506d7a

View File

@@ -68,28 +68,30 @@
(commonConfig { isLiveIso = false; }) (commonConfig { isLiveIso = false; })
({ config, pkgs, lib, ... }: { ({ config, pkgs, lib, ... }: {
boot.loader.grub.enable = false; boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true; boot.loader.generic-extlinux-compatible.enable = true;
# Enable networking for VM # Enable networking for VM
networking.hostName = "workshop-vm"; networking.hostName = "workshop-vm";
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.firewall.enable = false; networking.firewall.enable = false;
# Fix the auto-login conflict with mkForce # Serial console configuration - the RIGHT way
services.displayManager.autoLogin = lib.mkForce { boot.kernelParams = [ "console=ttyS0,115200" "console=tty1" ];
enable = true;
user = "workshop";
};
# Auto-start terminal with welcome message # VM specific settings
services.xserver.displayManager.sessionCommands = '' virtualisation.memorySize = 4096;
${pkgs.xfce.xfce4-terminal}/bin/xfce4-terminal --fullscreen --title="Workshop Terminal" & virtualisation.diskSize = 40000;
'';
# VM specific settings # Force serial console as primary
virtualisation.memorySize = 4096; # 4GB RAM virtualisation.qemu.options = [
virtualisation.diskSize = 40000; # 40GB disk "-nographic"
];
# Fix the auto-login conflict with mkForce
services.displayManager.autoLogin = lib.mkForce {
enable = true;
user = "workshop";
};
}) })
]; ];
}; };