feat: Implement hybrid console mode for workshop VM

This commit is contained in:
2025-08-16 16:27:57 +02:00
parent 1fdf506d7a
commit 2c34741b03
2 changed files with 24 additions and 14 deletions

View File

@@ -195,17 +195,22 @@ isoConfig // {
fi
}
desktop() {
echo "🖥 Starting GUI session..."
if [ -z "$DISPLAY" ]; then
startx &
export DISPLAY=:0
sleep 3
echo " GUI started. Run 'browser' to open Firefox"
else
echo " GUI already running"
fi
}
desktop() {
echo "🖥 Starting GUI session..."
if command -v startx &> /dev/null; then
if [ -z "$DISPLAY" ]; then
startx &
export DISPLAY=:0
sleep 3
echo " GUI started. Check QEMU window or run 'browser'"
else
echo " GUI already running"
fi
else
echo "💡 GUI available in QEMU window (Alt+Tab to switch)"
echo "🖱 Click on QEMU graphics window to use desktop"
fi
}
help() {
echo "CODE CRISPIES Workshop Commands:"

View File

@@ -76,22 +76,27 @@
networking.networkmanager.enable = true;
networking.firewall.enable = false;
# Serial console configuration - the RIGHT way
# Hybrid console configuration - serial primary, GUI available
boot.kernelParams = [ "console=ttyS0,115200" "console=tty1" ];
# VM specific settings
virtualisation.memorySize = 4096;
virtualisation.diskSize = 40000;
# Force serial console as primary
# Hybrid mode: GUI available but serial console primary
virtualisation.qemu.options = [
"-nographic"
"-display" "gtk"
"-monitor" "stdio"
];
# Fix the auto-login conflict with mkForce
services.displayManager.autoLogin = lib.mkForce {
enable = true;
user = "workshop";
};
# Keep GUI session commands for when GUI is used
services.xserver.displayManager.sessionCommands = ''
${pkgs.xfce.xfce4-terminal}/bin/xfce4-terminal --fullscreen --title="Workshop Terminal" &
'';
})
];
};