newvm: Avoid adding graphics adapter by default

VMs don't really need graphical consoles; serial terminals are good
enough, or even better given that they are logged.  For the few cases
where a graphical console is actually necessary, the `newvm.sh` script
can add one with the `--graphics` argument.
unifi-restore
Dustin 2025-07-14 15:44:33 -05:00
parent 0824e6bea0
commit 04718fa6d0
1 changed files with 9 additions and 0 deletions

View File

@ -12,6 +12,7 @@ network=network=kube
dnsdomain=host.pyrocufflink.black
console=true
default_groups=true
graphics=false
usage() {
printf 'usage: %s [options] name\n' "${0##*/}"
@ -76,6 +77,9 @@ while [ $# -gt 0 ]; do
--domain=*)
dnsdomain=${1#=*}
;;
--with-graphics)
graphics=true
;;
--cfg-branch)
shift
cfg_branch=$1
@ -105,6 +109,7 @@ while [ $# -gt 0 ]; do
name="$1"
else
usage >&2
printf 'unknown option: %s\n' "${1}" >&2
exit 2
fi
esac
@ -183,6 +188,10 @@ if [ -n "${cfg_branch}" ]; then
set -- "$@" --qemu-commandline="-fw_cfg opt/dch/cfg-branch,string=${cfg_branch}"
fi
if ! $graphics; then
set -- "$@" --graphics=none
fi
if $console; then
set -- "$@" --autoconsole text
else