How To Guide How To Install Windows Or Linux ISOs on your Android Devices - Windows 10 Nox Lab + Working Arm Distros for your phone using Termux

Search This thread

jenneh

Senior Member
So my android device doesn't have enough space for me to test a full build (with iso from scratch, could likely push a premade to it for testing or in a few days get a secondary storage option). So for now... Enter the emulators for premade building..

You may or may not know that Nox cannot run aarch64 qemu and at the time I did not know why. (I theorize now it is due to nox being android 9 and wsa 12, so firmware related, but don't Know) Fast forward a year later, WSA is running better and now is able to run termux and install qemu-aarch64 without failing to the sys-NDK package.

I'm using this version of wsa but I think you could do it on regular? Anywho. Since we don't have full system read and write, we need to install termux storage module to be able to access the downloads folder on the device with code.

The code used below was able to boot past the board, in fact on termux it sees the iso and prompts for you to press any key (i think we can mod these isos with MODWIN once we figure out how to use them properly.. lol. I know how to switch the efi binary on the disk to no prompt)
Code:
pkg install x11-repo
pkg upgrade
pkg install qemu-system-aarch64 qemu-utils libslirp
qemu-img create -f qcow2 win11.img 100G
termux-setup-storage
adb push win11arm.iso /sdcard/Download
adb push QEMU_EFI.fd /sdcard/Download

qemu-system-aarch64 -m 2048 -cpu cortex-a72 -smp 4 -M virt -nographic -bios storage/downloads/QEMU_EFI.fd -drive if=none,file=win11.img,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=n0 -vnc 127.0.0.1:3 -cdrom storage/downloads/win11arm.iso
5.png

however it Will not show us window's lovely literal arm picture due to this: "-nographic" because I do not know how to add the right graphic "switch" is that right? We are close maybe someone can figure it out for us!! Still trying here
1.png

3.png

this builds us in the termux home directory for right now but that can be amended later just trying to get it to work
If anyone is able to expand upon this in any fashion please do so!

--edit just realized I can test on a phone now that I know how to do this without Root. So derp. Haha "termux-setup-storage" opens up the world

Here's the efi driver:

Here's a copy of win11arm if anyone would like to help solve this problem!

If you download these from your device you can skip the adb code.

So we need the -display code now and i think the nic code is not right so that too. (-netdev user,id=n0)
here's every imaginable way to setup a GUI
this guide here would bypass qemu all together i think? it installs full on linux debian with a beautiful and Prooven GUI
help for saving a file and exiting vim: https://linuxize.com/post/how-to-save-file-in-vim-quit-editor/
for helping seeing and selecting a local time zone https://linuxize.com/post/how-to-set-or-change-timezone-in-linux/
press the "i" key in vim to be able to remove the hashtag
 
Last edited:
  • Like
Reactions: furrioustorrus

jenneh

Senior Member
Kali Linux Nethunter, ARM64 Termux Machine:

VERIFIED WORKING, NO ROOT NEEDED
kalibootonphone.png

This is how to install ARM Kali Linux in Termux with Kex Vnc.
This machine runs amazing on my Potato Nokia G20 :D

Download the Termux apk for your device

Code:
pkg install x11-repo
pkg upgrade
pkg install wget

wget -O install-nethunter-termux https://offs.ec/2MceZWr
chmod +x install-nethunter-termux
./install-nethunter-termux

exit
selectkaliversion.png
rootfs.png
installed.png
In a browser on your android device, go to this link to download and install the "NetHunterStore"
Search in the app for "kex" and install.
Select Package Installer if prompted to
packageinstaller.png

In termux setup kex:
Code:
nethunter kex passwd
nethunter kex
kexpwd.png
nethunterkex.png

Then open the kex app and set the port (usually 5901) and it should boot

Thanks to David Bomball for sharing this

The PDF David shared if you have any issues

The Android 12 Known issues:
The problem is termux keeps getting forced closed out of no where only on Android 12. Trying to see if I can find a solution. This machine runs smooth as a dream.. just cannot get it to stay open long enough to dl the arm iso to it
If you are running anything less than 12 it is reported there are no issues.

From now on you can use:
nethunter kex

and then open the kex apk with port 1 to boot into a normal user machine. See below for Root.

Code:
#!/data/data/com.termux/files/usr/bin/bash -e

VERSION=2020011601
BASE_URL=https://kali.download/nethunter-images/current/rootfs
USERNAME=kali



function unsupported_arch() {
    printf "${red}"
    echo "[*] Unsupported Architecture\n\n"
    printf "${reset}"
    exit
}

function ask() {
    # http://djm.me/ask
    while true; do

        if [ "${2:-}" = "Y" ]; then
            prompt="Y/n"
            default=Y
        elif [ "${2:-}" = "N" ]; then
            prompt="y/N"
            default=N
        else
            prompt="y/n"
            default=
        fi

        # Ask the question
        printf "${light_cyan}\n[?] "
        read -p "$1 [$prompt] " REPLY

        # Default?
        if [ -z "$REPLY" ]; then
            REPLY=$default
        fi

        printf "${reset}"

        # Check if the reply is valid
        case "$REPLY" in
            Y*|y*) return 0 ;;
            N*|n*) return 1 ;;
        esac
    done
}

function get_arch() {
    printf "${blue}[*] Checking device architecture ..."
    case $(getprop ro.product.cpu.abi) in
        arm64-v8a)
            SYS_ARCH=arm64
            ;;
        armeabi|armeabi-v7a)
            SYS_ARCH=armhf
            ;;
        *)
            unsupported_arch
            ;;
    esac
}

function set_strings() {
    echo \
    && echo ""
    ####
    if [[ ${SYS_ARCH} == "arm64" ]];
    then
        echo "[1] NetHunter ARM64 (full)"
        echo "[2] NetHunter ARM64 (minimal)"
        echo "[3] NetHunter ARM64 (nano)"
        read -p "Enter the image you want to install: " wimg
        if (( $wimg == "1" ));
        then
            wimg="full"
        elif (( $wimg == "2" ));
        then
            wimg="minimal"
        elif (( $wimg == "3" ));
        then
            wimg="nano"
        else
            wimg="full"
        fi
    elif [[ ${SYS_ARCH} == "armhf" ]];
    then
        echo "[1] NetHunter ARMhf (minimal)"
        echo "[2] NetHunter ARMhf (nano)"
        read -p "Enter the image you want to install: " wimg
        if (( $wimg == "1" ));
        then
            wimg="minimal"
        elif (( $wimg == "2" ));
        then
            wimg="nano"
        else
            wimg="minimal"
        fi
        else
        wimg="full"
    fi
    ####


    CHROOT=kali-${SYS_ARCH}
    IMAGE_NAME=kalifs-${SYS_ARCH}-${wimg}.tar.xz
    SHA_NAME=kalifs-${SYS_ARCH}-${wimg}.sha512sum
}   

