Loading Book
Introduction to Linux VM on Android
Slideshow
Edit
Introduction
Introduction
1. Introduction to Linux VM on Android
Exploring the feasibility and performance of running a Linux VM on Android using the Android Virtualization Framework (AVF).
Introduction
2. Standard Use Case of AVF
AVF is primarily designed for Protected VMs, focusing on isolating sensitive workloads like Biometrics, KeyMint, and DRM.
Introduction
3. Motivation for Virtualization
Virtualization provides a standard Linux environment unaffected by Android's Bionic Libc and kernel sharing limitations.
Terminal App
Terminal App
4. Terminal Application Overview
The terminal app uses WebView and shell with virtio devices for connectivity and management between Android and Debian.
Architecture
Architecture
5. VM Architecture Design
Secure web-based terminal interface utilizes xterm.js and ttyd with enforced mTLS for security.
Architecture
6. Lifecycle-Aware Resource Management
Memory and storage ballooning integrates with Android lifecycle, dynamically managing resources effectively.
Build Image
Build Image
7. Build Image Challenges and Solutions
Overcame slow build processes using hybrid provisioning with Debian Cloud Images and pre-installation of dependencies.
Input Bridging
Input Bridging
8. Input Bridging Strategy
Event translation captures Android events to handle lifecycle and focus, avoiding focus trapping issues.
Input Bridging
9. Keyboard Input Translation
Maps Android keycodes to Linux scan codes, adding a custom toolbar for missing modifier keys.
Input Bridging
10. Mouse and Touch Input Handling
Uses pointer capture for mouse events and supports multi-touch gestures on touchscreens with scaling adjustments.
Graphics Stack
Graphics Stack
11. Graphics Stack: Windowing Strategy
Opted for Weston with Kiosk Shell, enforcing full-screen mode and integrating X11 compatibility via Xwayland.
Graphics Stack
12. Graphics Stack: Hardware Acceleration
Implemented hardware acceleration with gfxstream, leveraging AHB for efficient GPU command mapping.
Graphics Stack
13. Resolving ARM Cache Coherency
Fixed visual artifacts on ARM devices by adding explicit cache flushes during graphics operations.
Graphics Stack
14. Zero-Copy Presentation Optimization
Achieved zero-copy path by removing extra frame copies, leveraging SurfaceControl Transaction API for efficiency.
Conclusion
Conclusion
15. Conclusion: Bridging Gaps
The project successfully bridged architectural differences between Android and Linux, proving AVF's potential for general-purpose computing.