TIL That Flatpak apps can emulate non-native apps like Apple Rosetta. (TL;DR on bottom)


CORRECTION ON TITLE: Flatpak can emulate non-native apps like Apple Rosetta.

I never thought cross-architecture emulation was actually possible for Linux Apps, and thought, hey there's probably scope for that. So I tried to check whether an app compiled for ARM64 would work on my x86_64 system.

I found QEMU user-mode emulation but it seemed like it didn't work quite as well, as it seemed to need the target compiled shared libraries for the app to work, and was very difficult to get apps to run.So I thought: Hey, Flatpak apps obviously come bundled with it's own libraries. It could theoretically run it right? But it didn't work so I started an issue in the flatpak repo.

IT DOES SUPPORT EMULATION. You just have to install qemu-user-static and qemu-system-x86 from your repositories. And that's it. Flatpak manages everything else for you.

And I tried.

Not as fast as native, but that's an ARM64 app running on x86_64

I don't know if that was a normal thing in Linux but it definitely is cool that one can do things that Apple Rosetta does, with almost zero configuration for Flatpaks.

TL;DR: Rosetta like emulation on Linux? It already exists.


Proof that it's running on ARM64

uname -m from both host and flatpak

EDIT: For people who are telling me that Rosetta has more features. Yes. You're right. I only realised that this was LIKE Rosetta. I understand that Rosetta is built ground-up for this, while QEMU isn't, so Rosetta more probably would be faster than QEMU.

EDIT2: I don't know how the installation works on a non-native app for this, it might not even show up in the store app and you might have to download it from the command line, but the desktop entry for the said emulated app would show up in your app drawer regardless.

submitted by /u/gauthamkrishna9991
[link] [comments]