# VMs ## HOW-TO To start (or create) a VM, go in the desired folder and run ```console $ ./run.sh ``` ### CPU/RAM limit See QEMU(1) for CPU limit
. Default RAM flag: `-m "2G,maxmem=$((MAX_RAM - 2))G"`.
You can limit the CPU/RAM usage with these flags: ``` ./run.sh -smp "$NB_CPUS,maxcpus=$MAX_CPUS" \ -m "${RAM}G,maxmem=${MAX_RAM}G" ``` You can make this permanent in run.sh (this VM only) or lib.sh (all VMs). ### Port forwarding To forward host port 2222 to guest 22: ``` ./run.sh -nic user,hostfwd=tcp::2222-:22 ``` You can make this permanent in run.sh (this VM only) or lib.sh (all VMs). ### USB passthrough If you need USB passthrough, uncomment and fill in the corresponding line in `run.sh`. [You may need root privileges](https://wiki.archlinux.org/title/QEMU#Pass-through_host_USB_device). ## See also