Open darkn3rd opened 6 months ago
Please try the x86_64 example in the Readme.
For clarification, you are talking about Example 6? Example 4? or both? The docs are not clear if either of these examples are for running this on Macbook M-series (ARM64) or Macbook (Intel) host. Both of these examples do not have hvf
acceleration enabled, which is supported and works with QEMU on Macbook (Intel).
Additionally, I doubt that example 4 will work on Intel (trying it out now). The default settings do not work on Intel Macs. There should be intelligent defaults without the need for overrides.
centos/7
does not have qemu
listed as a supported provider, so vagrant up --provider=qemu
uses libvirt
provider.qemu
binary. I expected that (1) homebrew environment would be detected, (2) given homebrew environment search for HOMEBREW_PREFIX
env var, (3) if HOMEBREW_PREFIX
env var not found select path based on current arch, /usr/local/share/qemu
for Mac Intel host, /opt/homebrew/share/qemu
for Mac on Apple Silicon host. cat << EOF > Vagrantfile
# Example 4 form docs
Vagrant.configure(2) do |config|
config.vm.box = "centos/7"
config.vm.provider "qemu" do |qe|
qe.arch = "x86_64"
qe.machine = "q35"
qe.cpu = "qemu64"
qe.net_device = "virtio-net-pci"
end
end
EOF
vagrant up --provider=qemu
Example 4 as documented does fails on Intel Macs.
Invalid config.
Error: Invalid qemu dir: /opt/homebrew/share/qemu
qe.qemu_dir
override, but then with TCG accelerator used, it looks like this is for Apple Silicon. Ultimately with similar steps above, this passes. I wouldn't recommend using this, even for intelligent defaults on an Mac Intel host, as HVF should grant the highest performance under Intel.
TL;DR summary is that there should be an intelligent default solution path for macOS (Intel) to use HVF.
For the examples, separate from this issue, there should be clarity as to the host the example is appropriate for. Right it is vague and ambiguous, especially for those new to QEMU. As a suggestion, perhaps have examples that or organized per host. There may be some redundancy. Or if that is not welcomed, maybe having some text to show the type of host.
Thanks, I will try to make it more intelligent.
I wanted to try out this plugin on an Macbook (Intel), but it seems to crash/burn. There should be some intelligent defaults to use hvf on either Macbook M-series or Macbook (Intel).
For Homebrew environments, the
HOMEBREW_PREFIX
env var should be used.Also, the environment should be detected, as MacPorts can also easily support qemu with
sudo port install qemu
(ref) and uses different installation paths.Steps
Expected Results
I expected that the system would come up, as the
generic/ubuntu2204
image supports QEMU.Actual Results
Something has hardwired the Homebrew path for ARM64 binaries of
/opt/homebrew/
, and not the Intel_x86_64 binaries, which is/usr/local
. These can be resolved by using the $HOMEBREW_PREFIX.Other
qemu-system-aarch64
binary and uses invalid machines.virt
is not supported on intel.hvf
acceleration is supported.Stderr: qemu-system-x86_64: -device virtio-net-device,netdev=net0: No 'virtio-bus' bus found for device 'virtio-net-device'
I was able to get around some of this but inserting these defaults: