cloud-init icon indicating copy to clipboard operation
cloud-init copied to clipboard

[docs]: add tutorial support for apple silicon

Open holmanb opened this issue 1 year ago • 2 comments

Documentation request

Filed in https://github.com/canonical/cloud-init/issues/4948, apple silicon doesn't work with the tutorial as given.

This command:

qemu-system-x86_64
-net nic
-net user
-machine accel=kvm:tcg
-cpu host
-m 512
-nographic
-hda jammy-server-cloudimg-amd64.img
-smbios type=1,serial=ds='nocloud;s=http://10.0.2.2:8000/'

gives this error:

qemu-system-x86_64: invalid accelerator kvm qemu-system-x86_64: falling back to tcg qemu-system-x86_64: unable to find CPU model 'host'

If I take out the -machine accel and -cpu params, it does start up.

The bug also references another issue, which has since been resolved. The documentation change should remove the -machine accel and -cpu params, if performance reduction is insignificant on x86_64. If performance makes this change untenable, consider making this command a tab which defaults to x86_64 and has another tab for apple silicon.

holmanb avatar Mar 12 '24 21:03 holmanb

With these instructions I got it working on MacOS with Apple Silicon, thanks!

@holmanb do you want help on adding some MacOS instructions to the getting started tutorial?

zomnium avatar May 14 '24 19:05 zomnium

With these instructions I got it working on MacOS with Apple Silicon, thanks!

I'm glad that you found it helpful!

@holmanb do you want help on adding some MacOS instructions to the getting started tutorial?

Help would be much appreciated!

holmanb avatar May 14 '24 22:05 holmanb

This is helpful indeed, we try to include everyone. The question is what is the right compromise to not write it out in detail many times, but at the same time be helpful to everyone.

I'm trying to throw out the options that will not work in TCG mode (whenever we are not on the native architecture) which will allow it to work, but might be slower.

I'll also add a hint that by changing image and command name to the one of the local architecture to gain back some speed. See PR #5540

cpaelzer avatar Jul 24 '24 15:07 cpaelzer