function prepare_fs() {
    unset KEEP_CHROOT
    if [ -d ${CHROOT} ]; then
        if ask "Existing rootfs directory found. Delete and create a new one?" "N"; then
            rm -rf ${CHROOT}
        else
            KEEP_CHROOT=1
        fi
    fi
}

function cleanup() {
    if [ -f ${IMAGE_NAME} ]; then
        if ask "Delete downloaded rootfs file?" "N"; then
        if [ -f ${IMAGE_NAME} ]; then
                rm -f ${IMAGE_NAME}
        fi
        if [ -f ${SHA_NAME} ]; then
                rm -f ${SHA_NAME}
        fi
        fi
    fi
}

function check_dependencies() {
    printf "${blue}\n[*] Checking package dependencies...${reset}\n"
    ## Workaround for termux-app issue #1283 (https://github.com/termux/termux-app/issues/1283)
    ##apt update -y &> /dev/null
    apt-get update -y &> /dev/null || apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" dist-upgrade -y &> /dev/null

    for i in proot tar axel; do
        if [ -e $PREFIX/bin/$i ]; then
            echo "  $i is OK"
        else
            printf "Installing ${i}...\n"
            apt install -y $i || {
                printf "${red}ERROR: Failed to install packages.\n Exiting.\n${reset}"
            exit
            }
        fi
    done
    apt upgrade -y
}


function get_url() {
    ROOTFS_URL="${BASE_URL}/${IMAGE_NAME}"
    SHA_URL="${BASE_URL}/${SHA_NAME}"
}

function get_rootfs() {
    unset KEEP_IMAGE
    if [ -f ${IMAGE_NAME} ]; then
        if ask "Existing image file found. Delete and download a new one?" "N"; then
            rm -f ${IMAGE_NAME}
        else
            printf "${yellow}[!] Using existing rootfs archive${reset}\n"
            KEEP_IMAGE=1
            return
        fi
    fi
    printf "${blue}[*] Downloading rootfs...${reset}\n\n"
    get_url
    wget ${EXTRA_ARGS} --continue "${ROOTFS_URL}"
}

function get_sha() {
    if [ -z $KEEP_IMAGE ]; then
        printf "\n${blue}[*] Getting SHA ... ${reset}\n\n"
        get_url
        if [ -f ${SHA_NAME} ]; then
            rm -f ${SHA_NAME}
        fi
        wget ${EXTRA_ARGS} --continue "${SHA_URL}"
    fi
}

function verify_sha() {
    if [ -z $KEEP_IMAGE ]; then
        printf "\n${blue}[*] Verifying integrity of rootfs...${reset}\n\n"
        sha512sum -c $SHA_NAME || {
            printf "${red} Rootfs corrupted. Please run this installer again or download the file manually\n${reset}"
            exit 1
        }
    fi
}

function extract_rootfs() {
    if [ -z $KEEP_CHROOT ]; then
        printf "\n${blue}[*] Extracting rootfs... ${reset}\n\n"
        proot --link2symlink tar -xf $IMAGE_NAME 2> /dev/null || :
    else       
        printf "${yellow}[!] Using existing rootfs directory${reset}\n"
    fi
}


function create_launcher() {
    NH_LAUNCHER=${PREFIX}/bin/nethunter
    NH_SHORTCUT=${PREFIX}/bin/nh
    cat > $NH_LAUNCHER <<- EOF
#!/data/data/com.termux/files/usr/bin/bash -e
cd \${HOME}
## termux-exec sets LD_PRELOAD so let's unset it before continuing
unset LD_PRELOAD
## Workaround for Libreoffice, also needs to bind a fake /proc/version
if [ ! -f $CHROOT/root/.version ]; then
    touch $CHROOT/root/.version
fi

## Default user is "kali"
user="$USERNAME"
home="/home/\$user"
start="sudo -u kali /bin/bash"

## NH can be launched as root with the "-r" cmd attribute
## Also check if user kali exists, if not start as root
if grep -q "kali" ${CHROOT}/etc/passwd; then
    KALIUSR="1";
else
    KALIUSR="0";
fi
if [[ \$KALIUSR == "0" || ("\$#" != "0" && ("\$1" == "-r" || "\$1" == "-R")) ]];then
    user="root"
    home="/\$user"
    start="/bin/bash --login"
    if [[ "\$#" != "0" && ("\$1" == "-r" || "\$1" == "-R") ]];then
        shift
    fi
fi

cmdline="proot \\
        --link2symlink \\
        -0 \\
        -r $CHROOT \\
        -b /dev \\
        -b /proc \\
        -b $CHROOT\$home:/dev/shm \\
        -w \$home \\
           /usr/bin/env -i \\
           HOME=\$home \\
           PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \\
           TERM=\$TERM \\
           LANG=C.UTF-8 \\
           \$start"

cmd="\[email protected]"
if [ "\$#" == "0" ];then
    exec \$cmdline
else
    \$cmdline -c "\$cmd"
fi
EOF

    chmod 700 $NH_LAUNCHER
    if [ -L ${NH_SHORTCUT} ]; then
        rm -f ${NH_SHORTCUT}
    fi
    if [ ! -f ${NH_SHORTCUT} ]; then
        ln -s ${NH_LAUNCHER} ${NH_SHORTCUT} >/dev/null
    fi
  
}

function create_kex_launcher() {
    KEX_LAUNCHER=${CHROOT}/usr/bin/kex
    cat > $KEX_LAUNCHER <<- EOF
#!/bin/bash

function start-kex() {
    if [ ! -f ~/.vnc/passwd ]; then
        passwd-kex
    fi
    USR=\$(whoami)
    if [ \$USR == "root" ]; then
        SCREEN=":2"
    else
        SCREEN=":1"
    fi
    export HOME=\${HOME}; export USER=\${USR}; LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgcc_s.so.1 nohup vncserver \$SCREEN >/dev/null 2>&1 </dev/null
    starting_kex=1
    return 0
}

function stop-kex() {
    vncserver -kill :1 | sed s/"Xtigervnc"/"NetHunter KeX"/
    vncserver -kill :2 | sed s/"Xtigervnc"/"NetHunter KeX"/
    return $?
}

function passwd-kex() {
    vncpasswd
    return $?
}

function status-kex() {
    sessions=\$(vncserver -list | sed s/"TigerVNC"/"NetHunter KeX"/)
    if [[ \$sessions == *"590"* ]]; then
        printf "\n\${sessions}\n"
        printf "\nYou can use the KeX client to connect to any of these displays.\n\n"
    else
        if [ ! -z \$starting_kex ]; then
            printf '\nError starting the KeX server.\nPlease try "nethunter kex kill" or restart your termux session and try again.\n\n'
        fi
    fi
    return 0
}

function kill-kex() {
    pkill Xtigervnc
    return \$?
}

case \$1 in
    start)
        start-kex
        ;;
    stop)
        stop-kex
        ;;
    status)
        status-kex
        ;;
    passwd)
        passwd-kex
        ;;
    kill)
        kill-kex
        ;;
    *)
        stop-kex
        start-kex
        status-kex
        ;;
