mirror of
https://github.com/turtlebasket/michaelnet.git
synced 2026-03-04 19:44:31 -08:00
add nixhost vm scripts
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -91,3 +91,7 @@ Temporary Items
|
||||
*.tar.gz
|
||||
*.tar.gz.enc
|
||||
*.tar.gz.age
|
||||
|
||||
# OS images & QEMU drives
|
||||
*.iso
|
||||
*.qcow2
|
||||
|
||||
11
thonkpad/nixhost/grun.sh
Executable file
11
thonkpad/nixhost/grun.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Graphical runner for desktop
|
||||
|
||||
ISO=nixos
|
||||
DRIVENAME=nixhost
|
||||
MEM_GB=1
|
||||
|
||||
qemu-system-x86_64 -enable-kvm \
|
||||
-m $(expr 1024 \* $MEM_GB) -drive file=./$DRIVENAME.qcow2,format=qcow2
|
||||
|
||||
11
thonkpad/nixhost/run.sh
Executable file
11
thonkpad/nixhost/run.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
ISO=nixos
|
||||
DRIVENAME=nixhost
|
||||
MEM_GB=1
|
||||
SSH_PORT=2022
|
||||
|
||||
qemu-system-x86_64 -enable-kvm -nographic -vga none \
|
||||
-net user,hostfwd=tcp::2022-:22 -net nic \
|
||||
-m $(expr 1024 \* $MEM_GB) -drive file=./$DRIVENAME.qcow2,format=qcow2
|
||||
|
||||
26
thonkpad/nixhost/setup.sh
Executable file
26
thonkpad/nixhost/setup.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
ISO=nixos
|
||||
DRIVENAME=nixhost
|
||||
DRIVE_GB=50
|
||||
MEM_GB=1
|
||||
|
||||
if [ -f $ISO.iso ]; then
|
||||
echo "Found $ISO.iso"
|
||||
else
|
||||
wget -O $ISO.iso https://channels.nixos.org/nixos-23.05/latest-nixos-minimal-x86_64-linux.iso
|
||||
fi
|
||||
|
||||
if [ -f $DRIVENAME.qcow2 ]; then
|
||||
echo "Found $DRIVENAME.qcow2."
|
||||
else
|
||||
qemu-img create -f qcow2 $DRIVENAME.qcow2 ${DRIVE_GB}G
|
||||
fi
|
||||
|
||||
# try headless-esque flags:
|
||||
# -display curses
|
||||
# -nographic
|
||||
|
||||
qemu-system-x86_64 -enable-kvm -display curses -nographic -cdrom $ISO.iso \
|
||||
-m $(expr 1024 \* $MEM_GB) -drive file=./$DRIVENAME.qcow2,format=qcow2
|
||||
|
||||
Reference in New Issue
Block a user