fix: qemu flags docs

This commit is contained in:
ange 2024-03-10 22:47:57 +01:00
parent 9974777698
commit 45ba46043d
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D

View File

@ -1,27 +1,32 @@
# VMs # VMs
## HOW-TO ## HOW-TO
To start (or create) a VM, go in the desired folder and run To start (or create) a VM, go in the desired folder and run
```console ```console
$ ./run.sh $ ./run.sh [OPTS]
``` ```
You can pass `qemu` flags to `./run.sh` directly or you can make theses flags
permanent in `run.sh` (this VM only) or `lib.sh` (all VMs).
See `QEMU(1)` for all options.
### CPU/RAM limit ### CPU/RAM limit
See QEMU(1) for CPU limit<br>.
Default RAM flag: `-m "2G,maxmem=$((MAX_RAM - 2))G"`.<br> See `QEMU(1)` for CPU limit.<br>
You can limit the CPU/RAM usage with these flags: Default RAM flag: `-m "2G,maxmem=$((MAX_RAM - 2))G"`.
``` ```
./run.sh -smp "$NB_CPUS,maxcpus=$MAX_CPUS" \ ./run.sh -smp "$NB_CPUS,maxcpus=$MAX_CPUS" \
-m "${RAM}G,maxmem=${MAX_RAM}G" -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 ### Port forwarding
To forward host port 2222 to guest 22: To forward host port 2222 to guest 22:
``` ```
./run.sh -nic user,hostfwd=tcp::2222-: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 ### USB passthrough