macos icon indicating copy to clipboard operation
macos copied to clipboard

Nested KVM virtualization

Open Soluce-Technologies opened this issue 6 months ago • 7 comments

Operating system

Ubuntu 24.04

Description

I have this warning :

Warning: Nested KVM virtualization detected, this might cause issues running macOS!

The service start well, but then during the installation process after 1 min machine crash, mac os restart. I am unable to complete the installation.

Any idea ?

Running kvm-ok :

INFO: /dev/kvm exists
KVM acceleration can be used

Docker compose

name: macos-1

services:
  macos:
    image: dockurr/macos
    container_name: sonoma
    environment:
      VERSION: "14"
      RAM_SIZE: "32G"
      DISK_SIZE: "256G"
      CPU_CORES: "8"
    devices:
      - /dev/kvm
      - /dev/net/tun
    cap_add:
      - NET_ADMIN
    ports:
      - "8006:8006"
      - "5900:5900/tcp"
      - "5900:5900/udp"
      - "8022:22/tcp"


    volumes:
      - ./macos_sonoma:/storage
    restart: always
    stop_grace_period: 2m

Docker log

cezigue_sonoma  | ❯ Starting macOS for Docker v2.14...
cezigue_sonoma  | ❯ For support visit https://github.com/dockur/macos
cezigue_sonoma  | ❯ CPU: AMD EPYC Milan | RAM: 61/62 GB | DISK: 376 GB (ext4) | KERNEL: 6.8.0-56...
cezigue_sonoma  | 
cezigue_sonoma  | ❯ Building boot image...
cezigue_sonoma  | ❯ 
cezigue_sonoma  | ❯ Model: iMacPro1,1
cezigue_sonoma  | ❯ Rom: 0016cb19838d
cezigue_sonoma  | ❯ Serial: C02FCPYQHX87
cezigue_sonoma  | ❯ Board: C02109102J9JG36AD
cezigue_sonoma  | ❯ 
cezigue_sonoma  | ❯ Warning: Nested KVM virtualization detected, this might cause issues running macOS!
cezigue_sonoma  | ❯ Booting macOS using QEMU v10.0.0...
cezigue_sonoma  | 
=
=
=
BdsDxe: failed to load Boot0001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0xA,0x0): Not Found
cezigue_sonoma  | BdsDxe: loading Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
cezigue_sonoma  | BdsDxe: starting Boot0002 "UEFI Misc Device 2" from PciRoot(0x0)/Pci(0x5,0x0)
cezigue_sonoma  | #[EB|LOG:EXITBS:END] _
cezigue_sonoma  | #[EB.BST.FBS|-]
cezigue_sonoma  | #[EB|B:BOOT]
cezigue_sonoma  | #[EB|LOG:HANDOFF TO XNU] _
cezigue_sonoma  | ======== End of efiboot serial output. ========
cezigue_sonoma  |

Screenshots (optional)

No response

Soluce-Technologies avatar May 14 '25 22:05 Soluce-Technologies

+1

LuckyCoders avatar May 28 '25 16:05 LuckyCoders

+1

puraz avatar Aug 05 '25 01:08 puraz

I've the same warning but I'm running it on a virtualized host already so it's kind of expected. Are you running the container on bare metal?

Have you enabled svm (amd)/vmx (intel)? check: lscpu | grep Flags

lcruz99 avatar Aug 21 '25 13:08 lcruz99

It's working well on a bare metal instance.

RambokDev avatar Aug 21 '25 15:08 RambokDev

It's not adviceable to run the container inside a VM, but only on bare metal. Because it will introduce all kinds of weird issues, and thats why I print the warning in the log file when it detects such a setup.

kroese avatar Sep 18 '25 16:09 kroese

@Soluce-Technologies how did you install docker on your ubuntu machine? You would have to install the docker engine NOT Docker Desktop. "Docker Desktop on Linux runs a Virtual Machine (VM) ..." (https://docs.docker.com/desktop/setup/install/linux/)

To install docker engine: https://docs.docker.com/engine/install/ubuntu/

KNGP14 avatar Oct 01 '25 16:10 KNGP14

to solve that you add to you yml :
devices: - /dev/kvm:/dev/kvm - /dev/net/tun
privileged: true

privilege is needed

f4ieh avatar Oct 03 '25 12:10 f4ieh