This is what I use to run QEMU on my M1 Air. I had a few bumps setting it up but now it runs flawlessly. I SSH to it via VS Code and basically I have a fully functional Linux dev environment with MacOS as the UI, just the way I like it. Honestly, I haven't been this excited about a new setup since Moore's Law was in effect :-)
QEMU is amazing. I run Linux, ans being able to dockerize Windows with it, and set up a selenium testing environment I can run locally or on CI servers is genuinely mind-blowing. Headless chrome, Firefox plus a windows in docker setup means pretty great automated test coverage without relying on third party infra.
It (QEMU) actually uses the older https://developer.apple.com/documentation/hypervisor apis which has lower level control. QEMU provides device emulation and Hypervisor.framework provides access to CPU’s virtualization hardware. Virtualization.framework is the new macOS 11 api that emulates the entire system but has much worse device emulation support and also lacks framebuffer emulation (I think)
I do this except the Linux is on a separate box and the dev envs are docker containers.
Decided to spend my money on decent, upgradeable hardware instead of shelling out 5k for another MB Pro. My next MacBook will probably be the most low-end I can get. VSCode's remote/docker support is a godsend. Seems like we're heading back to the dumb terminal paradigm.
Do you have your projects cloned in the remote host?
I ask because I was excited about this prospect only to learn that I could only use Remote: Containers if codebase and container are on the same machine as the project workspace is just volume-mounted in the container.
Yeah I dusted off an old licence I had for resilio sync and use that to sync with my local machine.
You can get around this by running git clone inside your container as part of the startup process. But 1. It can add quite a delay to starting a container depending on the size of your codebase, and 2. Not all of my code is necessarily committed and pushed. For me, syncing works well but I can see how it would not suit every use case
Also worth mentioning that UTM developers has been contribution patches to QEMU to get TCG (code emulation layer) to work under iOS / M1 Mac[1] as well (whereas I think TCG is still broken as of latest QEMU release due to mprotect[2]). So huge, huge thanks for this as well!
$ qemu-system-alpha -nographic
PCI: 00:00:0 class 0300 id 1013:00b8
PCI: region 0: 10000000
PCI: region 1: 12000000
PCI: 00:01:0 class 0200 id 8086:100e
PCI: region 0: 12020000
PCI: region 1: 0000c000
PCI: 00:02:0 class 0101 id 1095:0646
PCI: region 0: 0000c040
PCI: region 1: 0000c048
PCI: region 3: 0000c04c
>>>
This is a very nice frontend. Someone should definitely port it or rewrite it for Linux. All the existing UIs are either ugly or use libvirt, which is a nasty pile of hacks that has no place on a desktop machine.
Thanks but I think a port is virtually impossible as this was designed in SwiftUI and depends extensively on Apple APIs. GNOME Boxes is a good UI on Linux.
libvirt has put a lot of time into figuring out how to run QEMU in the most secure and performant way (specific low-privilege user, seccomp, all the right options for virtio, etc, etc). If you aren't using it then that's a lot of effort to reinvent, and you probably missed something out.
libvirt wasted a lot of effort into abstracting everything behind a ton of pointless hypervisor-agnostic cruft, only to then deprecate basically every single backend except QEMU.
I have used libvirt for almost a decade before going back to plain QEMU; I must say that using it from the CLI is an herculean task, you often have to edit plain XML in order to do whatever you want, and the cherry on top is that `virsh`is a huge pile of cow dung that often drags you into a Sisyphean fight against the aforementioned pointless abstractions - you find yourself configuring "domains" and "virtual networks" when you really only wanted to launch Windows to run Word. When I had to run stuff on a big server which only does VM, maybe with OpenStack and other orchestration systems on top, libvirt was often _fine_. I still use it in those use cases (I usually prefer Proxmox this day, though), it works fine, I can connect to remote instances using SSH and Virt-Manager and I like how it often just works. My use case, 90% of the time, is that I just want to run a damn Windows or FreeBSD VM on my workstation. I want to put disk images wherever I want because my root FS is small (often on ZVOLs, which are a big massive PITA to use with libvirt) without having to read a million different websites and man pages. I want it to work with my firewall configuration, which often changes due to the fact I have to do stuff with this machine, and I don't really care about 90% of the features of libvirt - I just want to run Windows every once in a while and I want my VMs to keep working without too much effort. Thus, I run plain QEMU with the following configuration, which took me a solid 10 minutes to perfect: - `nsbr0`, a bridge with a static IP configured using systemd-network; - `qemu-bridge-helper` set-up in order to attach taps to nsbr0 automatically, using `-netdev bridge` (echo 'allow nsbr0' > /etc/qemu/bridge.conf); - IP forwarding set to 1 and `masquerade` in nft.conf; - OVMF downloaded from my distribution's repos; - `spicy` to attach to a running VM; - a 30 line script that spawns QEMU in a tmux. If I want to configure a new VM, I just copy paste this shell script and I put it in a directory together with a copy of OVMF_VARS.fd for the efivars. Et voilà, I get VMs that just work, without having to wage any pointless battle against libvirt in order to get what I want. This is basically just a way to run KVM VMs that does not create a million firewall rules together with useless network interfaces, and doesn't force me to configure "storage pools" when the only thing I care about is running 2, 3 VMs max on my machine. There's a reason why VMWare sells both ESXi and VMWare Workstation, and why people still love VirtualBox despite how shitty it is. It's because more often than not something designed to run on servers is hardly be the best solution for a single user. The same features that make libvirt interesting on servers make it clumsy and overcomplicated on workstations, and the more I use it the more I realize it's true.
LXD recently added support for QEMU virtual machines in addition to its existing support for LXC containers, and it's almost completely replaced libvirt for me. It's great, pretty much just a matter of adding a `--vm` flag to normal `lxc launch` usage, e.g. `lxc launch images:debian/buster --vm`.
Thanks for creating this, it looks fantastic, I just bought it! I love that it's a nice layer over QEMU / Apple's Hypervisor, so i know the performance will be reasonable. One bit of feedback you might consider: Most of the VMs in your gallery are for ARM64, and the x86 one is quite an old version of Ubuntu. Would you consider making a couple more modern x86 versions? My requirement is to have an x86 VM for deployments to Lambda, cross compiling Rust using Docker on M1 simply doesn't work yet and I'm hoping your app will do the trick :) Thanks!
I have the same requirement, but ended up building the final bundles to lambda in the cloud instead. However I am quite excited about the new container image support for lambda meaning I guess you do not have to compile for musl anymore.
Comments (122) 35 threads
This is what I use to run QEMU on my M1 Air. I had a few bumps setting it up but now it runs flawlessly. I SSH to it via VS Code and basically I have a fully functional Linux dev environment with MacOS as the UI, just the way I like it.
Honestly, I haven't been this excited about a new setup since Moore's Law was in effect :-)
Continue this thread — 2 replies
Decided to spend my money on decent, upgradeable hardware instead of shelling out 5k for another MB Pro. My next MacBook will probably be the most low-end I can get.
VSCode's remote/docker support is a godsend. Seems like we're heading back to the dumb terminal paradigm.
Like a normal VPS but you can get dat 64 cores + 64gb ram only the day you need them and otherwise pay a low monthly fee.
Continue this thread — 2 replies
In this case it really is more than thousands of times more powerful.
I ask because I was excited about this prospect only to learn that I could only use Remote: Containers if codebase and container are on the same machine as the project workspace is just volume-mounted in the container.
You can get around this by running git clone inside your container as part of the startup process. But 1. It can add quite a delay to starting a container depending on the size of your codebase, and 2. Not all of my code is necessarily committed and pushed.
For me, syncing works well but I can see how it would not suit every use case
Continue this thread — 1 reply
Continue this thread — 1 reply
Hehem. The paradigm you're referencing is letting you do what you want to do (because it's a powerful paradigm). We need more of that if anything.
[1]: https://lore.kernel.org/qemu-devel/20210126012457.39046-1-j@...
[2]: https://lore.kernel.org/qemu-devel/161259505296.24527.772997...
https://bugs.launchpad.net/qemu/+bug/1914849/comments/3
Continue this thread — 1 reply
I have used libvirt for almost a decade before going back to plain QEMU; I must say that using it from the CLI is an herculean task, you often have to edit plain XML in order to do whatever you want, and the cherry on top is that `virsh`is a huge pile of cow dung that often drags you into a Sisyphean fight against the aforementioned pointless abstractions - you find yourself configuring "domains" and "virtual networks" when you really only wanted to launch Windows to run Word.
When I had to run stuff on a big server which only does VM, maybe with OpenStack and other orchestration systems on top, libvirt was often _fine_. I still use it in those use cases (I usually prefer Proxmox this day, though), it works fine, I can connect to remote instances using SSH and Virt-Manager and I like how it often just works.
My use case, 90% of the time, is that I just want to run a damn Windows or FreeBSD VM on my workstation. I want to put disk images wherever I want because my root FS is small (often on ZVOLs, which are a big massive PITA to use with libvirt) without having to read a million different websites and man pages. I want it to work with my firewall configuration, which often changes due to the fact I have to do stuff with this machine, and I don't really care about 90% of the features of libvirt - I just want to run Windows every once in a while and I want my VMs to keep working without too much effort.
Thus, I run plain QEMU with the following configuration, which took me a solid 10 minutes to perfect:
- `nsbr0`, a bridge with a static IP configured using systemd-network;
- `qemu-bridge-helper` set-up in order to attach taps to nsbr0 automatically, using `-netdev bridge` (echo 'allow nsbr0' > /etc/qemu/bridge.conf);
- IP forwarding set to 1 and `masquerade` in nft.conf;
- OVMF downloaded from my distribution's repos;
- `spicy` to attach to a running VM;
- a 30 line script that spawns QEMU in a tmux. If I want to configure a new VM, I just copy paste this shell script and I put it in a directory together with a copy of OVMF_VARS.fd for the efivars.
Et voilà, I get VMs that just work, without having to wage any pointless battle against libvirt in order to get what I want. This is basically just a way to run KVM VMs that does not create a million firewall rules together with useless network interfaces, and doesn't force me to configure "storage pools" when the only thing I care about is running 2, 3 VMs max on my machine.
There's a reason why VMWare sells both ESXi and VMWare Workstation, and why people still love VirtualBox despite how shitty it is.
It's because more often than not something designed to run on servers is hardly be the best solution for a single user. The same features that make libvirt interesting on servers make it clumsy and overcomplicated on workstations, and the more I use it the more I realize it's true.
Continue this thread — 5 replies
Continue this thread — 1 reply
All comments shown.
Couldn't load more comments. Check your connection and try again.