May 2, 2023

Installing .NET on Android


This runs .NET natively
not in a vm
not in a container
no need to have root access or jailbreaking your android
.NET runs natively on android in user space

Install Termux apk on android
pkg install proot
pkg install proot-distro
proot-distro allows to install linux which runs along with android os. This is not a vm so we get native performance.

proot-distro commands:
    proot-distro list - show the supported distributions and their status.
    proot-distro install - install a distribution.
    proot-distro login - start a root shell for the distribution.
    proot-distro remove - uninstall the distribution.
    proot-distro reset - reinstall the distribution.

Following linux flavours are supported:
  1. Alpine Linux (edge)
  2. Arch Linux / Arch Linux 32 / Arch Linux ARM
  3. Debian (stable)
  4. Fedora 35
  5. Manjaro AArch64
  6. OpenSUSE (Tumbleweed)
  7. Ubuntu (22.04)
  8. Void Linux

Following are the steps for Ubuntu
proot-distro install ubuntu
proot-distro login ubuntu
su
apt install wget -y
apt install ssh -y
apt-get install -y net-tools

Manual installation of .NET: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
cd ~/.dotnet
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc
echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc
source ~/.bashrc
Now the dotnet CLI can be used, more on this: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet

--REMOTE TERMUX--
https://gist.github.com/mjnaderi/b933fe940cd47b09d5cfc14875e77d67
https://glow.li/posts/run-an-ssh-server-on-your-android-with-termux/
Detailed video coming soon

Applications:
1. You can install cloudflared (Cloudflare zero trust) and then can host asp.net site on your android device
2. Run FTP server
3. Share the files without uploading anywhere