On 2025-11-14 at 09:16, Franco Martelli wrote:
> Hi,
>
> running the command:
>
> ~$ kvm -cdrom debian-live-13.0.0-amd64-kde.iso -m 8g
>
> I can start a virtual machine for the Debian Live ISO image. I'd like
> to customize the virtual machine. Is it possible to have a .conf file
> which it contains all the options for the virtual machine, eg. number
> of cores, memory size, etc… without specify all the options on the
> CLI?
>
> I'd like to have a single .conf default file to use for all the ISO,
> reading kvm(1) man-page seems nothing is explained, only options for
> the CLI.
I am not familiar with this utility myself, but reading through that
file (and it *is* dense and lengthy), I see:
-readconfig file
Read device configuration from file. This approach is useful when
you want to spawn QEMU process with many command line options but
you don't want to exceed the command line character limit.
The adjacent '-no-user-config' option also seems to imply that there's
supposed to be a config-file capability, but doesn't provide much to go
on in figuring out what files that would be (except that they'd be
stored under 'sysconfdir') or what syntax the files would need to have.
The next thing I'd try would be searching for 'kvm configuration file',
or (since KVM can also refer to a keyboard/video/mouse switch setup)
'kvm virtualization config file' or similar. I don't have the
time-plus-attention left to spare for that at the moment, however.
Failing that, as tomas said, you can create a wrapper/launcher script
(or potentially even just an alias, defined in an appropriate
environment-config file, or in a script which just defines the alias)
which specifies all the needed command-line options.
--
The Wanderer
The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. -- George Bernard Shaw
Attachment:
signature.asc
Description: OpenPGP digital signature