<listitem><para>Configures how to set up the console of the VM. Takes one of
<literal>interactive</literal>, <literal>read-only</literal>, <literal>native</literal>,
- <literal>gui</literal>. Defaults to <literal>interactive</literal>. <literal>interactive</literal>
- provides an interactive terminal interface to the VM. <literal>read-only</literal> is similar, but
- is strictly read-only, i.e. does not accept any input from the user. <literal>native</literal> also
- provides a TTY-based interface, but uses qemu native implementation (which means the qemu monitor
- is available). <literal>gui</literal> shows the qemu graphical UI.</para>
+ <literal>gui</literal>, <literal>headless</literal>. Defaults to <literal>interactive</literal>.
+ <literal>interactive</literal> provides an interactive terminal interface to the VM.
+ <literal>read-only</literal> is similar, but is strictly read-only, i.e. does not accept any input
+ from the user. <literal>native</literal> also provides a TTY-based interface, but uses qemu native
+ implementation (which means the qemu monitor is available). <literal>gui</literal> shows the qemu
+ graphical UI. <literal>headless</literal> runs the VM without any console, which is useful for
+ automated or scripted usage.</para>
<xi:include href="version-info.xml" xpointer="v256"/></listitem>
</varlistentry>
elif __contains_word "$prev" ${OPTS[SSH_KEY]}; then
comps='dsa ecdsa ecdsa-sk ed25519 ed25519-sk rsa'
elif __contains_word "$prev" ${OPTS[CONSOLE]}; then
- comps='interactive native gui'
+ comps='interactive native gui read-only headless'
elif __contains_word "$prev" ${OPTS[IMAGE_FORMAT]}; then
comps='raw qcow2'
elif __contains_word "$prev" ${OPTS[ARG]}; then
[CONSOLE_READ_ONLY] = "read-only",
[CONSOLE_NATIVE] = "native",
[CONSOLE_GUI] = "gui",
+ [CONSOLE_HEADLESS] = "headless",
};
DEFINE_STRING_TABLE_LOOKUP(console_mode, ConsoleMode);
CONSOLE_READ_ONLY, /* ptyfwd, but in read-only mode */
CONSOLE_NATIVE, /* qemu's native TTY handling */
CONSOLE_GUI, /* qemu's graphical UI */
+ CONSOLE_HEADLESS, /* no console */
_CONSOLE_MODE_MAX,
_CONSOLE_MODE_INVALID = -EINVAL,
} ConsoleMode;
" --pass-ssh-key=BOOL Create an SSH key to access the VM\n"
" --ssh-key-type=TYPE Choose what type of SSH key to pass\n"
"\n%3$sInput/Output:%4$s\n"
- " --console=MODE Console mode (interactive, native, gui)\n"
+ " --console=MODE Console mode (interactive, native, gui, read-only, headless)\n"
" --background=COLOR Set ANSI color for background\n"
"\n%3$sCredentials:%4$s\n"
" --set-credential=ID:VALUE\n"
"-mon", "console");
break;
+ case CONSOLE_HEADLESS:
+ r = strv_extend_many(
+ &cmdline,
+ "-nographic",
+ "-nodefaults");
+ break;
+
default:
assert_not_reached();
}
return log_oom();
}
- if (arg_console_mode != CONSOLE_GUI) {
+ if (!IN_SET(arg_console_mode, CONSOLE_GUI, CONSOLE_HEADLESS)) {
r = strv_prepend(&arg_kernel_cmdline_extra, "console=hvc0");
if (r < 0)
return log_oom();