Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel configs for VM images are missing useful settings #2987

Closed
Skirmisher opened this issue Dec 13, 2023 · 2 comments · Fixed by #3004
Closed

Kernel configs for VM images are missing useful settings #2987

Skirmisher opened this issue Dec 13, 2023 · 2 comments · Fixed by #3004
Labels
board/generic-aarch64 Generic aarch64 machine board/ova Open Virtual Appliance (Virtual Machine) bug hypervisor/kvm KVM related issues

Comments

@Skirmisher
Copy link

Describe the issue you are experiencing

A follow-on to #2909 in a sense—here's a couple kernel switches I noticed were lacking when setting up HAOS in libvirt, which would make sense to turn on (as modules) for VM-enabled configurations.

  • CONFIG_VIRTIO_MEMvirtio-mem allows for growing and shrinking VM memory allocation at runtime, in cooperation with the guest. It could be seen as an advanced successor to virtio-balloon, with true memory hot(un)plug that's far more flexible. Seems useful for experimenting with addons (one of the main motivations to run HAOS in a VM, I think!).
  • CONFIG_DMI_SYSFS (and/or CONFIG_FW_CFG_SYSFS) – Enables userspace access to SMBIOS tables (and, respectively, QEMU's fw_cfg user-defined values). Of interest is the SMBIOS Type 11 "OEM Strings" structure, which VMMs these days are using as a place for admins to provide arbitrary data to guests. systemd, as of v252, will read values for its credentials from here to pass to services that request them; some settings which HAOS admins might want to configure include network.hosts and ssh.authorized_keys.root (these are handled by systemd-tmpfiles-setup.service, which runs after local-fs.target is reached, so the hassos-bind.target mounts will already be set up at that point).
    • (systemd also reads credentials from fw_cfg, and has supported it for longer. However, it has several limitations and is QEMU-specific, so using it seems to be discouraged now, hence the "and/or". But on the other hand, throwing the module in only costs a couple dozen KiB uncompressed...)

What operating system image do you use?

generic-aarch64 (Generic UEFI capable aarch64 systems)

What version of Home Assistant Operating System is installed?

11.2

Did you upgrade the Operating System.

Yes

Steps to reproduce the issue

  1. Set up virtio-mem in libvirt for your HAOS VM
  2. Realize you forgot to check if the guest kernel is even configured for it
  3. Be sad when zcat /proc/config.gz | grep CONFIG_VIRTIO_MEM prints # CONFIG_VIRTIO_MEM is not set

Anything in the Supervisor logs that might be useful for us?

N/A

Anything in the Host logs that might be useful for us?

N/A

System information

No response

Additional information

No response

@Skirmisher Skirmisher added the bug label Dec 13, 2023
@sairon sairon added the board/ova Open Virtual Appliance (Virtual Machine) label Dec 19, 2023
@sairon
Copy link
Member

sairon commented Dec 19, 2023

Thanks for the suggestion (and nice issue summary!), I'm fine with adding these options. I'll follow up with a PR in a while.

@sairon sairon added the board/generic-aarch64 Generic aarch64 machine label Dec 20, 2023
sairon added a commit that referenced this issue Dec 20, 2023
Enable options that can be useful on virtualized systems as modules.

Fixes #2987
sairon added a commit that referenced this issue Dec 20, 2023
)

Enable options that can be useful on virtualized systems as modules.

Fixes #2987
@agners
Copy link
Member

agners commented Dec 20, 2023

ssh.authorized_keys.root (these are handled by systemd-tmpfiles-setup.service

I wonder if this will be working out of-the-box with HAOS 🤔 If not, would be nice to get it to work.

@agners agners added the hypervisor/kvm KVM related issues label Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board/generic-aarch64 Generic aarch64 machine board/ova Open Virtual Appliance (Virtual Machine) bug hypervisor/kvm KVM related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants