Midclt how to add kvm config options to modprobe?

It’s been a while so you propably found a solution in the meantime.
And I can feel your frustration as to find examples and docs about the midclt tool is not exactly trivial. I found out that:

  • What you are looking for is the “TrueNAS Websocket client” repo where the function and usage of the midclt tool is mentioned: GitHub - truenas/api_client
  • Where the API doc is linked here: TrueNAS Websocket Documentation. API reference can also be accessed from the TrueNAS WebUI in the top right corner: SCALE API Reference | TrueNAS Documentation Hub
  • Following the websocket documentation, I searched for “kernel” and found "kernel_advanced_options in both the system.advanced.config and system.advanced.update methods.
  • Putting 1+1 together I was able to set the values through the built-in shell:
# List advanced config and pipe to jq for readability:
midclt call system.advanced.config | jq
# List cmdline options
cat /proc/cmdline             
# Set extra kernel options:
midclt call system.advanced.update '{"kernel_extra_options":"kvm.ignore_msrs=1"}'
# Check advanced config change:
midclt call system.advanced.config | jq -r '.kernel_extra_options'
reboot now

Kernel params reference: The kernel’s command-line parameters — The Linux Kernel documentation Crucial part: “Module parameters can be specified in two ways: via the kernel command line with a module name prefix, or via modprobe.”

Hope this helps!

4 Likes