News for hackers. Stuff that matters.
Re:UTM: An Apple hypervisor with some unique extra abilities by gorkish on Friday September 29, 2023 @01:41PM (#37707696)
UTM is pretty cool

QEMU's x86 emulation is outrageously slow compared to Rosetta2. Is it theoretically be possible to hook Rosetta2 for full x86 machine emulation (like oldschool vmware did before VT)?

Re:UTM: An Apple hypervisor with some unique extra abilities by toxik on Friday September 29, 2023 @01:51PM (#37707821)
AIUI Rosetta 2 works by translating as much of the code as possible ahead of time, so you don’t get delays translation happening online, and you get speculative execution etc.

IOW It won’t work on a VM.

Re:UTM: An Apple hypervisor with some unique extra abilities by tpetry on Friday September 29, 2023 @01:53PM (#37707854)
Last years macOS release added support for rosetta within linux vms.
Re:UTM: An Apple hypervisor with some unique extra abilities by zeusk on Friday September 29, 2023 @02:41PM (#37708482)
That's only for userspace apps. In fact even on Mac, only userspace code can be handled by rosetta2. For most applications this isn't a problem but a lot of games these days come with kernel components for anti-cheat.
Re:UTM: An Apple hypervisor with some unique extra abilities by pjmlp on Friday September 29, 2023 @03:03PM (#37708774)
Not on macOS, specially since Apple decided that in the long term only userspace drivers/extensions are allowed for third parties.
Re:UTM: An Apple hypervisor with some unique extra abilities by wtallis on Friday September 29, 2023 @02:50PM (#37708599)
I would be surprised if kernel-level third-party anti-cheat is a thing on macOS.
Re:UTM: An Apple hypervisor with some unique extra abilities by kergonath on Friday September 29, 2023 @03:35PM (#37709100)
I cannot imagine a game whose installation instructions start with “first, reboot your computer and disable SIP” would be very popular.
Re:UTM: An Apple hypervisor with some unique extra abilities by WatchDog on Friday September 29, 2023 @02:21PM (#37708194)
Re:UTM: An Apple hypervisor with some unique extra abilities by vbezhenar on Friday September 29, 2023 @01:55PM (#37707876)
I don't think that working with proprietary piece of code which is not even allowed to be used for anything but proprietary virtualization.framework is very interesting for those who can pull that kind of implementation.

Theoretically: why not? Kernel is not something drastically different from userspace. Sure, some rules are different, but I don't think that it's completely impossible to adapt Rosetta to the kernel.

But practically: I doubt it. qemu is not supporting even ordinary Rosetta, last time I checked, despite that fact that it should be pretty trivial to implement.

Re:UTM: An Apple hypervisor with some unique extra abilities by doctoboggan on Friday September 29, 2023 @02:00PM (#37707932)
"Docker Desktop for Mac" as the option to use rosetta 2 to run linux/amd64 containers on apple silicon Macs.
Re:UTM: An Apple hypervisor with some unique extra abilities by maxmouchet on Friday September 29, 2023 @02:18PM (#37708149)
Rosetta is used to run the amd64 binaries, but not the (arm) kernel of the Docker VM.
Re:UTM: An Apple hypervisor with some unique extra abilities by zeusk on Friday September 29, 2023 @02:43PM (#37708515)
> Theoretically: why not? Kernel is not something drastically different from userspace. Sure, some rules are different, but I don't think that it's completely impossible to adapt Rosetta to the kernel.

It's not impossible but very infeasible since kernel has critical sections where you can't take an interrupt or fault (leading to panic); such code sitting at the translation boundary would not work.

Re:UTM: An Apple hypervisor with some unique extra abilities by gorkish on Tuesday October 03, 2023 @01:35PM (#37755037)
This is why I mentioned "old vmware" which before VT handled these types of critical sections through an interpreting emulator while executing as many of the x86 instructions as possible unmodified. That is to say, they already did the hard part of breaking out the tricky bits. I was kind of hoping maybe QEMU had a similar strategy for x86-machine-on-x86-usermode without requiring virtualization extensions that could just be executed directly through rosetta (on macos or linux)
Re:UTM: An Apple hypervisor with some unique extra abilities by api on Friday September 29, 2023 @03:08PM (#37708825)
Parallels has a way to use Rosetta2 inside an ARM64 Linux VM to run x64 binaries, but it can occasionally be unstable. Usually works fine and way faster than qemu.
Re:UTM: An Apple hypervisor with some unique extra abilities by mook on Friday September 29, 2023 @03:13PM (#37708881)
As the other comment mentioned, it might be using the feature from hvf: https://developer.apple.com/documentation/virtualization/run...
Re:UTM: An Apple hypervisor with some unique extra abilities by cube2222 on Friday September 29, 2023 @03:10PM (#37708843)
I believe that is actually a recently-added feature of the Hypervisor.Framework, not sure if parallels uses it under the hood.

It's also been in Docker Desktop for a few months now, thanks to that.

Re:UTM: An Apple hypervisor with some unique extra abilities by saagarjha on Friday September 29, 2023 @02:59PM (#37708704)
UTM is a frontend to Apple’s Virtualization and QEMU, which itself can use Hypervisor when relevant
Re:UTM: An Apple hypervisor with some unique extra abilities by abujazar on Friday September 29, 2023 @03:13PM (#37708889)
UTM is awesome. I use it daily, but mostly for such plain and boring tasks as running arm64 linux VMs on Apple Silicon : )
Re:UTM: An Apple hypervisor with some unique extra abilities by dividedbyzero on Friday September 29, 2023 @03:33PM (#37709085)
I was able to get my old copy of Lightroom 4 to work using UTM to run Windows 11 ARM, then using Windows' equivalent of Rosetta to run the x86 Lightroom. Big fan of UTM, such a breath of fresh air coming from VirtualBox.
Re:UTM: An Apple hypervisor with some unique extra abilities by rado on Friday September 29, 2023 @03:36PM (#37709121)
I was surprised how much slower it is than Parallels (Arm Windows on M1). Could it be improved?
Re:UTM: An Apple hypervisor with some unique extra abilities by wpm on Friday September 29, 2023 @04:07PM (#37709483)
UTM is alright, but the GUI leaves a lot to be desired, which seems to be a commonality between desktop hypervisors; I have never liked Parallels and VMWare Fusion seems to be rotting on the vine and has its own equally baffling quirks. I would really like not having to shut down all of my VMs and close their windows to get the "library" window back open (shocker, some of us can and need to run more than one VM). I would really like to be able to see the settings of a VM, again, without having to shut down, find the library, and open the settings from there (yes, I know, I can't edit them while the VM is running, I still want to see the things!). It makes troubleshooting and complex configuration such a pain in the ass, that I usually give up.
Re:UTM: An Apple hypervisor with some unique extra abilities by glhaynes on Friday September 29, 2023 @09:13PM (#37711971)
Wow it really needs a Window > UTM (⌘O) menu. But in the meantime, try File > New… or Open… to get back to the "main" window.
Re:UTM: An Apple hypervisor with some unique extra abilities by dang on Friday September 29, 2023 @04:16PM (#37709601)
Recent and related:

UTM – Virtual Machines for iOS and macOS - https://news.ycombinator.com/item?id=37333404 - Aug 2023 (169 comments)

Re:UTM: An Apple hypervisor with some unique extra abilities by shantara on Saturday September 30, 2023 @02:17AM (#37713169)
I recently came across UTM when searching for a way to access a ext4 formatted SD card on macOS. Surprisingly, UTM with Arch VM was able to read and write the card through a USB card reader with zero friction or additional setup needed.