esac
EOF

    chmod 700 $KEX_LAUNCHER
}

function fix_profile_bash() {
    ## Prevent attempt to create links in read only filesystem
    if [ -f ${CHROOT}/root/.bash_profile ]; then
        sed -i '/if/,/fi/d' "${CHROOT}/root/.bash_profile"
    fi
}

function fix_sudo() {
    ## fix sudo & su on start
    chmod +s $CHROOT/usr/bin/sudo
    chmod +s $CHROOT/usr/bin/su
    echo "kali    ALL=(ALL:ALL) ALL" > $CHROOT/etc/sudoers.d/kali

    # https://bugzilla.redhat.com/show_bug.cgi?id=1773148
    echo "Set disable_coredump false" > $CHROOT/etc/sudo.conf
}

function fix_uid() {
    ## Change kali uid and gid to match that of the termux user
    USRID=$(id -u)
    GRPID=$(id -g)
    nh -r usermod -u $USRID kali 2>/dev/null
    nh -r groupmod -g $GRPID kali 2>/dev/null
}

function print_banner() {
    clear
    printf "${blue}##################################################\n"
    printf "${blue}##                                              ##\n"
    printf "${blue}##  88      a8P         db        88        88  ##\n"
    printf "${blue}##  88    .88'         d88b       88        88  ##\n"
    printf "${blue}##  88   88'          d8''8b      88        88  ##\n"
    printf "${blue}##  88 d88           d8'  '8b     88        88  ##\n"
    printf "${blue}##  8888'88.        d8YaaaaY8b    88        88  ##\n"
    printf "${blue}##  88P   Y8b      d8''''''''8b   88        88  ##\n"
    printf "${blue}##  88     '88.   d8'        '8b  88        88  ##\n"
    printf "${blue}##  88       Y8b d8'          '8b 888888888 88  ##\n"
    printf "${blue}##                                              ##\n"
    printf "${blue}####  ############# NetHunter ####################${reset}\n\n"
}


##################################
##              Main            ##

# Add some colours
red='\033[1;31m'
green='\033[1;32m'
yellow='\033[1;33m'
blue='\033[1;34m'
light_cyan='\033[1;96m'
reset='\033[0m'

EXTRA_ARGS=""
if [[ ! -z $1 ]]; then
    EXTRA_ARGS=$1
    if [[ $EXTRA_ARGS != "--no-check-certificate" ]]; then
        EXTRA_ARGS=""
    fi
fi

cd $HOME
print_banner
get_arch
set_strings
prepare_fs
check_dependencies
get_rootfs
get_sha
verify_sha
extract_rootfs
create_launcher
cleanup

printf "\n${blue}[*] Configuring NetHunter for Termux ...\n"
fix_profile_bash
fix_sudo
create_kex_launcher
fix_uid

print_banner
printf "${green}[=] Kali NetHunter for Termux installed successfully${reset}\n\n"
printf "${green}[+] To start Kali NetHunter, type:${reset}\n"
printf "${green}[+] nethunter             # To start NetHunter CLI${reset}\n"
printf "${green}[+] nethunter kex passwd  # To set the KeX password${reset}\n"
printf "${green}[+] nethunter kex &       # To start NetHunter GUI${reset}\n"
printf "${green}[+] nethunter kex stop    # To stop NetHunter GUI${reset}\n"
#printf "${green}[+] nethunter kex <command> # Run command in NetHunter env${reset}\n"
printf "${green}[+] nethunter -r          # To run NetHunter as root${reset}\n"
#printf "${green}[+] nethunter -r kex passwd  # To set the KeX password for root${reset}\n"
#printf "${green}[+] nethunter kex &       # To start NetHunter GUI as root${reset}\n"
#printf "${green}[+] nethunter kex stop    # To stop NetHunter GUI root session${reset}\n"
#printf "${green}[+] nethunter -r kex kill # To stop all NetHunter GUI sessions${reset}\n"
#printf "${green}[+] nethunter -r kex <command> # Run command in NetHunter env as root${reset}\n"
printf "${green}[+] nh                    # Shortcut for nethunter${reset}\n\n"
 
Last edited:
  • Like
Reactions: ethical_haquer

jenneh

Senior Member
Okay here is how to solve the Android 12 Termux Process error, it's very simple. Do whatever you have to, to get an adb connection on your device. Send this code:

Code:
adb shell device_config put activity_manager max_phantom_processes 2147483647
take note of this, you may have to repeat this command --i just had to after 2 days use.

thanks to this reddit poster -- ladb is not needed just any adb connection is fine
Open firefox and go to about:config (you may need to enable extra keys and hit the tab button a couple times to get the cursor to go into the toolbar)
3.png

type in
Code:
media.cubeb.sandbox
1.png

Set to false then type in
Code:
security.sandbox.content.level
2.png

Then restart firefox, you now have working browser
4.png

ORIGINAL SERVER
I finally figured out how to get root in the original machine.
Type "su" then use password "toor"

FULL ROOT SERVER
ONLY IF YOU NEED IT!!
(You may need to force close termux in order to send commands again)

In termux run:
Code:
nethunter -r kex passwd
nethunter -r kex
open kex apk and add the port like we did before. (for me it was 5902 this time)
3.png

creds: https://codipher.com/install-kali-nethunter-in-android/

Once you have set this up, you may reopen the Rooted machine at anytime by rerunning:
nethunter -r kex

and then opening the kex apk with port 2
There's some sort of trouble when using apt to install pkgs, they get hung up when dpkging. Here's how to fix...
Make sure you have root then type:
Code:
apt-get remove exploitdb
apt-get remove man-db
dpkg --remove --force-remove-reinstreq exploitdb
dpkg --remove --force-remove-reinstreq man-db
apt-get update
#then optionally you may readd these packages and they will reinstall correctly
apt install man-db
apt install exploitdb
apt install kali-linux-nethunter
sudo apt autoremove
ref:
just a demo of the machine working. this is me using my finger, no mouse. the vnc is amazing <3

Try it out, it's Super Fun~!
 
Last edited:

jenneh

Senior Member
So Kali Linux Nethunter (ARM 64) version is verified working in android on an unrooted device with all the bugs worked out.
(See the two comments above)

Trying to see if it can run the windows arm iso, but of course that can't just be easy. The Gdrive link kept failing in firefox, not sure if there is another setting to be amended or what.

So that being said, here's how to get UUPDUMP to work in this machine after you have fixed the dpkging errors.

Download the Win11arm script from UUPDUMP

Extract it into your downloads folder or whereever you like

Code:
apt install aria2 cabextract wimtools chntpw genisoimage mkisofs
cd Downloads
chmod 777 uup_download_linux.sh
./uup_download_linux.sh
uupstarted.png
as you see it was able to start the script and should have the iso built on the machine shortly. Will see what can be done with the iso tomorrow

