You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

M2处理器下创建虚拟机提示KVM不可用的问题求助

Fixing "KVM is not available" on M2 Processor with QEMU/KVM

Hey there, let's get this KVM issue sorted out for your M2 chip. Since M2 uses ARM64 architecture, the KVM setup steps are a bit different from x86 systems—here's what you need to do:

1. Check for the correct ARM KVM modules

On ARM64 (like M2), the KVM kernel module isn't the x86-specific kvm_intel or kvm_amd—it's kvm_arm64. Your original lsmod | grep kvm command might have missed it because you were looking for the wrong module names.

  • Run this to check loaded modules:
    lsmod | grep kvm
    
    You should see both kvm and kvm_arm64 listed. If not, load them manually:
    sudo modprobe kvm
    sudo modprobe kvm_arm64
    
  • To make sure these modules load automatically on boot, create a config file:
    echo -e "kvm\nkvm_arm64" | sudo tee /etc/modules-load.d/kvm.conf
    

2. Verify hardware virtualization is enabled

M2 supports virtualization, but you need to confirm it's active in your system:

  • On Linux (e.g., Asahi Linux), run:
    grep -E 'hyp' /proc/cpuinfo
    
    If you see entries containing hyp, virtualization is enabled. If not, you may need to adjust UEFI settings (Asahi Linux enables this by default, but double-check if you've modified anything).
  • On macOS, check Hypervisor Framework support with:
    sysctl kern.hv_support
    
    A return value of 1 means it's enabled. If not, restart your Mac in Recovery Mode (hold Command+R), open Terminal, and run:
    csrutil enable --without-hypervisor
    
    Then restart normally.

3. Install the full set of virtualization tools

Your original sudo apt-get install kvm qemu command might have installed minimal packages. Install the complete suite to ensure KVM works properly:

sudo apt-get install qemu-system-arm qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager
  • Add your user to the necessary groups to avoid needing sudo every time:
    sudo usermod -aG libvirt $USER
    sudo usermod -aG kvm $USER
    
  • Log out and back in for the group changes to take effect.

4. Confirm QEMU can access KVM acceleration

Finally, verify that QEMU recognizes the KVM accelerator:

  • On Linux, run:
    qemu-system-aarch64 -accel help
    
    You should see kvm listed under available accelerators.
  • On macOS, run the same command—look for hvf (Apple's Hypervisor Framework, which QEMU uses as KVM equivalent on Apple Silicon).

When creating your VM, make sure you select "QEMU/KVM" as the connection type, and in the VM's settings, ensure hardware acceleration is enabled.

内容的提问来源于stack exchange,提问作者kp_regal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 16:35:12