Development with Linux Terminal on Pixel Tablet
Android is transforming to a cross tablet and desktop OS. Google is officially supporting Linux installation on Android 15/16 beta versions! This Linux distribution uses Android's AVF framework, making it feel like native Linux on your device. While there were still some bugs as of February 2025, it's become quite usable, especially on Google Pixel Tablets. For me, it's perfect for light development work and trying out new code while traveling. Here's how I set up my development environment on my 11-inch tablet.
Enable Linux Terminal
Enable developer mode and Linux development environment. After enabling it, look for new Terminal app in your app list. There is no need to goto Play store to install it. If you disabled the option, the Linux Terminal app will be automatically removed and all data in the Linux instance will be deleted.
Install Debian (Ubuntu?)
When the terminal app starts, it will prompt to enable notification. My install was failed when I rejected it at Android 15 beta. At right bottom there is a button to start install of Linux. Click it to download a 600MB size Debian distribution. Currently Google dev team is fixing bugs and patching the distribution without formal announcement. You can reinstall latest version by disabling and re-enabling Linux development environment. Backup before do it.
After installing, the Debian starts and print:Linux localhost 6.1.0-29-avf-arm64 #1 SMP Ubuntu 6.1.123-1 (2025-01-02) aarch64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
Enable testing channel
$ sudo vim /etc/apt/sources.list # add the line, change to mirror nearer to you
deb https://mirror.coganng.com/debian/ testing non-free non-free-firmware contrib main
$ sudo apt dist-upgrade
$ sudo reboot
This step is important, as port forwarding didn't work without testing channel for me.
Install Openssh server
Current Linux terminal uses WebView to display the Linux terminal, and keeps disconnecting and reconnecting, so that it's not very useful to use it before it get stabler. We can workaround though by connect to it via SSH with a stable Android SSH client.
$ sudo apt update
$ sudo apt install openssh-server
# Edit /etc/ssh/sshd_config to change Port to '5900'
# default port '22' doesn't work.
$ sudo systemctl enable ssh # start ssh server after bootup
$ sudo passwd droid # change password for SSH client to use
Install GUI apps and VNC
X
$ sudo apt install xfce4
$ sudo update-alternatives --config x-session-manager
$ sudo apt install tigervnc-standalone-server
$ tigervncserver -localhost :3 -geometry 2560x1600
$ tigervncserver -kill :3 # stop vnc
Swap memory
$ sudo fallocate -l 3G /swap
$ sudo chmod 600 /swap
$ sudo mkswap /swap
$ sudo swapon /swap
$ sudo swapon -s #update /etc/fstab for defaults mount on boot
Install Termius
Dev at Text mode with NeoVim
NeoVim Cheatsheet
Remote access to Services running in Linux Terminal
$ ssh droid@{yourAndroidIP} -p 5800
No comments:
Post a Comment