TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Apple Virtualization Framework

320 pointsby serhack_almost 2 years ago

22 comments

kdrag0nalmost 2 years ago
I use Virtualization.framework for OrbStack (<a href="https:&#x2F;&#x2F;orbstack.dev" rel="nofollow">https:&#x2F;&#x2F;orbstack.dev</a>), which is a Docker Desktop and WSL alternative.<p>It&#x27;s great overall, and fairly convenient, but it has a fair share of bugs and limitations. The Virtualization service crashes with various combinations of Linux kernel version, macOS version, and architecture (ARM&#x2F;Intel), so making it stable in each setup takes quite a bit of work. Device support is limited (no USB, etc.), and workarounds have other limitations. Rosetta is really buggy.<p>The popular belief is that Virtualization.framework is inherently faster&#x2F;lighter than other VMMs like QEMU, but I haven&#x27;t found evidence to back it up. I spent a day prototyping a custom VMM (with an open-source base) and was able to get <i>dynamic memory allocation</i> working [1], as well as faster file sharing in some cases. There&#x27;s a lot of other things I could do better (faster, simpler, more reliable) with a custom, tightly-integrated replacement.<p>But unfortunately, that&#x27;s not an option. Apple doesn&#x27;t allow third-party VMMs to set the necessary CPU flags for Rosetta. There are too many users relying on Rosetta for fast x86 emulation for me to ditch it, despite all its bugs.<p>So yes, I still use Virtualization.framework, but only because I have no choice.<p>Happy to answer other questions about the framework!<p>[1] <a href="https:&#x2F;&#x2F;twitter.com&#x2F;kdrag0n&#x2F;status&#x2F;1645645284721184768" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;kdrag0n&#x2F;status&#x2F;1645645284721184768</a>
评论 #36201663 未加载
评论 #36196617 未加载
评论 #36193042 未加载
评论 #36189881 未加载
jsd1982almost 2 years ago
Been using vftool to host docker instead of Docker.app. It&#x27;s been alright so far, got rosetta set up inside to run x86 images. All it takes is a little startup script and some up front work to prepare a disk image with Ubuntu server.<p>Every once in a while, the guest Ubuntu kernel will oops about smp related things. Every time it boots its clock is reset almost a month in the past and I have to force sntp to correct it. After sleeping the host, the guest clock will not advance so it&#x27;ll be behind several hours.<p>I&#x27;m not sure where to assign these issues: Ubuntu kernel? virtualization framework? vftool? bad configuration?
评论 #36185909 未加载
_joelalmost 2 years ago
Has there been a significant development? Been using it with <a href="https:&#x2F;&#x2F;mac.getutm.app&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mac.getutm.app&#x2F;</a> for a while
评论 #36184967 未加载
评论 #36184552 未加载
评论 #36184653 未加载
评论 #36184516 未加载
评论 #36184512 未加载
评论 #36185448 未加载
评论 #36184539 未加载
评论 #36189333 未加载
评论 #36185322 未加载
timsuttonalmost 2 years ago
Shameless plug for a couple blog posts I have written as explorations of the Virtualization Framework:<p>- Introduction when Monterey was released: <a href="https:&#x2F;&#x2F;macops.ca&#x2F;macos-monterey-apple-silicon-vms&#x2F;" rel="nofollow">https:&#x2F;&#x2F;macops.ca&#x2F;macos-monterey-apple-silicon-vms&#x2F;</a><p>- New features added in Ventura: <a href="https:&#x2F;&#x2F;macops.ca&#x2F;virtualization-updates-2022-06&#x2F;" rel="nofollow">https:&#x2F;&#x2F;macops.ca&#x2F;virtualization-updates-2022-06&#x2F;</a>
评论 #36189713 未加载
infosecbalmost 2 years ago
VirtualBuddy is a great open-source project that takes advantage of this framework: <a href="https:&#x2F;&#x2F;github.com&#x2F;insidegui&#x2F;VirtualBuddy">https:&#x2F;&#x2F;github.com&#x2F;insidegui&#x2F;VirtualBuddy</a>
评论 #36185161 未加载
评论 #36185458 未加载
eslaughtalmost 2 years ago
It&#x27;s kind of wild that Apple provides code samples you can use to directly create your own VMs. Has ended up being the most straightforward way to run virtualized macOS on a macOS host that I&#x27;ve found, and comes with the nice benefit that your can read the code yourself and fiddle with the knobs.<p><a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;virtualization&#x2F;running_macos_in_a_virtual_machine_on_apple_silicon_macs" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;virtualization&#x2F;run...</a>
评论 #36189373 未加载
antrodalmost 2 years ago
Please God let them use this to virtualize macOS inside iPadOS. Not as a daily driver but for the occasional use of a full desktop OS (when plugged into a keyboard&#x2F;mouse). Then I could stop traveling with two devices once and for all.
评论 #36185888 未加载
评论 #36185512 未加载
_salmost 2 years ago
<a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;videos&#x2F;play&#x2F;wwdc2022&#x2F;10002&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;videos&#x2F;play&#x2F;wwdc2022&#x2F;10002&#x2F;</a><p>^^ For the curious ones :)<p>More or less it&#x27;s an abstraction on top of Hypervisor to make VMs much simpler in Swift.<p>From what I remember, Docker tried to use this but suffered greatly on disk performance.
serhack_almost 2 years ago
I&#x27;m posting this because I&#x27;ve just found it. I&#x27;m trying to boot a custom toy kernel that I&#x27;m developing (with virtio support). Wish me good luck!<p>OSDEV rocks!
评论 #36184485 未加载
评论 #36189989 未加载
xrdalmost 2 years ago
I tried a bunch of different options and landed on multipass.<p>I&#x27;m curious whether someone has found a good option for running x86 images on m1 chips.<p>I&#x27;m generally happy with the multipass VMs I&#x27;m creating but they are arm architecture so then if i use docker images inside them I&#x27;m limited to arm images. Maybe I just haven&#x27;t explored how to run x86 correctly within multipass?<p>I&#x27;m finding that usually arm images are a step behind the x86 images if they are official, or they are built by someone outside the organization, so I&#x27;m never sure I&#x27;m using a safe image.<p>Do any of the options here make it performant to run x86 on apple silicon? Some interesting comments on Rosetta that I don&#x27;t fully understand.
评论 #36185224 未加载
评论 #36185094 未加载
评论 #36187569 未加载
vbezhenaralmost 2 years ago
Virtualization Framework is awesome and I&#x27;m slowly building my own VirtualBox-like app, learning Cocoa programming. Hopefully will release it some day.<p>One big thing that&#x27;s missing is better storage support. Right now it&#x27;s just disk image and that&#x27;s about it. No way to implement something like qcow2 with snapshots and whatnot. It&#x27;s missing a lot of opportunity for VMs.<p>Another big thing that&#x27;s missing is USB pass-through.<p>Other than that: it does absolutely everything I need. It even provides some kind of hook for network which should allow to build userspace router with any network architecture (didn&#x27;t try it myself, though, but I think it should work).<p>I was able to implement thing that I missed for years on M1 mac. Basically I run Fedora VM, I installed Rosetta helper inside, and docker. And then automagically my x86 images started to work with reasonable speed. I don&#x27;t know if Docker Desktop supports it already, I don&#x27;t want to touch it with a longest stick in the world. But for myself I solved this issue.<p>It was rock stable in my experience and just worked. qemu on the other hand managed to crash my entire macOS (hopefully that bug was fixed).<p>Another thing that I liked about it: protocols are &quot;modern&quot; and open-source. Almost every driver is virtio. No ancient cruft. No proprietary things. Eventually other operating systems could be run on this solution.
daneel_walmost 2 years ago
I suppose this is something else than the Hypervisor framework (<a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;hypervisor" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;hypervisor</a>) - its successor or a convenient complement? Does anyone know if there&#x27;s a convenient command line utility for wrangling VMs built on this framework?
评论 #36184784 未加载
Theophrastosalmost 2 years ago
Apple Virtualization Framework is a nice tool (option offered in particular by the UTM application in addition to Qemu option). And I hope it will improve with the release of the successor to Ventura and offer, for example, nested virtualization.<p>The only concern currently, besides for virtualized macOS the lack of support for iCloud accounts, is that it contains a number of bugs which make it difficult to use as is for non-English&#x2F;US configurations.<p>Thus, there is a bug with ISO keyboards, which are recognized by Apple virtualization framework as ANSI keyboards, which shifts or even makes a certain number of keys disappear (different depending on the language: French, German, Danish, etc.).
serhack_almost 2 years ago
Apple has updated the code to run macOS inside macOS. Now it can support recovering from previous saved states<p><a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;virtualization&#x2F;running_macos_in_a_virtual_machine_on_apple_silicon" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;virtualization&#x2F;run...</a>
villgaxalmost 2 years ago
Is there a headless mode to skip the BS when doing macOS VM or is something they think should only run on Apple Silicon alone?
Kalanosalmost 2 years ago
Where can we obtain a &quot;macOS restore image&quot; ? I imagine they are not as easy to come by as an Ubuntu ISO.
评论 #36186765 未加载
评论 #36185150 未加载
SergeAxalmost 2 years ago
This is not news, right? And there was not any significant updates recently? So it is upvoted just because, right?<p>This is not a rhetorical question, I am trying to understand if I missed something important.
评论 #36190098 未加载
olliejalmost 2 years ago
Is there something new here? I scanned through it briefly and couldn&#x27;t see anything
alphanullmericalmost 2 years ago
How similar to WSL2 is this?
评论 #36190112 未加载
RobotToasteralmost 2 years ago
Haven&#x27;t apple been spending a lot of money on lawyers trying to stop people virtualising OSX?
评论 #36185681 未加载
abdellah123almost 2 years ago
Can this run FreeBSD?
betimslalmost 2 years ago
This looks good.