dockur / windows-arm

Windows for ARM in a Docker container.
MIT License
1.13k stars 107 forks source link

Any way to run on MacOS ? #11

Closed mmz06 closed 9 months ago

mmz06 commented 9 months ago

I installed docker, and Qemu, libvirt, but there is no Kvm ports for MacOS afaik... And the container stops with the following message:

% docker run -it --rm -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 dockurr/windows-arm

Unable to find image 'dockurr/windows-arm:latest' locally
latest: Pulling from dockurr/windows-arm
eed0d719505a: Pull complete 
31b07b5697c1: Pull complete 
ba02d43f4705: Pull complete 
40c62c6cfc08: Pull complete 
2d881a14a102: Pull complete 
3351de803db4: Pull complete 
f243655be2a5: Pull complete 
Digest: sha256:5cebed2e21525c4cc425f17c5c706cb69cbfe3d43bc240998ef1c1c6db96bc51
Status: Downloaded newer image for dockurr/windows-arm:latest
docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory.

So I removed the following parameter: --device=/dev/kvm

And then it fails while requiring to start with an option I'm not sure to understand:

% docker run -it --rm -p 8006:8006 --cap-add NET_ADMIN --stop-timeout 120 dockurr/windows-arm 
❯ Starting Windows for Docker v1.00...
❯ For support visit https://github.com/dockur/windows-arm

❯ Downloading product information from Microsoft...
❯ Downloading Windows 11 for ARM...
/storage/tmp/win11a 100%[===================>]   4.88G  38.3MB/s    in 2m 24s  
❯ Extracting Windows 11 for ARM bootdisk...
❯ Extracting Windows 11 for ARM environment...
❯ Extracting Windows 11 for ARM setup...
❯ Extracting Windows 11 for ARM image...
❯ Adding XML file for automatic installation...
❯ Building Windows 11 for ARM image...
❯ Creating a 64G growable disk image in raw format...
❯ ERROR: KVM acceleration not available (device file missing), this will cause a major loss of performance.
❯ ERROR: See the FAQ on how to enable it, or continue without KVM by setting KVM=N (not recommended).

Do you think about any solution ? Thank you !

kroese commented 9 months ago

MacOS has only support for HVF acceleration, and not for KVM. But this container does not support HVF (as of yet).

So you can run it without KVM, by adding -e "KVM=N" to your run command, so that you dont get the error. But the problem is that it will run very slow, so unless your Mac is very fast its not so useful Im afraid.

mmz06 commented 9 months ago

All right... Well at least now I know !🤓 Thank you for your answer !

8192K commented 8 months ago

Would be awesome to see it work for MacOS. Are you planning on supporting HVF?

kroese commented 8 months ago

@8192K The QEMU that comes with Debian is not compiled with HVF. So to support HVF I would need to compile a custom version of QEMU myself with HVF enabled. Even though that is not something that is impossible, I would rather not do that because it complicates to the whole build.

There are many good tools to run a VM on MacOS (like Parallels or UTM) so I am not sure the need for MacOS support is high. But if someone else submits a pull-request to add HVF support I might accept it.