I would like to run an amd64 AlmaLinux 9 Virtual Machine on an arm64 (silicon) MacBook Pro with Vagrant (2.4.3) and Qemu (9.2.0).
Vagrant.configure(2) do |config|
config.vm.box = "almalinux/9"
config.vm.provider "qemu" do |qe|
qe.arch = "x86_64"
qe.machine = "q35"
qe.cpu = "qemu64"
qe.net_device = "virtio-net-pci"
qe.extra_netdev_args = "net=192.168.51.0/24,dhcpstart=192.168.51.10"
end
end
However with this configuration that uses the almalinux/9 vagrant box, it keeps hanging at the SSH step:
vagrant up --provider qemu
Bringing machine 'default' up with 'qemu' provider...
==> default: Checking if box 'almalinux/9' version '9.2.20230513' is up to date...
==> default: Importing a QEMU instance
default: Creating and registering the VM...
default: Successfully imported VM
==> default: Warning! The QEMU provider doesn't support any of the Vagrant
==> default: high-level network configurations (`config.vm.network`). They
==> default: will be silently ignored.
==> default: Starting the instance...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:50022
default: SSH username: vagrant
default: SSH auth method: private key
If I use the centos/7 vagrant box it just works:
vagrant up --provider qemu
Bringing machine 'default' up with 'qemu' provider...
==> default: Checking if box 'centos/7' version '2004.01' is up to date...
==> default: Importing a QEMU instance
default: Creating and registering the VM...
default: Successfully imported VM
==> default: Warning! The QEMU provider doesn't support any of the Vagrant
==> default: high-level network configurations (`config.vm.network`). They
==> default: will be silently ignored.
==> default: Starting the instance...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:50022
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
I tried to debug it, but can't figure it out. It seems like the SSH server drops or refuses the connection as soon as the client shares its protocol. The line "local is" is normally followed by a "remote is" line.
DEBUG ssh: == Net-SSH connection debug-level log START ==
DEBUG ssh: D, [2025-01-05T20:16:26.594185 #17157] DEBUG -- net.ssh.transport.session[b68]: establishing connection to 127.0.0.1:50022
D, [2025-01-05T20:16:26.594651 #17157] DEBUG -- net.ssh.transport.session[b68]: connection established
I, [2025-01-05T20:16:26.594676 #17157] INFO -- net.ssh.transport.server_version[b7c]: negotiating protocol version
D, [2025-01-05T20:16:26.594681 #17157] DEBUG -- net.ssh.transport.server_version[b7c]: local is `SSH-2.0-Ruby/Net::SSH_7.3.0 arm64-darwin'
DEBUG ssh: == Net-SSH connection debug-level log END ==
I also tried to directly login to the VM console with a serial connection to see at the server (VM) side what is going on. For CentOS 7 the debug instruction that is described at https://github.com/ppggff/vagrant-qemu#debug works. I can login as root to the VM console through a serial connection, like nc -U /Users/.../qemu_socket_serial
. The full path can be discovered for a running VM with ps -ef | grep qemu_socket_serial
. However that only worked after vagrant replaced the SSH keys and the VM is successfully booted. So with AlmaLinux 9 the serial connection also hangs.
The app UTM http://mac.getutm.app/ uses qemu for emulation. I am able to run an amd64 (x86/x64) VM with an AlmaLinux 9 OS minimal ISO on my arm64 silicon MacBook Pro. Of course emulation is slower than virtualisation, but it's so slow that the installation and configuration took more than one hour. After that the VM is booting at a decent speed. But I expect that several operations will still be pretty slow.
My UTM VM settings:
Hardware architecture: x86_64
System: Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-9.1) (q35)
Memory: 6144 MB
CPU: Default
CPU Cores: 8
Force Multicore: Checked/Enabled
JIT Cache: 4096 MiB