if anyone knows how to just download the iso off gdrive with this machine please share how. that would be preferable since in theory one could run mods
 
Last edited:
  • Like
Reactions: furrioustorrus

furrioustorrus

New member
May 24, 2015
3
0
This is really good! I tried this once but could never get it to run. I used kubuntu since it's a really small iso.

Amazing as always!
 

jenneh

Senior Member
@furrioustorrus I tried too in the past without success x.x idk why it just made sense finally. I just really think the possibilities are endless considering how well it runs. Maybe as more people learn more and more about termux and building arm machines on here, maybe this is a new modding / os building funzies thing for the community to enjoy. It can only get better honestly (and easier too)

----so it looks like apt install qemu-system-arm installs aarch64 and the efi driver on this machine
 
Last edited:
  • Like
Reactions: furrioustorrus

furrioustorrus

New member
May 24, 2015
3
0
@furrioustorrus I tried too in the past without success x.x idk why it just made sense finally. I just really think the possibilities are endless considering how well it runs. Maybe as more people learn more and more about termux and building arm machines on here, maybe this is a new modding / os building funzies thing for the community to enjoy. It can only get better honestly (and easier too)

----so it looks like apt install qemu-system-arm installs aarch64 and the efi driver on this machine
Yeah I used a VM to install kubuntu and ran it that way. It worked but it had issues connecting to the internet to do any apt-get commands.

Trés cool
 
Last edited:

jenneh

Senior Member
Day 3 of the VMLand journey... Trying to get virt-manager to run in this machine so we can "easy mode" qemu, or at least maybe learn more about it in another way.. Also have some more fixes for the machine.

To fix the "authorization required but no protocol found" error
run this command in the machine's terminal:
xhost + local
reference
To fix the apt-get upgrade issue with postresql-15 run this code:
Code:
su
toor
rm -rf /var/lib/dpkg/info/postgresql* && dpkg --configure -a
apt-get upgrade -y
and then postresql-15 will finally upgrade right
reference

Then to install qemu and virt-manager run this code:
apt install qemu-system-arm virt-manager

Now the next problem:
1.png

virt-manager is not seeing the libvirt daemon. working on this now just wanted to get my notes up before I got lost.
egrep -c '(vmx|svm)' /proc/cpuinfo
running that shows a value of 0 so kvm is not possible i guess?

---Tip about enabling use of extra keys. It is advised to remember to minimize this feature after use, else you can cause yourself a bug when using the screen keyboard and swiping it off... Sometimes this action causes the tab key to auto engage and with no solution other than to force close termux and reopen.

That being said, this is the fastest way I know to close termux, maybe someone knows a good app or widget that could close it even faster.

it's only three clicks maybe we could do two or even better 1 click... XD
 
Last edited:
  • Like
Reactions: furrioustorrus

jenneh

Senior Member
Here's something super interesting. A new QEMU apk other than Limbo, not sure if this is homebrew or what the genesis of the apk is. Going to play with the arm features on it and report back...

1.png



as an update this app doesn't do much other than to help the user to get the qemu code for their images. i think it would be a lot easier just to build a github repo with the working code instead when we get there
Back on Point,
This is code for qemu in termux again. Have figured out how to get it to boot in termux to this point with this code. It's not fully functional but it is progress

Qemu EFI and VARS Images Extract those and put them in your downloads folder
Code:
termux-setup-storage
cd storage/downloads
dd if=/dev/zero of=pflash1.img bs=1M count=64
dd if=/dev/zero of=pflash0.img bs=1M count=64
dd if=QEMU_EFI.fd of=pflash0.img conv=notrunc
dd if=QEMU_VARS.fd of=pflash1.img conv=notrunc
qemu-img create -f qcow2 win11arm.img 100G

#paste all of the code below
qemu-system-aarch64 -nographic -machine virt,gic-version=max -m 2048M -cpu max -smp 4 -vnc 127.0.0.1:3 -drive file=win11arm.img,if=none,id=drive0,cache=writeback -device virtio-blk,drive=drive0,bootindex=0 -drive file=win11arm.iso,if=none,format=raw,id=drive1,cache=writeback -device virtio-blk,drive=drive1,bootindex=1 -drive file=pflash0.img,format=raw,if=pflash -drive file=pflash1.img,format=raw,if=pflash -net nic -net user
This method combined both of these guides:
A visual cue of block sizes:
finally got the windows insider vhd downloading, going to also see if i can't get qemu to run elsewhere with the iso and prebuild my own vhd.
this guide has a modded uefi driver that allows for VGA support and a way to install the drivers and the code. Just really hurts my head to understand but getting there
 
Last edited:
  • Like
Reactions: furrioustorrus

jenneh

Senior Member

I made it this far now in just termux with qemu.

run.sh code
Code:
qemu-system-aarch64 -device VGA -machine virt,gic-version=max -m 4096M -cpu max -smp 4 -vnc 127.0.0.1:3 -drive file=win11arm.img,if=none,id=drive0,cache=writeback -device virtio-blk,drive=drive0,bootindex=0 -drive file=win11arm.iso,if=none,format=raw,id=drive1,cache=writeback -device virtio-blk,drive=drive1,bootindex=1 -drive file=pflash0.img,format=raw,if=pflash -drive file=pflash1.img,format=raw,if=pflash

this has a blank hard drive built and the efi and vars pflash files prebuilt with the run.sh script.

the modded iso bypasses it but it goes to that edk2 screen again. not sure how to even go about researching this part haha if anyone has any ideas?

I forgot to add the line of code that enables mouse and keyboard support so if anyone trys this before i polish things up you need to add this code to the run.sh script -device nec-usb-xhci -device usb-kbd -device usb-mouse
typing exit as that article suggests then loads you into the efi screen to be able to manage boot options. maybe the win11 hard drive needs to be bumped up in boot order by code somehow

so supposedly the option is indeed in the boot manager but the trouble is for some reason the boot menu is not descriptive

so i got into the efi menu and went into the boot manager, none of the options boot except the last and it says start pxe over ipv4 error
1.png

2.png
3.png

So I'm pretty sure now that I need to set the Iso to boot first in the code and maybe that will fix it

--edit nope the revised code results in same error, but at least we got a clue why the cd isnt turning over thanks to the boot menu

revised code
Code:
qemu-system-aarch64 -drive file=pflash0.img,format=raw,if=pflash -drive file=pflash1.img,format=raw,if=pflash -device nec-usb-xhci -device usb-kbd -device usb-mouse -device VGA -machine virt,gic-version=max -m 4096M -cpu max -smp 4 -vnc 127.0.0.1:3 -drive file=win11arm.iso,if=none,format=raw,id=drive0,cache=writeback -device virtio-blk,drive=drive0,bootindex=0 -drive file=win11arm.img,if=none,format=raw,id=drive1,cache=writeback -device virtio-blk,drive=drive1,bootindex=1


