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
parent
0824e6bea0
commit
04718fa6d0
9
newvm.sh
9
newvm.sh
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue