From 9b62a943ccdf015ceb0e3c4841a2f2ed36263ae6 Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Sat, 6 Jun 2020 14:35:01 -0400
Subject: eased vm spinup
---
home/.profile | 1 +
home/.vm/Makefile | 14 ++++++++++++++
2 files changed, 15 insertions(+)
create mode 100644 home/.vm/Makefile
diff --git a/home/.profile b/home/.profile
index 650c17c..e846a28 100644
--- a/home/.profile
+++ b/home/.profile
@@ -10,3 +10,4 @@ alias pl="pacman -Ql"
alias pyu="sudo pacman -Syu"
function d(){ dict $@ | colorit | less -R }
function c(){ echo "$@" | bc -lq }
+function vm(){ ( cd ~/.vm && sudo make $@ ) }
diff --git a/home/.vm/Makefile b/home/.vm/Makefile
new file mode 100644
index 0000000..efb691b
--- /dev/null
+++ b/home/.vm/Makefile
@@ -0,0 +1,14 @@
+.POSIX:
+
+VM="fedora.img"
+PORTS=
+CPU=-smp 4
+MEM=-m 4G
+CDROM=
+ARGS=
+
+run:
+ @qemu-system-x86_64 -enable-kvm $(CPU) $(MEM) -drive\
+ file=$(VM),format=raw $$([ -z $(CDR) ]|| echo -cdrom $(CDR) -boot\
+ d) $$(echo -n "-net user"; for port in $(PORTS); do echo -n\
+ ",hostfwd=tcp::$${port}-:$${port}"; done;) $(DISP) -net nic
--
cgit