From 2cb1587b23988375e1960328903b40e4f5c2bfe7 Mon Sep 17 00:00:00 2001 From: pyarya Date: Wed, 4 Sep 2024 12:27:56 -0600 Subject: [PATCH] clean up` --- build.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/build.py b/build.py index 626c73f..6c15778 100644 --- a/build.py +++ b/build.py @@ -5,7 +5,7 @@ import argparse def vm_start(nographic=False): home = Path.home() - user = os.getlogin() + user = os.getuser() image_src = "var/lib/debian.qcow2" vm_storage_location = f"/home/arvp/virtual_machines/{user}.qcow2" image_dest = f"{home}/debian.qcow2" @@ -16,19 +16,17 @@ def vm_start(nographic=False): "-m", "2G", # ram allocation "-nic", "user,hostfwd=tcp::5555-:22", #forward port 5555 in host to port 22 in vm "-drive", "file=%s,media=disk,if=virtio" % image_dest, - - # "-nographic", - # "-serial", "mon:stdio", - - "-vga", "virtio", # i think this fixes resolution but idk yet - "-display", "sdl", ] - if nographic==True: + if nographic: initialize.append("-nographic") initialize.append("-serial") initialize.append("mon:stdio") - + else: + initialize.append("-vga") + initialize.append("virtio") + initialize.append("-display") + initialize.append("sdl") #copy the base image to a directory with everyones virtual machines. -n should not overwrite any existing vms. #subprocess.run(["cp", "-n", image_src, vm_storage_location]) Popen(initialize)