qemu-kvm: -fw_cfg: invalid option

222 views
Skip to first unread message

Karl Nordstrom

unread,
Jun 25, 2021, 9:35:05 AM6/25/21
to Flatcar Container Linux User
I'm following the directions in:

I'm trying to start a flatcar linux with:

# virsh start flatcar-linux1

I am getting error messages:

error: Failed to start domain flatcar-linux1
error: internal error: process exited while connecting to monitor: qemu-kvm: -fw_cfg: invalid option

I edited domain.xml to have these changs:

# head -1 domain.xml
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">

# tail -6 domain.xml
  <qemu:commandline>
    <qemu:arg value="-fw_cfg"/>
    <qemu:arg value="name=opt/org.flatcar-linux/config,file=/var/lib/libvirt/flatcar-linux/flatcar-linux1/provision.ign"/>
  </qemu:commandline>
</domain>

The I defined domain flatcar-linux1

virsh define /var/lib/libvirt/flatcar-linux/flatcar-linux1/domain.xml

Does anyone have a suggestion on how to get this to work?

Thanks

Karl Nordstrom

unread,
Jun 25, 2021, 10:10:48 AM6/25/21
to Flatcar Container Linux User
qemu-kvm.x86_64 10:1.5.3-175.el7_9.4

# virsh -version
4.5.0

CentOS Linux release 7.9.2009 (Core)

Kai Lüke

unread,
Jun 25, 2021, 11:09:20 AM6/25/21
to Karl Nordstrom, Flatcar Container Linux User
Hello,

I used https://github.com/kinvolk/flatcar-terraform/tree/main/qemu-libvirt
to create the machine in the libvirt system session.
Here is the resulting XML config if it helps, but it uses the same
flag as yours. What is your QEMU version?
The flag is also used by
https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_qemu.sh
when you pass the "-i IGNITIONFILE" flag, maybe worth to check if that
also fails for you.

Regards,
Kai

<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
<name>tftest-mynode</name>
<uuid>545b8017-9ded-4533-9f93-c75352f34187</uuid>
<memory unit="KiB">786432</memory>
<currentMemory unit="KiB">786432</currentMemory>
<vcpu placement="static">1</vcpu>
<os>
<type arch="x86_64" machine="pc-i440fx-5.2">hvm</type>
<boot dev="hd"/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<cpu mode="custom" match="exact" check="none">
<model fallback="forbid">qemu64</model>
</cpu>
<clock offset="utc"/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type="volume" device="disk">
<driver name="qemu" type="qcow2"/>
<source pool="tftest-pool"
volume="tftest-mynode-821f5a9e9c377a188af7507b91f8169d.qcow2"/>
<target dev="vda" bus="virtio"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x05"
function="0x0"/>
</disk>
<controller type="usb" index="0" model="piix3-uhci">
<address type="pci" domain="0x0000" bus="0x00" slot="0x01"
function="0x2"/>
</controller>
<controller type="pci" index="0" model="pci-root"/>
<controller type="virtio-serial" index="0">
<address type="pci" domain="0x0000" bus="0x00" slot="0x04"
function="0x0"/>
</controller>
<interface type="network">
<mac address="52:54:00:4a:54:81"/>
<source network="default"/>
<model type="virtio"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x03"
function="0x0"/>
</interface>
<channel type="unix">
<target type="virtio" name="org.qemu.guest_agent.0"/>
<address type="virtio-serial" controller="0" bus="0" port="1"/>
</channel>
<input type="mouse" bus="ps2"/>
<input type="keyboard" bus="ps2"/>
<graphics type="spice" autoport="yes" listen="127.0.0.1">
<listen type="address" address="127.0.0.1"/>
</graphics>
<video>
<model type="cirrus" vram="16384" heads="1" primary="yes"/>
<address type="pci" domain="0x0000" bus="0x00" slot="0x02"
function="0x0"/>
</video>
<memballoon model="virtio">
<address type="pci" domain="0x0000" bus="0x00" slot="0x06"
function="0x0"/>
</memballoon>
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
<address type="pci" domain="0x0000" bus="0x00" slot="0x07"
function="0x0"/>
</rng>
</devices>
<qemu:commandline>
<qemu:arg value="-fw_cfg"/>
<qemu:arg value="name=opt/org.flatcar-linux/config,file=/var/tmp/tftest-pool/tftest-mynode-ignition"/>
</qemu:commandline>
</domain>
> --
> You received this message because you are subscribed to the Google Groups "Flatcar Container Linux User" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to flatcar-linux-u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/flatcar-linux-user/d25c3be5-6b32-4c82-a5e1-a5dd6c39ad2en%40googlegroups.com.



--
Kinvolk GmbH | Adalbertstr.6a, 10999 Berlin | tel: +491755589364

Geschäftsführer/Directors: Benjamin Owen Orndorff

Registergericht/Court of registration: Amtsgericht Charlottenburg

Registernummer/Registration number: HRB 171414 B

Ust-ID-Nummer/VAT ID number: DE302207000

Karl Nordstrom

unread,
Jun 25, 2021, 11:39:50 AM6/25/21
to Flatcar Container Linux User
Kai,

# /usr/libexec/qemu-kvm --version
QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-175.el7_9.4), Copyright (c) 2003-2008 Fabrice Bellard

I wonder if I need a different version of qemu-kvm to support -fw_cfg.

I see the -fw_cfg in the flatcar_production_qemu.sh you mention.

if [ -n "${IGNITION_CONFIG_FILE}" ]; then
    set -- -fw_cfg name=opt/org.flatcar-linux/config,file="${IGNITION_CONFIG_FILE}" "$@"
fi

I'll take a look at the teraform approach

Kai Lüke

unread,
Jun 25, 2021, 12:01:33 PM6/25/21
to Karl Nordstrom, Flatcar Container Linux User
Yes, I'm afraid your version is too old, according to
https://download.qemu.org/ it was released 2013, that's 8 years ago.
> To view this discussion on the web visit https://groups.google.com/d/msgid/flatcar-linux-user/eb862409-1c52-48b3-9930-efbf1b8b0229n%40googlegroups.com.

Karl Nordstrom

unread,
Jun 25, 2021, 12:12:13 PM6/25/21
to Flatcar Container Linux User
I need a newer OS and maybe a newer server, too.

Thanks for your help

Karl Nordstrom

unread,
Jun 25, 2021, 3:10:44 PM6/25/21
to Flatcar Container Linux User
What is the minimum version of QEMU that is needed to install flatcar container linux?

I see this on Ubuntu 20.04.2 LTS

$ /usr/bin/qemu-system-x86_64 --version
QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.16)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

Kai Lüke

unread,
Jun 27, 2021, 6:27:48 PM6/27/21
to Karl Nordstrom, Flatcar Container Linux User
Looks good, the fw_cfg flag needs QEMU version >= 2.4, but of course
it's always good to have a version which still gets bug fixes.
> To view this discussion on the web visit https://groups.google.com/d/msgid/flatcar-linux-user/79d35ab2-518d-4688-aadf-eb7135be3285n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages