Linux Desktop on Apple Silicon in Practice This gist by user akihikodaki discusses enabling a practical Linux desktop environment on Apple Silicon (M1) Macs using a patched version of QEMU with graphics acceleration through Virgil 3D. --- Background The author purchased an M1 MacBook Air, a high-performance system, yet is a long-time GNOME/GNU/Linux user. Goal: To run Linux desktop on Apple Silicon practically. Existing Linux ports on Apple Silicon: Corellium: Obsolete. Asahi Linux: Improving but lacks features like graphics acceleration presently. QEMU can emulate ARM code efficiently using CPU virtualization but lacks macOS-optimized GPU acceleration. --- Approach The author hacked QEMU to enable graphics acceleration via Virgil 3D—a method exposing host OpenGL to the guest Linux. Virgil 3D was non-functional on macOS hosts initially; the author fixed this. Demonstration video: YouTube link --- Modifications Summary QEMU (ui/cocoa) Added OpenGL support. Enforced pixel-perfect display. Added cursor composition. Improved key mappings (e.g., Japanese IME keys). CoreAudio Fixed device change handling. Virgil 3D Renderer Enhanced OpenGL ES support. --- DIY Setup Instructions Open a terminal. Install dependencies via Homebrew: Create an empty working directory and enter it. Download and run the run.sh script to fetch and build QEMU and dependencies: Create a disk image: (Sparse, so actual space used depends on data written.) Download Fedora Silverblue ARM64 ISO: Install OS using: Launch Fedora with ./run. Note: Keyboard does not work until Linux boots because Apple's UEFI firmware (TianoCore) lacks virtio-keyboard support during the bootloader phase. --- Configuration Tips: Choosing OpenGL Profile Edit the run script to set the gl option: gl=off: Disable Virgil 3D GPU (most stable but slow). gl=core: Enable macOS OpenGL.framework backend (unstable). gl=es: Enable ANGLE backend (stable and fast). --- Upstreaming Status Work is ongoing for integration into upstream projects. Main patches are submitted for: libepoxy: anholt/libepoxy#239 QEMU: Patch search link Virgil 3D renderer: merge requests --- Insights and Discussion The modified QEMU is not secure since graphics acceleration code runs within the VM process, involving complex libraries like LLVM. Bugs can lead to guest takeover. vhost-user-gpu offers isolated acceleration but requires modifications for use outside Linux due to dependencies on Linux kernel features and eventfd. Virtualization provides a practical, efficient method to run Linux on Apple Silicon despite some complexities of resource sharing. Native Linux port (Asahi Linux) is the ideal long-term solution. --- Community Comments and Updates Users discuss performance improvements such as caching shaders in virglrenderer to reduce lag. Various build-related issues and solutions are shared, including: Patching and