as a side note, i downloaded the vhdx from the windows insider program and ran this code:
Code:
qemu-system-aarch64 -drive file=pflash0.img,format=raw,if=pflash -drive file=pflash1.img,format=raw,if=pflash -device nec-usb-xhci -device usb-kbd -device usb-mouse -device VGA -machine virt,gic-version=max -m 4096M -cpu max -smp 4 -vnc 127.0.0.1:3 -device virtio-blk,drive=system -drive if=none,id=system,format=raw,file=system.vhdx
it does the same exact thing. shows the logo, but gets dropped into the uefi shell.

This thread shares some light on how to convert the windows insider vhdx to vhdk
Code:
qemu-img convert -p -O vmdk system.vhdx system.vhdk
and windows 10 same error "Start PXE over IPV4"
so the efi driver is v 2.2 there are later versions will find one and reflash it
the article references omvf which is a package we can install in termux
So i did the steps in the video with the win10arm qcow2 file, it makes it further than the iso does, but termux force closes itself even with extra steps added to stop killing phantom processes

update it was user error and i put too much ram. i reduced it to 2048 and it boots super slow. maybe someone with a device that supports kvm can see if it runs okay for them
Code:
qemu-system-aarch64 -m 2048M -smp 8 -device VGA -M virt -cpu max -monitor stdio -device nec-usb-xhci -device usb-kbd -device usb-mouse -usb -bios QEMU_EFI.img -vnc :3 -hda windows10arm64.qcow2 -accel tcg,thread=multi
this guide even though it uses vmware it explains a lot about the problem
So the reason why this one worked to the point it did was because it has a modified uefi driver to include use of the VGA display
 
Last edited:
  • Like
Reactions: furrioustorrus

jenneh

Senior Member
UPDATE:
Finally got Windows 10 arm to load in termux, using qemu and an insider image. So what was going wrong before was I was being dumb and adding too much ram to the machine and that would force close termux at a certain point in the boot. (so keep in mind you can change the ram values but if it is too much it will just crash termux)

Now it will run like a potato unless you have kvm, but it works. This is using a modified efi driver and a premade win10 arm image from archive.org (an old windows 10 arm insider image)

Code:
qemu-system-aarch64 -m 2048M -smp 8 -device VGA -M virt -cpu max -monitor stdio -device nec-usb-xhci -device usb-kbd -device usb-mouse -usb -bios QEMU_EFI.img -vnc :3 -hda windows10arm64.qcow2 -accel tcg,thread=multi

1.png
2.png
3.png
 

OldNoobOne

Senior Member
UPDATE:
Finally got Windows 10 arm to load in termux, using qemu and an insider image. So what was going wrong before was I was being dumb and adding too much ram to the machine and that would force close termux at a certain point in the boot. (so keep in mind you can change the ram values but if it is too much it will just crash termux)

Now it will run like a potato unless you have kvm, but it works. This is using a modified efi driver and a premade win10 arm image from archive.org (an old windows 10 arm insider image)

Code:
qemu-system-aarch64 -m 2048M -smp 8 -device VGA -M virt -cpu max -monitor stdio -device nec-usb-xhci -device usb-kbd -device usb-mouse -usb -bios QEMU_EFI.img -vnc :3 -hda windows10arm64.qcow2 -accel tcg,thread=multi

Nice to see that screen on an Android :)
does everything run same as Win10 PC with your emulator?
I'm using Win10 v1709, I think 1709 is even better than v.1809 or 22H2 or even Win11 in some ways. Its great experiment this seems good but is 6 inch screen go with it?
 

jenneh

Senior Member
Nice to see that screen on an Android :)
does everything run same as Win10 PC with your emulator?
I'm using Win10 v1709, I think 1709 is even better than v.1809 or 22H2 or even Win11 in some ways. Its great experiment this seems good but is 6 inch screen go with it?
I am unable to test too much because I don't think my phones CPU allows kvm support. Therefore it runs awful. It looks similar but I am unsure whether executables would work natively or anything yet. Someone who would likely have more luck testing would be a Google phone owner. That's the phone I will look into getting next but it will be some time https://www.xda-developers.com/android-13-dp1-google-pixel-6-kvm-virtual-machine/
 
  • Like
Reactions: OldNoobOne

jenneh

Senior Member
I ran into a lot of videos peddling modded winxp as win10 or 11 arm and decided to try to install xp in qemu.
It's taking forever to install on the phone so I decided to try to install it in qemu on windows to see if that would be any faster..
It is but it wasn't as much faster as I had thought it would be... So if you ever wanted to know how to install things in qemu on windows (without nox, lol) here's how.
Download qemu for windows direct link
Paste your iso into C:\Program Files\qemu
I am using windows xp here's my backup: google drive mirror or use the original link, archive.org
Open powershell as admin and run this code:
Code:
cd "C:\Program Files\qemu"
.\qemu-img create -f qcow2 winxp.img 100G
.\qemu-system-x86_64 -smp 8 -cpu max -net nic -net user -m 2048 -cdrom winxp.iso -hda winxp.img
You can change the "winxp" text to whatever iso you want to install. You can adjust the ram: -m as well. You can actually do a lot more, see the user manual
Here's how to install winxp on your phone:
Download the iso: I am using windows xp here's my backup: google drive mirror or use the original link, archive.org
Download install.sh on your phone, or make a new file in your downloads folder and paste the text from the code below.
Open termux and type:
Code:
termux-setup-storage
cd storage
cd downloads
cat install.sh
Then copy and paste the text, that will install everything needed, and start the machine for you to run through the setup.
We cat the script to copy and paste it because termux is weird executing a script bigger than 3 or 4 lines.

install.sh code if needed:
Code:
pkg install x11-repo
pkg upgrade
pkg install qemu-system-x86-64
pkg install qemu-utils
mkdir winxp
cd winxp
qemu-img create -f qcow2 winxp.img 100G
qemu-system-x86_64 -smp 8 -cpu max -net nic -net user -m 2048 -vnc 127.0.0.1:3 -cdrom ~/storage/downloads/winxp.iso -hda winxp.img

Once Windows XP is fully installed you can boot it from now on using this line of code:
Code:
qemu-system-x86_64 -smp 8 -cpu max -net nic -net user -m 2048 -vnc 127.0.0.1:3 -hda winxp.img

Or dl this prebuilt run.sh script
As a note, if you use any of the code above, the -net code needs to be replaced. Winxp needs this code instead:
-net user -net nic,model=rtl8139 ref

Premade winxp hard drive:
 
Last edited:

Zai23

Member
Sep 2, 2018
26
3
40
This is a Tangent, but a fun one. Maybe we can mount the win11arm iso in this machine?

VERIFIED WORKING, NO ROOT NEEDED
View attachment 5825839
This is how to install ARM64 Kali Linux in Termux with Kex Vnc.
This machine runs amazing on my Potato Nokia G20 :D

