6 ms·
QEMU can use the MacOS virtualization framework layer to run a VM built for the same arch without going through any translation. From there you can register Ro
by Veliladon 4y ago
QEMU can use the MacOS virtualization framework layer to run a VM built for the same arch without going through any translation.
From there you can register Rosetta as a runtime and use it to run x86-64 Linux apps on ARM64 if you want. (https://developer.apple.com/documentation/virtualization/running_intel_binaries_in_linux_vms_with_rosetta?language=objc https://developer.apple.com/documentation/virtualization/run...)
- qeternity 4y agoWait, what? QEMU can pass x86 instructions directly to Rosetta without emulating an entire host OS?
- maattdd 4y agoIt does emulate the OS (it’s the point of running stuff in qemu ) but doesn’t translate the instructions
- jsjohnst 4y ago> It does emulate the OS (it’s the point of running stuff in qemu) The point of running stuff in qemu is to virtualize / emulate the hardware. You still need a “normal” OS inside qemu.
- dontlaugh 4y agoNo, QEMU runs an ARM VM. Inside that VM, Rosetta for Linux can be used to run x86 executables, just like on macOS.
- a-dub 4y agoso arm macbooks are still problematic for developers who use containers and x86 servers... it's still surprising to me that they did this as i always got the sense that developer word of mouth helped drive a lot of macbook adoption in the 2000s.
- mrunkel 4y agoIn what way? I use ARM containers locally to dev and test locally, check in the code and the build server creates an x86 image for deployment to the server. Worst case you have to build the ARM container yourself locally and tag it with the "remote" name and docker will just use it instead of pulling the remote version.
- a-dub 4y agoyou have to add support for your infrastructure to support building of everything for two architectures. sometimes problems are architecture dependent. if you have to use x86 containers for some reason, they will be dog slow because you'll be running the kernel under emulation and in userland rosetta won't help.
- cpuguy83 4y agoRosetta absolutely does help. You register rosetta (which can be mounted into the VM using macOS's virtualization framework) with binfmt_misc and your x86 binaries inside the VM will run through Rosetta.
- codedokode 4y agoI don't understand why one needs to emulate a virtual machine to run a container. Why do you need a kernel? Why emulate physical devices, interrupts and everything else? Why cannot one run a container as a protected mode application?
- sneak 4y agoBecause containers are at their heart a shorthand term for a bunch of Linux kernel features that do not exist on other OSes.
- anthk 4y agoContainers are just fancy Linux chroots. So you need a Linux OS.
- marwis 4y agoYou don't and that's the idea behind gVisor.
- pmontra 4y agoAdding to other answers, not only containers of the docker and LXC/D types are Linux things that need a Linux kernel but often the software inside the container must be deployed and run on a Linux host. Often the build is done on a Linux server in a CI system and not on developers machines but developers do have to run that software too, kind of by definition.
- saagarjha 4y agoIt’s difficult to emulate a kernel. You can try and there have been multiple attempts to do so with varying levels of success but most have pitfalls that people eventually run into.