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

Make it possible to set the accelerator for qemu #3173

Closed
wants to merge 1 commit into from

Conversation

afbjorklund
Copy link
Member

Similar to how you can override the cpu already

Closes #3156

@afbjorklund
Copy link
Member Author

Should the accelerator fallback to "tcg", if the default accelerator is not available?

For instance if /dev/kvm is missing on Linux, possibly because running in a VM

@jandubois
Copy link
Member

Is this really necessary? I know we say it is for "debugging", but you can already override QEMU settings with the QEMU_SYSTEM_X86_64 and QEMU_SYSTEM_AARCH64 environment variables. It is a bit clunky to use, but is this really a feature for more than a single user?

Having a whole matrix of accel types feels very overengineered for lima.yaml.

Same as with CPU types, this feels more like something that should go into a local config file, and not into the individual templates. Like we have $LIMA_HOME/_config/networks.yaml.

I understand that with this PR the setup can go into a $LIMA_HOME/_config/default.yaml, but I wonder if it is right to make the regular template schema more and more complex with settings that are not really instance-specific.

@afbjorklund
Copy link
Member Author

I think we always add the -accel flag even if kvm is missing, but I guess you can filter it out in a custom script wrapper

@jandubois
Copy link
Member

You can do this:

> export QEMU_SYSTEM_AARCH64="/opt/homebrew/bin/qemu-system-aarch64 -machine virt"limactl start --tty=false --vm-type qemu

WARN[0001] [hostagent] Specifying args ([-machine virt]) via $QEMU_SYSTEM_AARCH64 is supported only for debugging!
WARN[0002] [hostagent] Not adding QEMU argument "-machine" "virt,accel=hvf", as it conflicts with "-machine" "virt"

It then fails for reasons I don't have time to investigate right now, but the basic mechanism works: if you specify -machine in the environment, then it won't be added by Lima.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to run aarch64 guests on Linux without KVM
2 participants