11 ms·
Tart: VMs on macOS using Apple's native Virtualization.Framework
- autoexecbat 3y agoI do like the idea of using container registries for VM images
- mikepurvis 3y agoI set up a workflow at $DAY_JOB for building the rootfs as a container and then "promoting" it to a vmdk and creating the ovf metadata file to allow it to be imported into VMWare as its own machine. This was ~3 years ago and at least at the time I was annoyed at how little established tooling there seemed to be for doing an appliance image build offline— everyone was just like "why? Boot some public cloud-init template and use that as the basis for your terraform/ansible/whatever. If you actually need an OVF then export it from VMWare and be done with it." On the other hand, once I got down in the weeds with things, I did find there were some bits that were a bit hairy about the promotion process— especially with "minimal" containers that have no users or init system, not to mention of course no filesystem, kernel, or bootloader, there is a fair bit that you have to do with a typical container to ready it for becoming a real boy.
- photonbeam 3y agoCould put everything into the image - I mean the registry for just storage/transmission rather than reusing pre existing minimal container images
- TylerE 3y agoNow if only there was a simple solution for running z X86/64 vms.
- olliej 3y agoThe whole point of virtualization is you're running as close as possible to directly on native hardware. That's literally what makes virtualization distinct from emulation for VMs. If you're trying to run an x86 client OS you need an emulator, there's just no way around it. If you just have some x86 binaries and don't actually need a full x86 OS, they've made rosetta available for client linux VMs.
- edgyquant 3y agoYour terminology is off and you seem to be talking about a hypervisor or something. Virtualization is just virtualizing computer hardware and emulation is one way to do it
- dijit 3y agoSorry, I'm not sure what's going on here, I replied to another comment about this and there's multiple people stating that (s)he's thinking of containers. I think we have collective amnesia about what virtualisation actually is and why it's distinct from containerisation. Virtualisation is absolutely about "skipping" parts of the emulation chain to do direct calls to the CPU in a way that does not need to be translated; in this way it gets much closer to the hardware. Containerisation was considered faster still because instead of even having the 5% overhead not being able to use the same process scheduler in the kernel; you can share one. Yes, containers are able to execute faster than VMs, but the parent is absolutely right that the entire point of virtualisation as a concept was to get closer to the CPU from inside an emulated computer.
- hnlmorg 3y ago…or they edited their post afterwards ;) I’ve been using containers for decades on FreeBSD and Solaris, long before Linux ever caught on. And virtualisation even longer. In fact I have fond memories of using the first version of VMWare (which was a literal emulator at that point because x86 didn’t support virtualisation back in 1999) to run Windows 2000 from Linux. So, like the others who responded, I definitely know the difference between virtualisation and containerisation.
- dijit 3y agoYou have a similar background to me; though I used Zones on Solaris before Jails on FreeBSD. I also used VMWare when it was an emulator and hated how abysmally slow it was
- 3y ago
- therealmarv 3y agoMaybe not a 100% fit but since Docker 4.25 they run X86/64 binaries with Rosetta 2 which should offer near native performance https://www.docker.com/blog/docker-desktop-4-25/ https://www.docker.com/blog/docker-desktop-4-25/
- zamalek 3y agoI was considering similar approach were I still stuck with Apple for work: make a Firecracker OCI runtime for MacOS. Fortunately Intune for Linux came around before I had to resort to that.
- duskwuff 3y agoVirtualization.framework does most of the things Firecracker does on Linux. It's not literally the same, of course, but it does a comparable amount of the work for you. Here's an example application which uses it: https://github.com/apinske/virt/blob/master/virt/virt/main.swift https://github.com/apinske/virt/blob/master/virt/virt/main.s... And yes, that's really the whole thing. Once the VM is configured (which is what most of the code is concerned with), running it is fully handled by the framework.
- zamalek 3y agoFirecracker is also the distro that makes assumptions (and therefore boot time wins) about being run inside the Firecracker VMM, as far as I understand it. You'd also need the OCI runtime, and a Docker-compatible socket would make tons of sense.
- 0x69420 3y agoheads up: it's under one of those BSL-esque weirdo licenses [1] parameterised on seats and, get this, a seat is defined as a single CPU core (if you are not an individual). so don't get any ideas about running it on more than 5 mac studios if you're a university that wants to run CI for some open-source project along with those mirrors. [1]: https://fair.io/?a https://fair.io/?a
- lxgr 3y ago> What counts as “using” Fair Source licensed software with respect to the Use Limitation (e.g., 25-user limit)? > The license doesn’t define “use” exactly because the way people deploy software changes all the time. Instead, it relies on a common-sense definition. For example, executing the software, modifying the code, or accessing a running copy of the software constitutes “use.” Appealing to common sense for a critical definition in a binding license agreement? What could go wrong!
- jxy 3y agoI don't know what the intended audience is. But for managing many instances among a few mac studios, it's much better to invest an afternoon to get the right qemu command and just use that, instead of all these fancy UIs.
- deleted 3y ago[deleted]
- navojoe 3y agoI tried the ubuntu lastest image, but don't know what user and password use to log into. Any idea?
- fragmede 3y agocreativity, should be user ubuntu pass ubuntu
- pritambarhate 3y agoIf you just need Ubuntu then you can try "Multipass" from Canonical (https://multipass.run/ https://multipass.run/). Works quite well on my M2 Air. I haven't tried using Linux GUI with it though as I need only terminal based VMs.
- isodev 3y agoI don't get it - why would one pay for something that comes for free on every Mac? Bootstrapping one in Swift is quite straightforward and there are a number of tools and apps (with UI) like virt (https://github.com/apinske/virt https://github.com/apinske/virt)
- duskwuff 3y agoI guess their selling point is the container registry?
- naikrovek 3y agoThis tool used to be open (AGPLv3 for some reason; it’s not a network service) and they changed to this crap license once they realized they had something good. The AGPL version is available in homebrew.
- fkorotkov 3y agoRealization for the license change was a bit different. From day 1 we knew Tart is good and hoped to build a healthy ecosystem around it. Unfortunately, our enthusiasm wasn't met by big companies. You can check this blog post for more details https://tart.run/blog/2023/02/11/changing-tart-license/ https://tart.run/blog/2023/02/11/changing-tart-license/. The free usage is pretty generous: free on any amount of personal computers including personal workstations and up to 100 cores (12 Mac Minis) when installed on servers. If your organizations needs a bigger installation then it's probably values the product and can budget out a little bit to support it.
- olliej 3y ago[addendum: per u/pm215 Hypervisor.Framework does still apparently exist and supported on apple silicon apparently, I assume the absence of hardware docs just makes it miserable. OTOH maybe the Asahi GPU drivers, etc can work in that model? I really haven't ever done anything substantially more than what the WWDC demos do so am not a deep fount of knowledge here :D, to avoid confusion with replies I have not edited or changed my original comment. I kind of wish that HN UX exposed edit histories for comments, or provided separate addendum/correction options] Virtualization.Framework is how you have to do virtualization on apple silicon as it is the userspace API layer that interacts with the kernel. There is no API you can use. Virtualization.Framework is pretty much everything you need out of the box for a generic "I have an isolated virtual machine" model, basically it's just missing a configuration UI and main() There are a couple of WWDC sessions over the last few WWDCs on using the framework, configuring rosetta, and improvements in the 2023 OS update https://developer.apple.com/videos/play/wwdc2022/10002 https://developer.apple.com/videos/play/wwdc2022/10002 https://developer.apple.com/videos/play/wwdc2023/10007 https://developer.apple.com/videos/play/wwdc2023/10007 [1] commercial VM products probably require more work to compete in the market, things like the transparent desktop, window hosting, etc
- Someone 3y agoApple also documents the Virtualization framework fairly well at https://developer.apple.com/documentation/virtualization https://developer.apple.com/documentation/virtualization, with links to various code samples. For example, https://developer.apple.com/documentation/virtualization/running_linux_in_a_virtual_machine https://developer.apple.com/documentation/virtualization/run...: “This sample configures a virtual machine for a Linux-based operating system. You run the sample from the command line, and you specify the locations of the Linux kernel to run and initial RAM disk to load as command-line parameters. The sample configures the boot loader that the virtual machine requires to run the guest operating system, and it configures a console device to handle standard input and output. It then starts the virtual machine and exits when the Linux kernel shuts down.”
- stuff4ben 3y agoInteresting! I really need a cheap way to spin up an Apple Silicon container to create binaries for an open source project on GitHub. I don't want to spend money on an Apple Silicon runner in GitHub and I also don't want to run the build directly on my M2 MacBook Pro along with my other development work.
- codetheory 3y agoJust use lima. https://lima-vm.io/ https://lima-vm.io/ You have an option to use Native or QEMU.
- dijit 3y agoOr, if you're doing containers (like Tart/Virt): colima. (which uses lima, of course). https://github.com/abiosoft/colima https://github.com/abiosoft/colima
- deleted 3y ago[deleted]
- otherjason 3y agoFrom a quick look at Lima, I don't think it's exactly the same thing. Tart allows running macOS and Linux VMs, while Lima seems focused on Linux VMs only. I don't use Tart, but having infrastructure-as-code-like tooling that can be used to define macOS environments (and store the VMs in container registries) sounds useful and I'm not aware of another solution that does it.
- latexr 3y agoDoes Lima only support Linux guests? The page seems to suggest so. Tart supports macOS guests too.
- jamifsud 3y agoAre there any similar open source tools that allow you to manage MacOS VMs? I'm aware of Lima / Colima but it seems they're for Linux only.
- lloeki 3y agoUTM maybe? https://mac.getutm.app https://mac.getutm.app
- shoo_pl 3y agoYes, there is VirtualBuddy and Viable (not sure if this one is Open Source): - https://github.com/insidegui/VirtualBuddy https://github.com/insidegui/VirtualBuddy - https://eclecticlight.co/virtualisation-on-apple-silicon/ https://eclecticlight.co/virtualisation-on-apple-silicon/
- alwillis 3y agoI’d look at https://eclecticlight.co/virtualisation-on-apple-silicon/ https://eclecticlight.co/virtualisation-on-apple-silicon/
- d3w4s9 3y agoSerious question: how far can you go with base model's 8GB RAM? Doing VM workflows is one reason I didn't bother with recent Macbooks, as nice as they are. It is simply much cheaper to get a machine with removable RAM and then upgrade them later. Without going there, I can also build a decent ThinkPad T14 with 32GB for around $1,100 even though RAM is soldered.
- mattl 3y agoI can edit video in Final Cut Pro on my 8GB M1 Mac Mini while doing other things.
- foofie 3y ago> I can edit video in Final Cut Pro on my 8GB M1 Mac Mini while doing other things. I can't use IntelliJ or vscode with autocompletion on a 2023 MacBook Air with 8GB of RAM with a bunch of my projects. The same projects run like a breeze on a cheap and very crappy Beelink minipc with 16GB of RAM whose total cost is lower than a RAM upgrade on a MacBook Air.
- mattl 3y agoI'm curious if a native editor like Panic's Nova or BBEdit would work better than a Java or Electron app?
- bluish29 3y agoBbedit is a a lightweight editor compared to Intellij IDE. It is hard to compare both as they are on the same foot. But yes, if you can work with BBedit on a project go for it. On the same note, sublime will still win editor performance competition on Mac and probably all platforms.
- CharlesW 3y ago> I can't use IntelliJ or vscode with autocompletion on a 2023 MacBook Air with 8GB of RAM with a bunch of my projects. That's surprising. (More developer anecdata: https://duncsand.medium.com/is-apples-cheapest-macbook-good-enough-for-a-developer-a669ba173ebd https://duncsand.medium.com/is-apples-cheapest-macbook-good-...) Still, I'd absolutely recommend that devs and other creators spend the extra $200 for 16GB. And yes, it's outrageously priced in comparison to buying matched sticks for your PC.
- bradgessler 3y agoI'm curious why file system performance from the VM through the hypervisor to the host is so slow on macOS. Is this some sort of fundamental limitation or is it a case of "Apple hasn't made this a priority"? My knowledge could be out of date and maybe this is fixed, but I've tried using Docker on macOS and it's almost unusable for dev environments with lots of files because of the file system performance.
- JonathonW 3y agoHow recently have you tried it? The current best-performance option for bind mounts in Docker Desktop on macOS (VirtioFS, using Hypervisor.framework) didn't become the default until June (for new installs) or September (for existing installs), and wasn't available at all prior to December 2022.
- bradgessler 3y agoI haven't tried it on a large project recently. How good is it?
- 9dev 3y agoBetter, but still a pain. Nothing compared to running Docker on Linux.
- ithkuil 3y agoBut docker on Linux doesn't involve any virtualization whatsoever so filesystem performance is 100% native
- jbverschoor 3y agoHave you tried OrbStack?
- omederos 3y agoDid you have VirtioFS enabled when you tried it?
- jtotheh 3y agoI've been using UTM, it seems to work OK. I use arm64 images, I haven't tried x86_64 images. Works for Windows and Debian.
- treesknees 3y agox86_64 runs using QEMU for emulation, and it's incredibly slow. I'd call it practically unusable.
- vsgherzi 3y agoHard agree, it does a decent job emulating an x86 container. However Angular builds were still painfully slow.
- Cu3PO42 3y agoFor running an x64 container, I'd recommend running aarch64 Linux and then running the container using Rosetta 2, that yields significantly better performance than running everything through QEMU.
- dreamcompiler 3y agoWait what? I thought Rosetta 2 only worked in MacOS? Where does aarch64 Linux fit in this picture?
- ThomasBb 3y agoSee https://developer.apple.com/documentation/virtualization/running_intel_binaries_in_linux_vms_with_rosetta https://developer.apple.com/documentation/virtualization/run...
- Arathorn 3y agoCoincidentally I set this up last night under UTM (https://docs.getutm.app/advanced/rosetta/ https://docs.getutm.app/advanced/rosetta/) and it worked astonishingly well. Outside of Rosetta, the native virt seemed a bit slower than whatever UTM does normally, but perfectly usable on my M1 MBP.
- lupinglade 3y agoAlso check out https://www.getvmtek.com https://www.getvmtek.com for something very polished. We just released a huge update a few days ago.
- matrix_overload 3y agoKind of a dark pattern to hide the license price (last line in the AppStore page -> in-app purchases). Should be really prominently shown on the "buy now" page. Also the features page is garbage. Wall of text with fairly generic stuff while it's still unclear: Can it run Windows? Can it run Linux? Arm64, x64 or both? MacOS? Your main competition is VMWare Fusion and Parallels. See what features they advertise, make sure you are better and cheaper. Currently it looks like a university project rather than a real product.
- lupinglade 3y agoIt is a webpage that was quickly put together. We are a small company and our focus has been on the product. You can run Linux and macOS currently. That is listed on the features page as well as the app store product listing. There is no dark pattern, it is actually a problem with the way Apple allows developers to sell software on the Mac App Store. We don't have proper control over the process and thus end up with this convoluted purchasing system that is more geared towards subscriptions - which are the real dark pattern nowadays. We sell without any subscriptions - at a very fair price that is extremely competitive with other products. The old upgrade pricing model was a lot more fair to both developers and users and we are sticking to it. This is the only way to offer a free trial on the App Store without requiring a separate installation, which would be inconvenient for everyone. Far from a university project - but your opinion is yours to keep. It is a shame you are so negative, as it really is a labour of love and a quality Mac app. In fact we have a lot of firsts here, no one has really done a lot of these things (snapshots, suspend & resume, proper dynamic resolution with retina support) with the new Apple framework yet.
- tambourine_man 3y agoIs there a modern easy GUI that allows snapshots without reaching for QEMU?
- lupinglade 3y agoYes, VMTek does snapshots natively and takes advantage of APFS. We have a great graphical snapshot UI as well.
- tambourine_man 3y agoInteresting, thanks. I was looking for an open source solution though, sorry for not specifying.
- Khaine 3y agoDoes VMTek support *BSDs (i.e. FreeBSD / OpenBSD)
- deleted 3y ago[deleted]
- ramon156 3y agoHas no one here heard of mutagen before? It solves our performance issue regarding syncing
- emmanueloga_ 3y agoOrb also runs linux machines, a feature I miss for the first few weeks of using it! https://docs.orbstack.dev/machines/ https://docs.orbstack.dev/machines/
- naikrovek 3y agoTart runs Linux virtual machines as well. It is an excellent tool.
- pseufaux 3y agoI've been experimenting with tart recently as a means of spinning up quick test environments for management workflows. I've been pleasantly surprised. There's nothing seemingly special under the hood. It's just a cli wrapper around Apple's virtualization framework, but the UI is clean and the basic workflow to get from a IPSW to running VM is very straightforward.
- naikrovek 3y agoTheir “special sauce” is a well thought-out cli interface. It’s easy to understand, easy to remember, and the things one would need are implemented. There are many other tools on GitHub which use Apple’s virtualization.framework to do this, but their UX is all horrific compared to tart.
- fkorotkov 3y agoAlso want to note availability of GitLab Executor, Buildkite plugin and many more integrations for all kinds of workflows.
- david_wpg 3y agoAs a Mac Systems Administrator, I have extensive experience with Tart, having been an early adopter. My role involves rigorously testing various aspects of Mac systems, such as settings, scripts, workflows, and software deployments. Tart has been instrumental in this process, particularly due to its capability to swiftly set up virtual machines (VMs). A key feature I frequently utilize is booting a VM's macOS into Recovery OS, which allows me to disable security settings. This step is crucial for enrolling devices in DEP, despite manual registration being a different process. By disabling SIP, I can activate specific flags that enable DEP-like features.
- cjbprime 3y agoDoes anyone know if GPU passthrough is available in any kind of macOS guests? I was hoping to run fast LLM inference in containers or virt guests.
- fkorotkov 3y agoThere is a paravirtualized GPU available to macOS hosts. But it’s a bit limited and might not work for LLMs but worth trying since it might work.
- cjbprime 3y agoAPPROPRIATELY-SIZED WARNING: The website and GitHub repo do not make it immediately obvious that this project isn't open source* and that if you use it at work your company may have a bad time. *: https://opensource.org/osd/ https://opensource.org/osd/ I wonder if we could add something like crowd-voted tags to submissions, to include e.g. the license for software that has a GitHub link.
- amanzi 3y agoSeemed pretty obvious to me after looking at the "Support & Licensing" section of the website. They explain it in clear terms.
- wredue 3y ago[flagged]
- w10-1 3y agoLICENSE file in the repo is also pretty clear in its intended limitations. However for the license to be effective it probably needs to be rewritten to handle agents of organizations. As it reads now, arguably 30 employees could deploy the software on 500 6-core mac's without violating the license.
- Dalewyn 3y agoIf you obtain and use software for commercial purposes without checking the licensing and usage terms, you need to grab a lawyer and have him give you a crash course at your leisure before some lawyers come knocking to give you a crash course at their leisure.
- taspeotis 3y agohttps://tart.run/licensing/ https://tart.run/licensing/
- xyst 3y agoLicenses like this inspire me to recreate it from scratch and redistribute under open source. Some would call this a “race to the bottom” but I see it as doing my part to contribute to chaos
- a1o 3y agoHey, big shout to CirrusLabs and the CirrusCI people because it's the coolest CI. Edit: CirrusLabs is the org behind Tart I believe.
- cedws 3y agoInteresting that the macOS images are publicly available from GHCR. I would've thought that would cause legal problems. As for storing images in an OCI registry, I can't quite tell if Tart is layer-aware. If you pull a macOS image, modify it, and push it back to the registry, will Tart simply push a new layer with modifications? I'm guessing this isn't possible.
- fkorotkov 3y agomacOS EULA has some special wording around "Permitted Developer Services" allowing more flexibility: > Permitted Developer Services means continuous integration services, including but not limited to software development, building software from source, automated testing during software development, and running necessary developer tools to support such activities. As for layering, Tart doesn't support it at the moment. It seems APFS is not particularly good for layering but Tart uses sparsed files when storing VMs locally. Sparsed disk image file basically "skips" zero bytes which saves a lot.
- david_wpg 3y agoI adore tart. I've used it over a year for work. It works very well with Cirrus Labs' images.
- stillworks 3y agoCan this be used to setup a dev Linux VM ? Run Jetbrains IDEs etc on the VM ? And if I were to run PyTorch then will it have access to GPU / MPS ?
- fkorotkov 3y agoYou can setup a Linux dev VM but unfortunately it won’t have access to the GPU. There is Rosetta 2 support though which works brilliantly with amd64 binaries.
- jbverschoor 3y agoWhat's the relationship with Veertu/Anka? The FAQ talks about Anka a lot.
- fkorotkov 3y agoInitially there were a lot of interest from Anka users to migrate to a more scalable and DX friendly tool. That’s why FAQ started with comparison. In a nutshell these tools are similar but taking different approaches for the same problems: OCI registries vs own implementation, CLI first vs REST oriented, Packer/VNC vs own scripting, etc.
- sam_goody 3y agoCan Tart be used with Vagrant?
- fkorotkov 3y agoPlease check out and comment on this issue. There is some movement around but primary it’s waiting for the new promised Vagrant version in Go. https://github.com/hashicorp/vagrant/issues/12760 https://github.com/hashicorp/vagrant/issues/12760