Download the Termux apk for your device

Code:
pkg install x11-repo
pkg upgrade
pkg install wget

wget -O install-nethunter-termux https://offs.ec/2MceZWr
chmod +x install-nethunter-termux
./install-nethunter-termux

exit
In a browser on your android device, go to this link to download and install the "NetHunterStore"
Search in the app for "kex" and install.
Select Package Installer if prompted to
View attachment 5825845

In termux setup kex:
Code:
nethunter kex passwd
nethunter kex

Then open the kex app and set the port (usually 5901) and it should boot

Thanks to David Bomball for sharing this

The PDF David shared if you have any issues

The Android 12 Known issues:
The problem is termux keeps getting forced closed out of no where only on Android 12. Trying to see if I can find a solution. This machine runs smooth as a dream.. just cannot get it to stay open long enough to dl the arm iso to it
If you are running anything less than 12 it is reported there are no issues.

From now on you can use:
nethunter kex

and then open the kex apk with port 1 to boot into a normal user machine. See below for Root.
What are the limitations of what you can do on it, though? Do you have internet functioning? USB through OTG? Thank you in advance!
 

jenneh

Senior Member
What are the limitations of what you can do on it, though? Do you have internet functioning? USB through OTG? Thank you in advance!
It does have internet, the terminal is able to install whatever you like (i didnt personally have trouble installing programs). You have su access in the terminal as well, so really the only limitations will be computational power of your phone for whatever it is you want to do. That nethunter version of kali was the best running OS on my generic phone so it makes me question if it is 32 bit arm or 64? This documentation may have the answer https://www.kali.org/docs/nethunter/installing-nethunter/

USB through OTG still needs to be tested, I don't have one of these yet for my keyboard / mouse, just used it natively
 

Zai23

Member
Sep 2, 2018
26
3
40
It does have internet, the terminal is able to install whatever you like (i didnt personally have trouble installing programs). You have su access in the terminal as well, so really the only limitations will be computational power of your phone for whatever it is you want to do. That nethunter version of kali was the best running OS on my generic phone so it makes me question if it is 32 bit arm or 64? This documentation may have the answer https://www.kali.org/docs/nethunter/installing-nethunter/

USB through OTG still needs to be tested, I don't have one of these yet for my keyboard / mouse, just used it natively
If you can use it like a local machine then, theoretically, you would be able to use this emulated Linux to do anything, even get other Android devices rooted or flashing them with a custom ROM through Fastboot. Am I correct? If you try this, please let me know. I have been asking about this for a while now. Thanks!
 

jenneh

Senior Member
@Zai23 "even get other Android devices rooted or flashing them with a custom ROM through Fastboot" You are Correct In Theory (i say in theory cause i can only confirm adb works right now --wirelessly, but fastboot would need the otg cable to try)

edit-- my shield is flashable via usb-c cable, so i need to reinstall kali to see if the phone detects the shield in fastboot, will let you know

results-- So it doesn't natively see the shield plugged into the phone's usb-c port by typing fastboot devices, going to see if there would be a way to get it to post on the phone and will pick up a otg cable for testing tomorrow

 
Last edited:

Zai23

Member
Sep 2, 2018
26
3
40
@Zai23 "even get other Android devices rooted or flashing them with a custom ROM through Fastboot" You are Correct In Theory (i say in theory cause i can only confirm adb works right now --wirelessly, but fastboot would need the otg cable to try)

edit-- my shield is flashable via usb-c cable, so i need to reinstall kali to see if the phone detects the shield in fastboot, will let you know

results-- So it doesn't natively see the shield plugged into the phone's usb-c port by typing fastboot devices, going to see if there would be a way to get it to post on the phone and will pick up a otg cable for testing tomorrow

Ok, I'm sorry for not being specific enough but when I said Fastboot I meant using an OTG cable. Same as using USB on Linux running on a desktop. Thanks for the update. I'm anxious to see if there is a specific distro that would show your Shield when you type in the command. There's so many mobile linux out there but I mentioned Ubuntu Touch because it seems to be the most widely used in mobile from what I've been reading.
 
  • Like
