Running a Desktop OS on a Foldable Phone: A Complete Breakdown of On-Device Virtualization

    An experimental project now running a full desktop operating system directly on a foldable phone—entirely on-device, with no cloud streaming and no jailbreak—shows how local virtualization can graft one system onto another under the same ARM instruction set. This article breaks down the core engineering questions behind it: why a shared instruction set is not enough to boot a desktop OS on mobile, how the three main approaches (hardware-assisted virtualization, syscall-level binary translation, and full-system emulation) trade off performance against compatibility, how to plan compute, memory, I/O, and power on constrained hardware, how to rebuild input and interaction without a physical keyboard or trackpad, and how to bridge desktop login flows securely with loopback callbacks and PKCE. It also covers the security and compliance red lines, a step-by-step path from "it runs" to production quality, the metrics needed to evaluate the result, and a realistic view of the approach's current limits.

    Running a Desktop OS on a Foldable Phone: A Complete Breakdown of On-Device Virtualization

    Recently, experimental projects that run a complete desktop operating system on a foldable phone have drawn mainstream attention. In these demos, the system does not rely on cloud streaming, nor on jailbreaking or bypassing system protections. It runs locally on the phone: folded, it acts as a “mini-laptop”; unfolded, it becomes a tablet. Browsers and desktop productivity apps both work normally.

    For developers, what is worth dissecting is the set of general technical questions behind it: under the same ARM instruction set, can an operating system be “grafted” onto a completely different system? How can a mobile device’s limited resources carry a desktop-level workload? And with no physical keyboard, mouse, or expansion ports, how is the interaction model rebuilt? This article works through these questions and systematically lays out the underlying principles, key design decisions, and engineering practices.

    First, Draw the Line: On-Device Virtualization vs. Cloud Streaming

    “Using desktop software on a phone” has historically had two mainstream implementations, with very different engineering centers of gravity.

    • Cloud streaming: The desktop environment runs on a remote server or cloud host, and the phone only captures input, decodes video, and sends operations back. The advantage is a light load on the phone and broad compatibility; the downside is heavy reliance on the network. Resolution, frame rate, and operational latency all fluctuate with the connection, and data must always traverse the public network.
    • On-device virtualization: An OS instance runs directly on the device’s own processor, with input and output forming a local loop. It does not depend on the network and offers a clearer privacy boundary; the cost is that performance and battery life are constrained by the device’s own capabilities.
    Dimension Cloud Streaming On-Device Virtualization
    Where it runs Remote server / cloud host The device’s own processor
    Network dependency Strong; quality and latency vary with bandwidth Weak; can run offline
    Data flow Data traverses the public network Data stays on the device
    Performance ceiling Depends on remote resources Limited by the phone’s chip, thermals, and battery
    Core challenge Codec, transport protocol, weak-network adaptation Architecture compatibility, resource planning, interaction rebuilding

    The experimental approach discussed here belongs to the latter category, so the analysis below centers on the word “on-device.”

    Same Instruction Set ≠ System Will Boot: The Real Barriers on Mobile

    Many people’s first instinct is: phone chips and desktop processors are both based on the ARM architecture, so the instructions can recognize each other—why not just package the OS? The reason is that running an operating system depends on far more than “instructions that can be decoded.”

    1. Different boot chains

    Most desktop ARM devices boot via UEFI firmware and rely on mechanisms like ACPI to enumerate hardware. Mobile devices generally use a vendor-customized boot chain and describe hardware with a device tree. The boot entry point, memory layout, and peripheral discovery all differ substantially from the desktop world, so a standard installation medium simply cannot install onto a phone.

    2. A gap between chip features and OS requirements

    Desktop-grade ARM operating systems have explicit requirements for processor features—for example, exception levels, physical address bit-width, memory attributes, and the cache-coherency model. Even within the same ARM architecture, mobile SoCs differ markedly from desktop and server chips in core count, memory controllers, system-level caches, and peripheral controllers, and some features may be missing or implemented differently.

    3. A missing peripheral model

    Once the OS boots, it must take over the display, touchscreen, input, network, audio, storage, and all other hardware. Mobile SoCs use deeply customized, highly integrated peripheral designs; drivers are often tied to a specific chip, are not published, and cannot be ported directly to a desktop system.

    4. Restricted system-level permissions

    Mobile operating systems generally use sandboxing, code signing, and integrity checks. Ordinary apps cannot obtain the virtualization privileges and device access required to run a second OS. Breaking through these limits usually means jailbreaking, which damages the system’s integrity protections and brings security and stability risks—so it is not a suitable approach for a proper solution.

    5. Difficult hardware-software co-debugging

    In the desktop ecosystem, the OS, firmware, and drivers can be debugged together. In the mobile environment, the low-level firmware is controlled by the device vendor, and the layers a developer can observe and influence are very limited.

    In short: the ARM instruction set only solves “what the CPU can understand,” while “whether the system can actually run” depends on whether boot, memory management, interrupts, peripherals, power management, and the security model form a complete closed loop.

    Comparing the Approaches: Virtualization, Binary Translation, and Instruction-Set Emulation

    Facing this problem, the industry generally takes three approaches.

    Technical Route Principle Performance Overhead Compatibility Suitable Scenarios
    Hardware-assisted virtualization Uses processor virtualization extensions to isolate the guest system; devices are attached in a paravirtualized way Low Depends on firmware and driver support Devices with open low-level access and available virtualization capability
    Syscall-level binary translation Translates binary instructions of one architecture into another in user space, then forwards system calls Medium Weak graphics and driver support Command-line-only workloads
    Instruction-set-level full-system emulation Emulates a complete machine (CPU, memory, interrupts, peripherals) in software, independent of the guest’s architecture Highest, usually several-fold overhead Best; can fully boot any compatible system Quick validation, cross-architecture compatibility

    Public information about this case indicates that the desktop OS runs a 64-bit ARM build and directly taps the phone’s local compute, placing it closer to the hardware-assisted virtualization approach. Syscall-level translation mainly serves cross-architecture user-space programs, while full-system emulation is generally used for cross-architecture full boots. For a “same-architecture, full-system” requirement, virtualization has the lowest overhead and the most native-like experience. Its precondition, however, is that the underlying layer offers usable virtualization capability and the corresponding system interfaces.

    Resource Planning and Performance Tuning on Constrained Hardware

    The gap in resource scale between mobile devices and desktop hosts is significant. Desktop machines routinely ship with tens of GB of RAM, while on mobile the device must carry the host system and two graphical interfaces at the same time. Resource planning is therefore the “lifeline” of the whole approach.

    1. Compute: place virtual cores where they belong

    Mobile SoCs generally use a big.LITTLE-style “performance core + efficiency core” design. The number of cores a VM can use is limited, and the core scheduling policy directly affects responsiveness:

    • Too many virtual cores increase scheduling and synchronization overhead and should be set against actual workload;
    • Binding virtual cores to performance cores makes foreground interaction smoother; when efficiency matters more, background tasks can be scheduled to efficiency cores.

    2. Memory: help the desktop system “slim down”

    Public information shows that the approach allocates about 4.5 GB of memory to the system, with usage around 1.46 GB at idle. A reasonable approach is:

    • Disable non-essential features such as system indexing, telemetry uploads, animations, lock-screen hints, and automatic wallpaper switching;
    • Trim preinstalled apps and scheduled tasks;
    • Turn off non-essential features such as fast startup and the hibernation file to reduce resident services;
    • Tune the virtual memory policy to lower the impact of sudden memory pressure.

    Memory must also be reserved for the host system and foreground apps. If memory becomes overly tight, the whole device slows down at best and triggers the system’s memory-reclamation mechanism at worst, killing background processes.

    3. I/O and storage

    The storage medium is provided to the guest system after being uniformly wrapped by the host. Every translation layer on the read/write path adds latency, and write amplification accelerates flash wear. It is advisable to use caching policies, asynchronous I/O, and write coalescing to reduce unnecessary disk writes, and to limit background prefetch and full-disk searches.

    4. Graphics and power: a persistent weak spot

    Virtual graphics devices often lack hardware acceleration, so window compositing, page scrolling, and video playback all depend on software rendering, driving CPU usage up and, in turn, generating heat and throttling. The more realistic bottleneck is the battery: sustained high CPU load combined with an always-on screen drains overall battery life quickly.

    Rebuilding Interaction: Turning a Foldable Screen into a Mini-Laptop

    Without a physical keyboard, trackpad, or standard USB ports, the human-computer interaction that a desktop system depends on has to be rebuilt.

    1. Form awareness and mode switching

    The device manager must continuously monitor changes to the foreground app window size and screen orientation:

    • Folded: the top half outputs the desktop image while the bottom half shows a virtual keyboard and trackpad;
    • Unfolded: it switches to a single large display and the desktop enters a tablet-like layout.

    At the moment of switching, resolution negotiation, DPI scaling, and window re-layout must be completed to avoid stretched images or misaligned UI.

    1. # Illustrative: form awareness and input routing (pseudocode)
    2. on (fold_state, screen_orientation, window_size) change:
    3. if fold_state == "folded":
    4. display.top = guest_framebuffer # top screen outputs the desktop image
    5. input.map(
    6. bottom_half -> virtual keyboard + trackpad,
    7. top_half -> touch pointer,
    8. )
    9. guest.set_mode("laptop")
    10. else:
    11. display.full = guest_framebuffer # single full-screen display when unfolded
    12. input.map(whole_screen -> touch pointer)
    13. guest.set_mode("tablet")
    14. guest.refresh_layout(dpi = screen.dpi)

    2. Input semantic mapping

    Four kinds of events—touch, pointer, scroll wheel, and keyboard—must be mapped accurately between the host and guest systems. Multi-touch gestures such as two-finger scroll, two-finger zoom, and three-finger window switching can correspond respectively to trackpad inertia and scaling behavior; multi-finger taps can map to the right-click menu. For the keyboard, beyond routine modifier-key translation, a one-tap physical entry can also be reserved for the system’s built-in AI assistant.

    3. Cursor visibility

    Touch interaction hides the cursor by default, yet most desktop UIs assume a pointer is present. A sensible policy is to keep the cursor hidden during touch interaction and show it automatically when a trackpad or external mouse is connected.

    4. System integration experience

    Two-way clipboard sync, notification forwarding, and file transfer determine whether the experience “feels like a computer.” System-level authentication screens and biometric capabilities that app logins depend on also need to be bridged into the guest system (see the next section).

    5. Peripheral expansion

    When connecting an external monitor, keyboard, mouse, or USB drive through the device’s generic peripheral-forwarding capability, the difficulty is not “connecting it” but whether, after hot-plugging, the guest system can correctly enumerate the device and complete driver binding.

    Login Bridging and Security Boundaries

    Desktop software generally uses account logins, and the authorization flow usually has three stages: “open the system browser, wait for a callback, exchange for a token.” This conflicts naturally with the mobile environment:

    • On mobile, the same app may exist simultaneously as a “copy inside the desktop system” and a “copy in the host system,” so invoking the host browser directly can route the callback to the wrong process;
    • Some desktop apps listen on a fixed local port to receive callbacks by default, and fail if the port is already occupied.

    A workable approach is “loopback callback + PKCE” bridging:

    • Start a temporary HTTP service inside the guest system bound only to the local loopback address;
    • Use the host system’s integrated browser to complete authorization—an already-signed-in account session can be reused directly, and the platform authenticator and biometrics can participate seamlessly;
    • Return the authorization code to the local callback service via a URL scheme, after which the client verifies it with PKCE to exchange for a token.
    1. # Illustrative: local loopback authorization callback service for a desktop app (Python pseudocode)
    2. import base64, hashlib, secrets, http.server, urllib.parse
    3. CALLBACK_HOST = "127.0.0.1" # bind only to the loopback address; not exposed externally
    4. CALLBACK_PORT = 8976
    5. def pkce_pair():
    6. verifier = base64.urlsafe_b64encode(secrets.token_bytes(32)).rstrip(b"=").decode()
    7. challenge = base64.urlsafe_b64encode(
    8. hashlib.sha256(verifier.encode()).digest()
    9. ).rstrip(b"=").decode()
    10. return verifier, challenge
    11. class CallbackHandler(http.server.BaseHTTPRequestHandler):
    12. def do_GET(self):
    13. query = urllib.parse.parse_qs(urllib.parse.urlparse(self.path).query)
    14. self.server.result = {
    15. "code": query.get("code", [""])[0],
    16. "state": query.get("state", [""])[0], # anti-CSRF; must be compared with the value stored in the session
    17. }
    18. self.send_response(200)
    19. self.end_headers()
    20. self.wfile.write("Authorization complete; you can return to the app".encode("utf-8"))
    21. def log_message(self, *args): # keep the authorization code out of the logs
    22. pass
    23. def login_via_system_browser():
    24. verifier, challenge = pkce_pair()
    25. with http.server.HTTPServer((CALLBACK_HOST, CALLBACK_PORT), CallbackHandler) as srv:
    26. srv.timeout = 120 # timeout guard so the service doesn't hang indefinitely
    27. srv.result = None
    28. open_in_system_browser(auth_url(challenge)) # reuse the host system's signed-in session
    29. srv.handle_request() # block until the callback arrives
    30. return srv.result # the caller exchanges the verifier for a token and writes it to the system credential store

    This illustrative code needs five security details in place:

    1. Anti-CSRF: generate a random state before authorization and store it in the session; compare it strictly on callback;
    2. Anti code-interception: use PKCE; use each authorization code once and set a short validity period;
    3. Port-occupied handling: on failure, switch to a free port, but construct the callback URL with the actual port;
    4. Transport security: use TLS on the loopback address as well; never write tokens to plaintext logs, and finally store them in the system credential store;
    5. Timeout and resource release: limit the callback wait time and close the temporary service immediately after the request completes.

    Beyond this, several other risks deserve separate attention:

    • Permission boundaries: even without ever jailbreaking, avoid requesting unnecessary system permissions, such as background access to contacts, SMS, photos, precise location, and the microphone;
    • Running untrusted code: executable programs inside the desktop system come from different sources and should be assumed untrusted and run with least privilege;
    • Awareness of security boundaries: virtualization can isolate hardware access, but it cannot shield the desktop system from malware inside it. Security software, a firewall, and least-privilege accounts are still needed within the guest system.

    Security and Compliance: Three Red Lines to Hold

    Beyond technical feasibility, whether the approach can survive long-term depends on three red lines.

    1. System integrity

    Do not rely on jailbreaking or system cracks; preserve the host system’s code-signing and integrity-check mechanisms. Any behavior that trades a security mechanism for functionality multiplies the attack surface.

    2. Software licensing

    The license terms of mainstream desktop operating systems usually place limits on the runtime environment, and personal research and commercial distribution should be treated differently. An open-source approach does not mean the OS images it contains can be freely redistributed; image building, signing, and distribution methods need to be assessed in advance.

    3. Data and privacy

    A desktop system may hold office documents and credentials. It should be clearly explained where data is stored on the device, who can access it, and how it is cleaned up, avoiding a situation where “deleting the app leaves the data behind.”

    Engineering It Out: From “It Runs” to “It Works Well”

    For teams that want to pursue similar exploration, the following steps can be followed:

    1. Capability assessment: confirm whether the target device’s processor virtualization capability is open, and whether the system interfaces and device permissions allow instantiating a guest system;
    2. Compatibility validation: complete a boot test with a minimal kernel plus initramfs, confirm the boot chain and basic peripherals work, then gradually expand to a full system;
    3. Resource baseline: fix memory allocation, set the number of virtual cores, measure idle and peak usage, and establish a reproducible performance baseline;
    4. Interaction adaptation: implement form awareness, input mapping, cursor policy, and clipboard sync;
    5. System integration: connect the network, audio, login bridging, and peripheral forwarding;
    6. Security and compliance review: cover least privilege, licensing, data storage, and distribution methods;
    7. Continuous optimization: adjust scheduling policies and power budgets based on real usage data.

    For scenarios that genuinely need a hybrid form of “cloud rendering + light local interaction,” public cloud can provide general-purpose support:

    • Elastic compute and container platforms: create instances running the desktop environment on demand, isolated between users via instances;
    • Object storage: centrally hold system images and user workspaces;
    • Content delivery networks: distribute images close to users and cut first-download time;
    • Logging, monitoring, alerting, and load balancing: deliver runtime observability, capacity elasticity, and traffic scheduling.

    Taking Baidu AI Cloud as an example, the above capabilities are available as mature product categories and can serve as cloud-side infrastructure options for such hybrid approaches. Note that “local” and “cloud” are not mutually exclusive but two implementation forms with different emphases that can be combined. In addition, scenarios that involve integrating AI capabilities can also leverage an agent development platform to package knowledge retrieval, document generation, and data analysis into callable services, without having to reimplement model inference on the device itself.

    Evaluating Performance and Experience: Let the Data Speak

    Demo videos easily create an illusion of “smoothness,” but going to production requires quantified metrics:

    • Cold start time: from tapping the icon to the desktop being visible;
    • Idle resource usage: memory, CPU, and disk I/O;
    • Frame-rate stability: frame-generation time while dragging windows, scrolling, and switching apps;
    • Power and heat: consumption and temperature change under 30 minutes of moderate load;
    • Battery life: usable duration under moderate-intensity use;
    • Compatibility coverage: launch success rate, account-login success rate, and peripheral-recognition rate for common desktop apps;
    • Network adaptability: operational latency and packet-loss behavior on weak networks;
    • Stability: crashes, memory leaks, and hangs during 24-plus hours of continuous running.

    It is advisable to build a test matrix and continuously regress across three forms—“external keyboard and monitor,” “pure touch with the foldable,” and “unfolded only”—so that optimizing one form does not degrade another.

    Value and Outlook

    The point of this kind of experiment is not the surface-level novelty of “running one company’s OS on another’s hardware,” but the validation of a set of underlying propositions:

    • Under the same instruction-set architecture, virtualization can break through the multiple barriers of boot chains, peripheral models, and permission boundaries;
    • After careful trimming and resource planning, a mobile device can carry desktop-grade applications;
    • The foldable form provides a natural stage for “one screen, two roles.”

    It is also important to recognize the current shortcomings soberly: insufficient graphics acceleration, the power and thermal pressure of sustained high load, the fragility of upstream adaptation, and the licensing constraints of desktop operating systems. In the near term, this is more a technical validation and form exploration than an everyday productivity tool.

    Over a longer horizon, as mobile processors grow more powerful, foldable forms become widespread, and cross-device application frameworks mature, “pocket workstation”–style human-computer interaction will become increasingly common. Local execution solves privacy and offline use, while cloud collaboration adds compute and elasticity—only their combination is a sound path toward mature mobile computing. For developers, understanding the design trade-offs of this kind of system is more valuable than remembering any single demo.