Skip to content

Instantly share code, notes, and snippets.

@brccabral
Last active November 29, 2022 02:58
Show Gist options
  • Save brccabral/bb5b48b58cc6dcb97462435f54abd41d to your computer and use it in GitHub Desktop.
Save brccabral/bb5b48b58cc6dcb97462435f54abd41d to your computer and use it in GitHub Desktop.
XFCE on Android Termux

Install XFCE on Android Termux

Instructions from https://www.youtube.com/watch?v=oJP3FRTxbnw

  1. Install F-Droid
  1. Install Termux from F-Droid
  1. Update Termux
  • apt update && apt upgrade -y
  1. Set up Termux storage
  • termux-setup-storage
  1. Install X11-repo
  • pkg install x11-repo
  1. Install XFCE and VNC server
  • pkg install xfce4 xfce4-goodies tigervnc xorg-xhost
  1. Start VNC to setup password
  • vncserver -geometry 1280x720 -listen tcp :1
  • set a password
  • allow control DISPLAY=:1 xhost +
  1. Close VNC server for now
  • vncserver -kill :1
  1. Configure VNC startup
  • nano ~/.vnc/xstartup
  • comment #aterm ....
  • comment #twm &
  • add startxfce4 &
  • nano ../usr/bin/vncstart
vncserver -geometry 1280x720 -listen tcp :1
  • chmod +x ../usr/bin/vncstart
  1. Start VNC
  • vncstart
  1. Install a VNC client on phone

Add Firefox

Need to install another distro inside Termux using proot-distro, and start Firefox in Termux XFCE from that distro.
I noticed that Swap memory on Termux is almost full and I get some crashes... Still don't know how to fix it...

  1. Install proot-distro
  • pkg install proot-distro
  1. Install Debian (Debian has firefox-esr in their repository) and login as root
  • proot-distro install debian
  • proot-distro login debian
  1. Install firefox
  • apt update && apt upgrade
  • apt install firefox-esr
  1. Add firefox user
  • adduser firefox
  1. Login as firefox user
  • su - firefox
  1. Config bashrc to autostart firefox at display :1
  • echo "DISPLAY=:1 firefox" >> .bashrc
  1. Go back to Termux
  2. Install xorg-xhost
  • pkg install xorg-xhost
  1. Add a desktop entry calling firefox from inside Debian
  • nano ../usr/share/applications/firefox.desktop
[Desktop Entry]
Name=Firefox-esr
Icon=firefox
Type=Application
Categories=Network;WebBrowser;
Exec=proot-distro login --user firefox debian %u
Terminal=true
StartupNotify=false
  1. Allow display firefox
  • DISPLAY=:1 xhost +
  1. Just run Firefox from XFCE menu

  2. Stop VNC server on Termux

  • vncserver -kill :1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment