WIP:aryan/build #2
9
build.py
9
build.py
|
@ -13,8 +13,8 @@ def vm_start(nographic=False):
|
||||||
initialize = [
|
initialize = [
|
||||||
"qemu-system-x86_64",
|
"qemu-system-x86_64",
|
||||||
"-enable-kvm",
|
"-enable-kvm",
|
||||||
"-m", "2G", # ram allocation
|
"-m", RAM, # ram allocation
|
||||||
"-nic", "user,hostfwd=tcp::5555-:22", #forward port 5555 in host to port 22 in vm
|
"-nic", f'user,hostfwd=tcp::{PORT}-:22', #forward port 5555 in host to port 22 in vm
|
||||||
"-drive", "file=%s,media=disk,if=virtio" % image_dest,
|
"-drive", "file=%s,media=disk,if=virtio" % image_dest,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -35,9 +35,10 @@ if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="ARVP Onboarding Virtual Machine Launcher! Don't use --nographic if you are in a tmux session. it might explode :3")
|
description="ARVP Onboarding Virtual Machine Launcher! Don't use --nographic if you are in a tmux session. it might explode :3")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--nographic",
|
"-nographic",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="Run QEMU in nographic mode (runs the VM embedded in your terminal instead of opening a new window)",)
|
help="Run QEMU in nographic mode (runs the VM embedded in your terminal instead of opening a new window)",)
|
||||||
|
parser.add_argument("-port", help="Port to forward to the VM for ssh", default=5555)
|
||||||
|
parser.add_argument("-ram", help="Amount of RAM to allocate to the VM", default="4G")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
vm_start(nographic=args.nographic)
|
vm_start(nographic=args.nographic)
|
||||||
|
|
Loading…
Reference in a new issue