sodcalculator

10 Tech How-To

Run Android & Linux Apps on One Phone

Guide 10-52922 · Updated · Step by step

This guide shows you how to run both Android and Linux apps on the same phone, giving you a full desktop Linux environment alongside your normal Android setup. You’ll be able to use tools like GIMP, LibreOffice, or a terminal with a package manager, all without leaving your phone. The main methods are using a proot-based app (no root required) or a chroot environment (requires root), and we’ll cover both.

What You’ll Need

  • An Android phone with at least 4GB of RAM (8GB recommended for a smoother experience).
  • At least 5GB of free storage space for the Linux root filesystem.
  • Android 8.0 or newer (most modern devices work).
  • A stable internet connection for downloading the necessary files.
  • Optional: A keyboard and mouse (via Bluetooth or USB OTG) for a more desktop-like experience.

Step-by-Step

Method 1: Using a Proot-Based App (No Root Needed)

  1. Install a proot-based terminal app. The most popular is Termux, available on F-Droid or the Google Play Store. This app provides a Linux terminal environment without needing root access.
  2. Update Termux and install required packages. Open Termux and run: pkg update && pkg upgrade. Then install the proot package: pkg install proot.
  3. Install a Linux distribution. Use a script like termux-proot-distro to install a full distribution. Run: pkg install wget && wget https://raw.githubusercontent.com/termux/proot-distro/master/install.sh && bash install.sh.
  4. Choose your distribution. After installation, run proot-distro list to see available options (e.g., Ubuntu, Debian, Alpine). Install one with proot-distro install ubuntu.
  5. Log into your Linux environment. Start it with proot-distro login ubuntu. You’ll now have a root shell inside a minimal Linux system.
  6. Install a desktop environment (optional). To get a GUI, install a lightweight desktop like XFCE. Inside the proot environment, run: apt update && apt install xfce4. Then set up a VNC server (e.g., apt install tigervnc-standalone-server) and start it with vncserver -localhost.
  7. Connect to the VNC server. Install a VNC viewer app on your phone (like VNC Viewer) and connect to localhost:5901 (or the port shown). You’ll see the Linux desktop.

Method 2: Using a Chroot Environment (Requires Root)

  1. Root your phone. This process varies by device. Search for a guide specific to your phone model. Rooting voids warranty and carries some risk, so proceed carefully.
  2. Install a chroot app. Apps like Linux Deploy or Andronix can set up a chroot environment. For this guide, we’ll use Linux Deploy (available on F-Droid).
  3. Configure Linux Deploy. Open the app, grant root access, and set the distribution (e.g., Ubuntu), architecture (usually arm64), and installation path (on your SD card or internal storage). Set the size of the image file (e.g., 8GB).
  4. Install the Linux system. Tap the “Install” button. The app will download and extract the root filesystem. This can take 10-20 minutes depending on your connection.
  5. Start the Linux environment. Tap “Start” to mount the chroot. Then tap “Launch” to open a terminal into your Linux system.
  6. Set up a desktop (optional). Similar to the proot method, install a desktop environment and a VNC server. Linux Deploy has built-in options for this in its settings (e.g., Desktop Environment: XFCE, VNC server: tigervnc).
  7. Connect via VNC. Use a VNC viewer app to connect to localhost:5900 (or the port you set). You’ll get a full Linux desktop.

Common Mistakes

  • Not updating Termux before installing packages. This often causes dependency errors. Always run pkg update first.
  • Choosing a heavy desktop environment. GNOME or KDE will be painfully slow on most phones. Stick with XFCE or LXDE.
  • Ignoring storage space. A full Linux installation with a desktop can easily use 5-10GB. Check your free space before starting.
  • Using the wrong architecture. Most modern phones are arm64, but some older ones are armhf. Choosing the wrong one will cause installation failures.
  • Forgetting to set a VNC password. The VNC server will not start without one. Set it when prompted.

Tips

  • Use a Bluetooth keyboard and mouse. Navigating a Linux desktop with a touchscreen is frustrating. A keyboard and mouse make it almost like a real PC.
  • Run Linux apps in a window. Instead of a full desktop, you can run individual Linux apps with a graphical interface using an X server app like XSDL or Termux’s own X11 support. This is lighter and often more practical.
  • Keep your Linux system updated. Just like on a PC, run apt update && apt upgrade regularly to get security patches and bug fixes.
  • Use a file manager that works across both systems. Apps like Solid Explorer can access the Linux file system (if rooted) or you can share files via a shared folder (e.g., using a common SD card path).
  • Backup your Linux image. If you’re using Linux Deploy, you can copy the image file to a PC for backup. This saves you from redoing the setup if something goes wrong.

Troubleshooting

  • Termux says “package not found” after running pkg install. Run pkg update first, then try again. If it persists, check your internet connection or try a different mirror with termux-change-repo.
  • Proot-distro login fails with “command not found”. Make sure you installed proot-distro correctly. Re-run the install script or check if the binary is in your PATH.
  • VNC viewer shows a blank screen. The desktop environment may not have started. In your Linux terminal, run startxfce4 (for XFCE) or startlxde (for LXDE) before starting the VNC server.
  • Linux Deploy fails during installation. Check that you have enough free space and that the path is writable. Try a different distribution (e.g., Debian instead of Ubuntu) or a smaller image size.
  • Apps crash or run slowly. Close other Android apps to free up RAM. Reduce the desktop resolution in the VNC server settings (e.g., 1280×720 instead of 1920×1080).
  • Can’t connect to VNC server. Ensure the VNC server is running (check with ps aux | grep vnc) and that you’re using the correct port. If you’re on a local network, use the phone’s IP address instead of localhost.

Frequently Asked Questions

Do I need root to run Linux apps on Android?

No. The proot-based method (like Termux with proot-distro) works without root. It uses a virtualized environment that doesn’t require system-level access. However, performance may be slightly lower than a chroot method.

Can I run GUI apps like Firefox or LibreOffice?

Yes, you can run graphical applications. You’ll need to install a desktop environment and a VNC server, or use an X server app. The performance depends on your phone’s hardware; lighter apps run better.

Will running Linux apps affect my Android phone’s performance?

Only while the Linux environment is running. When you exit Termux or stop the chroot, the Linux processes are terminated, so there’s no ongoing impact. During use, it will consume RAM and CPU, so other apps might slow down.

Can I install any Linux software?

Most software available for ARM Linux distributions will work, but not everything. Some proprietary software (like certain games or apps) may not have ARM builds. Also, hardware-dependent tools (like GPU drivers) may not work fully.

Is it safe to run Linux on my phone?

Using proot is generally safe and doesn’t modify your Android system. Rooting and using chroot carries more risk, as you’re modifying system partitions. Always follow instructions carefully and back up your data.

Can I run Android apps inside Linux?

Not directly. You can use Anbox or Waydroid to run Android apps inside a Linux environment, but that’s the reverse of what this guide covers. Running Android apps on Linux is more complex and often requires specific kernel modules.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →