What if an old smartphone could become a small Linux computer?
That was the question behind Xperia Lab, a personal experiment involving a Sony Xperia X (F5122) from 2016. With a Snapdragon 650 processor, 3 GB of RAM, 64 GB of internal storage and an integrated battery, the device still had enough hardware to be useful.
My original goal was to replace Android with a native Linux installation and turn the phone into a small server accessible remotely through SSH, without needing its physical screen.
Things went a little further than expected.
Getting Linux to boot
The first challenge was getting a modern version of Linux to run using Sony’s original bootloader, the software responsible for starting the device and loading its operating system.
I started with Linux 7.2.3, a modern version of the Linux kernel, the core of the operating system responsible for managing the processor, memory and other hardware components.
Rather than starting from scratch, I built on the work of the msm8956-mainline project and postmarketOS, an open-source project focused on bringing Linux to mobile devices, including older smartphones.
The early experiments produced nothing but a black screen. There was no display output, no USB connection and no obvious way to determine whether Linux was actually running.
The breakthrough came through a mechanism called ramoops, which allows diagnostic information to survive certain types of reboot. By recovering these logs from a separate recovery environment, I could finally see what was happening inside the device.
Linux was booting. I simply had no way to observe it.
From there, the work focused on correcting the Device Tree, which is essentially a map that tells Linux how the different hardware components are connected. The next step was to restore essential functionality such as USB, internal storage and power management.
Interestingly, many of these improvements required changes to that hardware description rather than to the kernel itself.
Making it a real Linux server
Once USB networking was working, I removed Android, prepared the internal storage for Linux and installed Alpine Linux, a lightweight distribution particularly well suited to devices with limited resources.
Getting Wi-Fi to work required additional hardware configuration and the original Broadcom firmware (the software responsible for controlling the wireless chip).
Eventually, the Xperia could boot directly into Alpine, connect to a wireless network and accept remote connections without a USB cable.
I also configured nginx to serve web content, Tailscale for secure remote connectivity, battery monitoring and custom recovery mechanisms.
At this point, the phone was already a useful Linux server, consuming around 100 MB of RAM after boot.
It even got its own website: xperia.nico.ar, hosted on the Xperia itself.
Beyond the terminal
Having a working server made me wonder how far I could take the experiment.
Could this smartphone also run a modern Linux desktop?
I installed Sway, a Wayland compositor responsible for displaying and managing application windows. Wayland is the technology behind many modern Linux graphical environments.
Instead of using the phone’s physical screen, I created a virtual display. Since hardware graphics acceleration was not available, the processor itself was responsible for rendering the entire desktop.
For the desktop interface, I chose Claudito Shell, a project from Linux en Casa built on top of Quickshell, a framework for creating custom Linux desktop interfaces.
Quickshell was not available in my Alpine software repositories, so I compiled it from source on my Debian laptop using Podman and QEMU to create an ARM64 build environment. I then packaged it for installation on the Xperia.
Combined with WayVNC, this setup allowed me to access a persistent 1280 × 720 Linux desktop remotely from both Fedora and macOS.
Firefox, LibreOffice, Thunar, GIMP and Inkscape were all running. I even managed to launch Kdenlive, a non-linear video editor. Not because I intended to edit videos on a smartphone from 2016, but because I wanted to see if it could.
A computer with some limitations
This is not a complete Linux smartphone port.
Only four of the six CPU cores are currently usable. The physical display and hardware graphics acceleration are not available in this setup, while Bluetooth, cameras, audio and cellular connectivity were outside the scope of the experiment.
Battery management also requires special attention, and some hardware-level reliability mechanisms remain unresolved.
However, the device can operate as a small Linux server and launch a graphical desktop on demand with a simple command:
desktop start
When the desktop is no longer needed, it can return to its lightweight server configuration.
What I learned
Xperia Lab was developed through experimentation, documentation and collaboration with AI tools, particularly ChatGPT and Claude Code.
Rather than providing a ready-made solution, these tools helped me explore different approaches, understand unfamiliar concepts, investigate failures and gradually build a working system.
The project also builds on the work of several open-source communities, whose contributions made much of this experiment possible.
Perhaps the most interesting lesson is that a smartphone does not stop being a computer when its manufacturer stops supporting it.
The hardware is still there. Sometimes, what it needs is a different operating system and a little curiosity.
The project’s configurations, build scripts, technical documentation and known limitations are available on GitHub for anyone interested in exploring, reproducing or building upon this experiment.
Useful links
- Xperia Lab on GitHub
Project documentation, configurations, build scripts and known limitations. - Xperia Lab live website
A website hosted on the Xperia itself. - msm8956-mainline
The Linux kernel tree that made this experiment possible. - postmarketOS
An open-source project bringing Linux to mobile devices. - Alpine Linux
The Linux distribution running on the Xperia. - Claudito Shell
A Quickshell-based desktop interface developed by Linux en Casa. - Quickshell
A framework for building custom Linux desktop interfaces. - WayVNC
A VNC server for Wayland compositors. - Project credits and acknowledgements
The open-source projects and contributors behind Xperia Lab.