Reactions: jenneh

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Working Ubuntu ARM 64 for Termux with GUI
    SOURCE:

    Code:
    pkg install x11-repo
    pkg update
    pkg install git wget -y
    git clone --depth=1 https://github.com/modded-ubuntu/modded-ubuntu.git
    cd modded-ubuntu
    bash setup.sh

    1678963103823.png

    This will start the script and it will install Ubuntu for us.

    1678963225405.png

    When the setup script is done, it will ask you to restart Termux. Then run the user script.

    1678963406830.png

    So force stop Termux in settings and reopen it. Run this code:
    Code:
    ubuntu
    bash user.sh

    1678963598635.png

    When you get here make sure to use an all lowercase name, don't use numbers it will mess things up

    When you are done, force close and restart termux as we did before, then run this code:
    Code:
    ubuntu
    sudo bash gui.sh

    This will take about 30mins to an hour to complete. When it is done you will have a working modded Ubuntu Arm 64 machine running in Termux with a GUI.

    Type vncstart then use the VNC APP of your choice, I used Nethunter Kex.

    WHAT IT LOOKS LIKE:
    Screenshot_20230316-055207.png
    Screenshot_20230316-055216.png
    Screenshot_20230316-055153.png
    If you encounter any interesting Termux scripts in your travels, please do share!
    1
    Hi there.

    I want to explain better what these termux scripts are doing, as it pertains to something I am trying to figure out how to do. (PS I did not create any of the scripts I shared above and everything being shared below is theory right now)

    These scripts are using the termux package called proot-distro to download, build, and maintain the distro. Proot-distro is storing and managing everything in the /data/data/com.termux/files/usr/var/lib/proot-distro/installed-rootfs/ directory.

    I want to be able to take a fully built machine and copy it and be able to easily reinstall it, instead of having to spend an hour installing. I also want to be able to share these prebuilt machines with others. I tried in a couple of terminal emulators a couple of different ways to copy the Ubuntu directory from the installed-rootfs directory but it spits out symbolic link errors.

    Upon reading the github page for the proot-distro, it appears they have their own methods built in for backup which I think is due to the fact that proot shares the kernel with our android device that we are running it on, therefore it inherits all selinux / other security parameters, thus creating the symlinks. Not sure? Maybe someone can explain this part better


    Backup:
    1.PNG


    and here is how to restore:
    2.PNG


    This is just a knowledge dump for now. Waiting on phone to charge more and will start with the ubuntu machine and see if it can be backed up and restored as imagined.

    PS I think if I am reading the restore instructions correctly, it is saying if you already had an Ubuntu distro installed, if you were to "restore" using a backed up tar archive, that the archive will completely override the old machine's values fully with the backup's values. So there would be no need to uninstall the current distro if I am understanding correctly.

    --edit yes I understood correctly, but here is the missing part, you Must have an ubuntu distro installed in order to restore a backup. It doesn't have to be populated with anything, just simply proot-distro install ubuntu must be ran prior to the restore command if you didn't already have ubuntu installed.

    I looked at the source code for the ubuntu modded machine and it helped to illustrate how this all works, maybe looking at it will help you too?
    Code:
    #!/bin/bash
    
    R="$(printf '\033[1;31m')"
    G="$(printf '\033[1;32m')"
    Y="$(printf '\033[1;33m')"
    B="$(printf '\033[1;34m')"
    C="$(printf '\033[1;36m')"
    W="$(printf '\033[1;37m')"
    
    CURR_DIR=$(realpath "$(dirname "$BASH_SOURCE")")
    UBUNTU_DIR="$PREFIX/var/lib/proot-distro/installed-rootfs/ubuntu"
    
    banner() {
        clear
        cat <<- EOF
            ${Y}    _  _ ___  _  _ _  _ ___ _  _    _  _ ____ ___
            ${C}    |  | |__] |  | |\ |  |  |  |    |\/| |  | |  \
            ${G}    |__| |__] |__| | \|  |  |__|    |  | |__| |__/
    
        EOF
        echo -e "${G}     A modded gui version of ubuntu for Termux\n\n"${W}
    }
    
    package() {
        banner
        echo -e "${R} [${W}-${R}]${C} Checking required packages..."${W}
     
        [ ! -d '/data/data/com.termux/files/home/storage' ] && echo -e "${R} [${W}-${R}]${C} Setting up Storage.."${W} && termux-setup-storage
    
        if [[ $(command -v pulseaudio) && $(command -v proot-distro) ]]; then
            echo -e "\n${R} [${W}-${R}]${G} Packages already installed."${W}
        else
            yes | pkg upgrade
            packs=(pulseaudio proot-distro)
            for x in "${packs[@]}"; do
                type -p "$x" &>/dev/null || {
                    echo -e "\n${R} [${W}-${R}]${G} Installing package : ${Y}$x${C}"${W}
                    yes | pkg install "$x"
                }
            done
        fi
    }
    
    distro() {
        echo -e "\n${R} [${W}-${R}]${C} Checking for Distro..."${W}
        termux-reload-settings
     
        if [[ -d "$UBUNTU_DIR" ]]; then
            echo -e "\n${R} [${W}-${R}]${G} Distro already installed."${W}
            exit 0
        else
            proot-distro install ubuntu
            termux-reload-settings
        fi
     
        if [[ -d "$UBUNTU_DIR" ]]; then
            echo -e "\n${R} [${W}-${R}]${G} Installed Successfully !!"${W}
        else
            echo -e "\n${R} [${W}-${R}]${G} Error Installing Distro !\n"${W}
            exit 0
        fi
    }
    
    sound() {
        echo -e "\n${R} [${W}-${R}]${C} Fixing Sound Problem..."${W}
        [ ! -e "$HOME/.sound" ] && touch "$HOME/.sound"
        echo "pulseaudio --start --exit-idle-time=-1" >> "$HOME/.sound"
        echo "pacmd load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" >> "$HOME/.sound"
    }
    
    downloader(){
        path="$1"
        [ -e "$path" ] && rm -rf "$path"
        echo "Downloading $(basename $1)..."
        curl --progress-bar --insecure --fail \
             --retry-connrefused --retry 3 --retry-delay 2 \
              --location --output ${path} "$2"
        echo
    }
    
    setup_vnc() {
        if [[ -d "$CURR_DIR/distro" ]] && [[ -e "$CURR_DIR/distro/vncstart" ]]; then
            cp -f "$CURR_DIR/distro/vncstart" "$UBUNTU_DIR/usr/local/bin/vncstart"
        else
            downloader "$CURR_DIR/vncstart" "https://raw.githubusercontent.com/modded-ubuntu/modded-ubuntu/master/distro/vncstart"
            mv -f "$CURR_DIR/vncstart" "$UBUNTU_DIR/usr/local/bin/vncstart"
        fi
    
        if [[ -d "$CURR_DIR/distro" ]] && [[ -e "$CURR_DIR/distro/vncstop" ]]; then
            cp -f "$CURR_DIR/distro/vncstop" "$UBUNTU_DIR/usr/local/bin/vncstop"
        else
            downloader "$CURR_DIR/vncstop" "https://raw.githubusercontent.com/modded-ubuntu/modded-ubuntu/master/distro/vncstop"
            mv -f "$CURR_DIR/vncstop" "$UBUNTU_DIR/usr/local/bin/vncstop"
        fi
        chmod +x "$UBUNTU_DIR/usr/local/bin/vncstart"
        chmod +x "$UBUNTU_DIR/usr/local/bin/vncstop"
    }
    
    permission() {
        banner
        echo -e "${R} [${W}-${R}]${C} Setting up Environment..."${W}
    
        if [[ -d "$CURR_DIR/distro" ]] && [[ -e "$CURR_DIR/distro/user.sh" ]]; then
            cp -f "$CURR_DIR/distro/user.sh" "$UBUNTU_DIR/root/user.sh"
        else
            downloader "$CURR_DIR/user.sh" "https://raw.githubusercontent.com/modded-ubuntu/modded-ubuntu/master/distro/user.sh"
            mv -f "$CURR_DIR/user.sh" "$UBUNTU_DIR/root/user.sh"
        fi
        chmod +x $UBUNTU_DIR/root/user.sh
    
        setup_vnc
        echo "$(getprop persist.sys.timezone)" > $UBUNTU_DIR/etc/timezone
        echo "proot-distro login ubuntu" > $PREFIX/bin/ubuntu
        chmod +x "$PREFIX/bin/ubuntu"
        termux-reload-settings
    
        if [[ -e "$PREFIX/bin/ubuntu" ]]; then
            banner
            cat <<- EOF
                ${R} [${W}-${R}]${G} Ubuntu-22.04 (CLI) is now Installed on your Termux
                ${R} [${W}-${R}]${G} Restart your Termux to Prevent Some Issues.
                ${R} [${W}-${R}]${G} Type ${C}ubuntu${G} to run Ubuntu CLI.
                ${R} [${W}-${R}]${G} If you Want to Use UBUNTU in GUI MODE then ,
                ${R} [${W}-${R}]${G} Run ${C}ubuntu${G} first & then type ${C}bash user.sh${W}
            EOF
            { echo; sleep 2; exit 1; }
        else
            echo -e "\n${R} [${W}-${R}]${G} Error Installing Distro !"${W}
            exit 0
        fi
    
    }
    
    package
    distro
    sound
    permission

    👾👾👾👾
    1
    How to backup your machine:
    Code:
    proot-distro backup --output ubuntu-backup.tar.gz ubuntu
    You can change the distro name "ubuntu" to whichever one you are trying to backup. This is just an example

    How to pull the backup from your phone:
    Code:
    termux-setup-storage
    cp ubuntu-backup.tar.gz storage/downloads
    adb pull sdcard/Download/ubuntu-backup.tar.gz

    1.png



    1680091382758.png


    The ubuntu premade is 800mb zipped.
  • 4
    Update: A new thread is created to house "premade" virtual machines
    https://forum.xda-developers.com/t/prebuilt-arm-virtual-machines-for-termux.4570275/

    This machine seems to be working fine out of the box
    This machine runs amazing once you do all the troubleshooting steps included in the comments
    This one can really use some work, maybe someone can figure out what is wrong with it
    You can do the same for win11, get the image off archive.org but it wont work well unless your phone supports KVM or you have a work around
    As an edit and an update, the method listed below uses x86_64 version of qemu which will not run well on our phones. This guide also uses an android emulator to teach basics of building a virtual machine in qemu, but in practice on a phone it will be much different, when we use an Arm version of qemu. I am leaving this guide up though as it was fundamental in helping myself personally to even begin to understand qemu and the architectures and how to use the code.

    This guide uses a modded nox android emulator which can be found HERE

    Hello Friends~!

    Today I will be walking you through using Termux, QEMU, and a VNC server to Run Windows or Linux isos on Your Android Devices as well as Android Emulators like Nox on Windows 10.
    DOWNLOAD TERMU:

    Paste your iso and termu's apps in Barenox/bin, then install them in Nox.
    1.PNG

    Then install the apks by using the apk button on nox
    2.PNG
    BUILDING QEMU

    In Termux, type:

    Code:
    pkg install x11-repo
    apt-get upgrade -y
    pkg install qemu-utils -y
    pkg install qemu-system-x86-64-headless -y

    BUILDING THE VIRTUAL MACHINE'S ENVIRONMENT

    In Termux, type:

    Code:
    mkdir win7
    cd win7
    qemu-img create -f qcow2 win7.img 100G

    A note here is that the name or command "win7" can be any iso you want to install.

    For instance, you have an Ubuntu iso you want to install, use:

    Code:
    mkdir ubuntu
    cd ubuntu
    qemu-img create -f qcow2 ubuntu.img 100G

    Then change the name of your iso to "ubuntu.iso" and so forth

    100G can be edited as well. If you are worried about hard drive space, no need.

    It is saved in qemu's take on sparse image format, "qcow2 files" (QEMU Copy On Write) thus only taking up space as you use it.

    USING ADB TO PUSH THE ISO

    In Barenox/bin

    Open command prompt from the toolbar and run:

    Code:
    adb push win7.iso /data/data/com.termux/files/home/win7

    Take note that /data/data/com.termux/... etc is where termux stores everything
    4.PNG
    5.PNG
    BUILDING THE VIRTUAL MACHINE

    In termux type:

    Code:
    qemu-system-x86_64 -smp 2 -net nic -net user -device AC97 -m 2048 -vnc 127.0.0.1:7 -cdrom win7.iso -hda win7.img

    Take note that the port of "7" after our local server ip of 127.0.0.1 can be edited. I set this to 7 since this is windows 7

    This is in reference to the "5900" port number asked for with VNC.

    Install your vnc app. I used "vnc viewer"

    The server ip will be 127.0.0.1 if asked and the port is 5907

    or

    127.0.0.1:5907
    7.PNG
    8.PNG

    tadah~!
    9.PNG
    RUNNING THE MACHINE LATER

    In termux

    Code:
    cd win7
    qemu-system-x86_64 -smp 2 -net nic -net user -device AC97 -m 2048 -vnc 127.0.0.1:7 -hda win7.img

    Then reopen the VNC App

    These steps have all been automated, see the EXECUTABLE SCRIPTS section

    IF YOU LEARN BETTER VISUALLY HERE IS A VIDEO OF THE STEPS

    Termux Direct Apk DL:
    VNC:
    This Guide Helped Me Get Started:
    This Guide Helped Me To Understand How To "Run a Batch" in Linux (.sh)
    What is a VNC?
    Helped Me To Reprogram Parameters
    ## Development
    Urs Wolfer started QtEmu as school project. Ben Klopfenstein began adding some features that he wanted.
    And in 2009 the project stoped its development.

    In 2017 Sergio Carlavilla started from scrach the development of the 2.0 version. The new UI has based on
    VirtualBox OSE and Virt-manager.
    original repo
    Android On Windows, With Windows~!
    2
    Working Ubuntu ARM 64 for Termux with GUI
    SOURCE:

    Code:
    pkg install x11-repo
    pkg update
    pkg install git wget -y
    git clone --depth=1 https://github.com/modded-ubuntu/modded-ubuntu.git
    cd modded-ubuntu
    bash setup.sh

    1678963103823.png

    This will start the script and it will install Ubuntu for us.

    1678963225405.png

    When the setup script is done, it will ask you to restart Termux. Then run the user script.

    1678963406830.png

    So force stop Termux in settings and reopen it. Run this code:
    Code:
    ubuntu
    bash user.sh

    1678963598635.png

    When you get here make sure to use an all lowercase name, don't use numbers it will mess things up

    When you are done, force close and restart termux as we did before, then run this code:
    Code:
    ubuntu
    sudo bash gui.sh

    This will take about 30mins to an hour to complete. When it is done you will have a working modded Ubuntu Arm 64 machine running in Termux with a GUI.

    Type vncstart then use the VNC APP of your choice, I used Nethunter Kex.

    WHAT IT LOOKS LIKE:
    Screenshot_20230316-055207.png
    Screenshot_20230316-055216.png
    Screenshot_20230316-055153.png
    If you encounter any interesting Termux scripts in your travels, please do share!
    2
    UPDATE:
    Finally got Windows 10 arm to load in termux, using qemu and an insider image. So what was going wrong before was I was being dumb and adding too much ram to the machine and that would force close termux at a certain point in the boot. (so keep in mind you can change the ram values but if it is too much it will just crash termux)

    Now it will run like a potato unless you have kvm, but it works. This is using a modified efi driver and a premade win10 arm image from archive.org (an old windows 10 arm insider image)

    Code:
    qemu-system-aarch64 -m 2048M -smp 8 -device VGA -M virt -cpu max -monitor stdio -device nec-usb-xhci -device usb-kbd -device usb-mouse -usb -bios QEMU_EFI.img -vnc :3 -hda windows10arm64.qcow2 -accel tcg,thread=multi

    1.png
    2.png
    3.png
    1
    Looks great, will give it a try later. Thanks for the time & effort! 🤙🏽
    1
    How to backup your machine:
    Code:
    proot-distro backup --output ubuntu-backup.tar.gz ubuntu
    You can change the distro name "ubuntu" to whichever one you are trying to backup. This is just an example

    How to pull the backup from your phone:
    Code:
    termux-setup-storage
    cp ubuntu-backup.tar.gz storage/downloads
    adb pull sdcard/Download/ubuntu-backup.tar.gz

    1.png



    1680091382758.png


    The ubuntu premade is 800mb zipped.