Home Topic Embedded/IoT Google’s Fuchsia Adds Emulator for Running Linux Apps

Google’s Fuchsia Adds Emulator for Running Linux Apps

Google’s Fuchsia Adds Emulator for Running Linux Apps

Google has added a Guest app to its emergent and currently open source Fuchsia OS to enable Linux apps to run within Fuchsia as a virtual machine (VM). The Guest app makes use of a library called Machina that permits closer integration with the OS than is available with typical emulators, according to a recent 9to5Google story.

Last month, Google announced a Project Crostini technology that will soon let Chromebook users more easily run mainstream Linux applications within a Chrome OS VM. This week, Acer’s Chromebook Flip C101 joined the short list of Chromebooks that will offer Linux support later this year.

While it’s encouraging that Chrome OS will soon support Linux apps is addition to Android, it’s not entirely surprising — since Android and Chrome OS are based on Linux. Yet, one of the first things Google emphasized when it revealed Fuchsia in 2016 was that it’s not based on the Linux kernel.

To some, Fuchsia seemed to be something of a betrayal considering how Linux not only forms the basis for Android and Chrome OS but also the Google enterprise platforms. Why add another Windows or iOS when we were getting so close to everyone sharing a common Linux foundation?

No doubt, Google has some very good reasons for avoiding Linux. One reason may be the age and complexity of Linux. By starting from scratch, Google can escape that aspect and deliver more elegant, up-to-date code with fewer targets for hackers. Google is also baking secure updates deeply into the OS, and unlike Linux, is isolating applications from having direct kernel access.

Open for now

Back in 2016, we thought Google might be skipping over Linux to shift to a proprietary OS that it could control the way Apple dictates all things iOS. That may still happen, but for now Fuchsia is an open source project.

Some also speculated at time that considering the trim little microkernel, Google was bypassing Linux due to its inability to scale downward into the MCU realm. Yet, MCU-based IoT does not appear to be the current focus of Fuchsia. Several reports, including a TechRadar post last week, have said that Fuchsia is intended to replace both Android and Chrome OS, and the combined platform will eventually be called Google Andromeda.

Earlier this year, 9to5Google reported that Fuchsia would include separate UIs — an Armadillo UI for phones and a Capybara UI for desktops — and like Android Things and other new Android variants, would tightly integrate Google Assistant voice technology. Essentially, this is the same idea that was behind Microsoft’s failed plan to offer a common Windows for phones and laptops, or Canonical’s defunct “convergence” version of Ubuntu.

Guest ex Machina

Whatever Fuchsia’s destiny, Google needs to attract mature applications, as well as developers, and the best way to do that is to add Linux app compatibility. The new Guest app, which initially supports Linux-based platforms including Debian, works with the Machina library to accomplish this in a way that goes beyond what you can get from QEMU, suggests 9to5Google.

Google describes Fuchsia’s Machina as “a library that builds on top of the Zircon hypervisor to provide virtualized peripherals that integrate with a garnet system.” Zircon is the Fuchsia microkernel, based on Little Kernel (LK), and formerly called Magenta. Garnet is the layer that sits directly atop Zircon and offers device drivers, the Escher graphics renderer, Fuchsia’s Amber updater, and the Xi Core engine for the Xi text and code editor. Other layers include Peridot for app design, and on top, Topaz, a Flutter-supported app layer.

Machina adopts the Virtio virtualization standard, which is also used by the Linux Kernel-based Virtual Machine (KVM). It makes use of Virtio’s vsock virtual socket, “which can open direct channels between a host operating system and its guest, to allow for conveniences that would be otherwise impossible,” says 9to5Google.

This extra effort will likely enable fast mouse performance, automatically adjusted screen resolution, and support for multiple displays, file transfers, and copy and paste, says the story. This appears to be much like the allegedly superior emulation that is expected with Google’s Project Crostini for running Linux apps on Chrome OS. The news of the Guest app follows earlier reports that suggested that Google is building an Android Runtime into Fuchsia rather than depending on emulation to run Android apps.

App emulators should be viewed with some skepticism. Most of the mobile Linux OS contenders promised some sort of Android app compatibility, but they have generally failed to deliver. Still, by building emulation deeply into the stack from the start rather than adding an emulator on later, Fuchsia may well offer Linux developers an emulator that they can live with.  

Join us at Open Source Summit + Embedded Linux Conference Europe in Edinburgh, UK on October 22-24, 2018, for 100+ sessions on Linux, Cloud, Containers, AI, Community, and more.