Boot VM in text mode

This commit is contained in:
Tristan Daniël Maat 2021-04-25 02:29:01 +01:00
parent a3b72d11bd
commit 1d95c40075
Signed by: tlater
GPG key ID: 49670FD774E43268
2 changed files with 8 additions and 1 deletions

View file

@ -14,6 +14,8 @@ nixos-rebuild build-vm --flake '.#vm'
### Running ### Running
*Note: M-2 will bring up a console for poweroff and such*
Running should *mostly* be as simple as running the command the build Running should *mostly* be as simple as running the command the build
script echos. script echos.

View file

@ -65,6 +65,11 @@
(import ./configuration) (import ./configuration)
({ ... }: { ({ ... }: {
users.users.tlater.password = "insecure"; users.users.tlater.password = "insecure";
# Disable graphical tty so -curses works
boot.kernelParams = [ "nomodeset" ];
# # Set up VM settings to match real VPS
# virtualisation.memorySize = 3941; # virtualisation.memorySize = 3941;
# virtualisation.cores = 2; # virtualisation.cores = 2;
}) })
@ -76,7 +81,7 @@
mkShell { mkShell {
buildInputs = [ nixfmt git-lfs ]; buildInputs = [ nixfmt git-lfs ];
shellHook = '' shellHook = ''
export QEMU_OPTS="-m 3941 -smp 2" export QEMU_OPTS="-m 3941 -smp 2 -curses"
export QEMU_NET_OPTS="hostfwd=::3022-:2222,hostfwd=::3080-:80,hostfwd=::3443-:443,hostfwd=::3021-:2221,hostfwd=::25565-:25565" export QEMU_NET_OPTS="hostfwd=::3022-:2222,hostfwd=::3080-:80,hostfwd=::3443-:443,hostfwd=::3021-:2221,hostfwd=::25565-:25565"
''; '';
}; };