🕵️ SicherheitslückenWhat continuous operational resilience looks like under DORA(09.09.2026 um 17:53 Uhr)
🔧 AI Nachrichten OpenAI seeks tougher AI rules. CIOs may feel the ripple effects(10.09.2026 um 12:11 Uhr)
🔧 AI Nachrichten Mistral valued at €21bn after €3bn Series D funding round(08.09.2026 um 10:19 Uhr)
🪟 Windows TippsWindows XP's Cursor Indicator Is Getting a Windows 11 Refresh(25.08.2026 um 13:00 Uhr)
🕵️ SicherheitslückenWhat continuous operational resilience looks like under DORA(09.09.2026 um 17:53 Uhr)
🔧 AI Nachrichten OpenAI seeks tougher AI rules. CIOs may feel the ripple effects(10.09.2026 um 12:11 Uhr)
🔧 AI Nachrichten Mistral valued at €21bn after €3bn Series D funding round(08.09.2026 um 10:19 Uhr)
🪟 Windows TippsWindows XP's Cursor Indicator Is Getting a Windows 11 Refresh(25.08.2026 um 13:00 Uhr)

🔧 Programmierung 🕛 vor 1 Monat 2 Min Lesezeit
0

Linxr | Part 6 — Building Virtio-9P Storage Sharing & SAF on Android

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

In Part 5 of our engineering series, we introduced the high-level features of Linxr v3.0.0. Today in Part 6, we take a deep technical dive into how we solved host-to-guest file sharing on modern Android using Virtio-9P and Android’s Storage Access Framework (SAF).









The Challenge: Android Scoped Storage vs Linux Filesystems



Standard Linux virtual machines expect direct POSIX file path access (/home/root/files, /mnt/storage). However, Android 10+ enforces strict Scoped Storage rules and granular URI permissions.



Passing raw host paths to QEMU without root permissions often fails due to Android app sandbox boundaries. We needed a dual-layer solution:




  1. Direct high-speed POSIX passthrough for app-managed storage.

  2. User-configurable folder selection via Android Storage Access Framework (SAF).









Layer 1: Virtio-9P Driver in QEMU



QEMU provides the 9P network filesystem protocol (virtio-9p-pci), which exposes host directory trees to Linux guests with low CPU overhead.



We configured QEMU command-line parameters in VmManager.kt:




CODE
val virtioArgs = listOf(
"-fsdev", "local,id=fsdev0,path=$sharePath,security_model=none",
"-device", "virtio-9p-pci,fsdev=fsdev0,mount_tag=LinxrShare"
)






Inside Alpine Linux, an OpenRC startup service automounts this tag on boot:




CODE
mount -t 9p -o trans=virtio,version=9p2000.L LinxrShare /mnt/sdcard






Any file saved in /storage/emulated/0/LinxrShare on Android instantly appears inside Alpine Linux under /mnt/sdcard!









Layer 2: Storage Access Framework (SAF) & pickFolder Channel



To allow users to select custom folders (such as Downloads, Documents, or external SD cards), we implemented a native Kotlin MethodChannel handler (pickFolder):




CODE
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "com.ai2th.linxr/vm")
.setMethodCallHandler { call, result ->
if (call.method == "pickFolder") {
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).apply {
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
}
activity.startActivityForResult(intent, REQUEST_CODE_SAF_PICK_FOLDER)
}
}






When a user selects a folder, Android returns a persistent DocumentFile URI. We resolve the underlying POSIX path and pass it to QEMU's Virtio-9P filesystem driver.









What’s Next?



In Part 7, we will explore how we embedded the Docker Engine and built a real-time container management dashboard in Flutter!



👉 Official Website:

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Sam Altman calls GPT-6 Astra rollout ‘messy’ as enterprise users wait for access
1 Quelle
Swiss government explores replacing Microsoft 365 with open-source software
1 Quelle
What continuous operational resilience looks like under DORA