I tried it on my OnePlus 5 running stock Android 10 and it works, but it takes a long time to boot up and feels slow (both host and guest) which is normal for a different architecture virtualized OS.
Welcome to Termux!
Community forum: https://termux.com/community
Gitter chat: https://gitter.im/termux/termux
IRC channel: #termux on libera.chat
Working with packages:
* Search packages: pkg search <query>
* Install a package: pkg install <package>
* Upgrade packages: pkg upgrade
Subscribing to additional repositories:
* Root: pkg install root-repo
* X11: pkg install x11-repo
Report issues at https://termux.com/issues
~ $ cd alpine
qemu-system-x86_64 -machine q35 -m 2048 -smp cpus=4 -cpu qemu64 \
-drive if=pflash,format=raw,read-only=on,file=$PREFIX/share/qemu/edk2-x86_64-code.fd \
-netdev user,id=n1,hostfwd=tcp::8123-:8123,hostfwd=tcp::9000-:9000,hostfwd=tcp::6052-:6052,hostfwd=tcp::49154-:49154,hostfwd=tcp::61208-:61208,hostfwd=tcp::3218-:3218 \
-device virtio-net,netdev=n1 \
-nographic alpine_2.qcow2
BdsDxe: failed to load Boot0001 "UEFI QEMU DVD-ROM QM00005 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0): Not Found
BdsDxe: loading Boot0002 "UEFI QEMU HARDDISK QM00001 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0xFFFF,0x0)
BdsDxe: starting Boot0002 "UEFI QEMU HARDDISK QM00001 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0xFFFF,0x0)
Welcome to GRUB!
Welcome to Alpine Linux 3.16
Kernel 5.15.78-0-virt on an x86_64 (/dev/ttyS0)
alpineop5 login: root
Password:
Welcome to Alpine!
The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <http://wiki.alpinelinux.org/>.
You can setup the system with the command: setup-alpine
You may change this message by editing /etc/motd.
alpineop5:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b302dadea6a2 ghcr.io/home-assistant/home-assistant:latest "/init" 44 minutes ago Up 2 minutes homeassistant
e59c38ef7d00 causticlab/hass-configurator-docker:latest "/app/run.sh" 51 minutes ago Up 13 seconds 0.0.0.0:3218->3218/tcp, :::3218->3218/tcp configurador-hass-configurator-1
a37544f8da52 esphome/esphome "/entrypoint.sh dash…" 5 hours ago Up 2 minutes esphome
b7ea2ae49547 filebrowser/filebrowser:latest "/filebrowser --noau…" 5 hours ago Up 13 seconds (health: starting) 0.0.0.0:49154->80/tcp, :::49154->80/tcp archivos-filebrowser-1
645d8e7d288e portainer/portainer-ce:latest "/portainer" 5 hours ago Up 58 seconds 8000/tcp, 9443/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp portainer
alpineop5:~#
if (!_Py_InIntegralTypeRange(_PyTime_t, d)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./Include/pymath.h:228:82: note: expanded from macro ‘_Py_InIntegralTypeRange’ #define _Py_InIntegralTypeRange(type, v) (_Py_IntegralTypeMin(type) <= v && v <= _Py_IntegralTypeMax(type)) ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~ ./Include/pymath.h:221:124: note: expanded from macro ‘_Py_IntegralTypeMax’ #define _Py_IntegralTypeMax(type) ((_Py_IntegralTypeSigned(type)) ? (((((type)1 << (sizeof(type)*CHAR_BIT - 2)) - 1) << 1) + 1) : ~(type)0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ Python/bootstrap_hash.c:141:17: error: call to undeclared function ‘getrandom’; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] n = getrandom(dest, n, flags); ^ Python/bootstrap_hash.c:145:17: error: call to undeclared function ‘getrandom’; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration] n = getrandom(dest, n, flags); ^ 2 errors generated. make[3]: *** [Makefile:1855: Python/bootstrap_hash.o] Error 1 make[3]: *** Waiting for unfinished jobs…
I have 3 possibilities. None of the following versions of python is working for me but i would like to concentrate my efforts on one of them. I’m wondering which one.
Version 3.9.7: I had SSL error.
Version 3.10.4 build from source : I had an error in ‘getrandom’
Version 3.11 I had an error due to longintrep.h
I have chosen to try again the installation with python 3.11. So I had again the error due to “longintrep.h”.
I have found an interesting solution here:
I have created the file requirements.txt with: pip3 freeze > requirements.txt
I have then edited the versions indicated in the requirements.txt file (aiohttp, yarl, frozenlist) and then used: pip install -r requirements.txt
I don’t have anymore the error due to “longintrep.h” but I have stopped the installation because I have a version conflict.
I have described it here: Dependency on AIOHTTP
Hi! I’ve just try for the first time to do this and i have no basic on programming or python & Co. i use a old nexus 7 (2012) tablet for this and i have some issue with Homeassistant. I try all day to install this 2 components make me mad. all other thing is alredy installed ( and also here i have some hard time to resolve the issue)
Hi all, after installing HA it is not possible to start it… I have python 3.11. This is my error massage. (hass) ~ $ hass -v Traceback (most recent call last): File "/data/data/com.termux/files/home/hass/bin/hass", line 5, in <module> from homeassistant.__main__ import main File "/data/data/com.termux/files/home/hass/lib/python3.11/site-packages/homeassistant/__main__.py", line 19 from homeassistant.util.async import run_callback_threadsafe ^^^^^ SyntaxError: invalid syntax (hass) ~ $ hass -v Traceback (most recent call last): File "/data/data/com.termux/files/home/hass/bin/hass", line 5, in <module> from homeassistant.__main__ import main File "/data/data/com.termux/files/home/hass/lib/python3.11/site-packages/homeassistant/__main__.py", line 19 from homeassistant.util.async import run_callback_threadsafe ^^^^^ SyntaxError: invalid syntax
If you had a working version of Home Assistant on Python 3.10, but it all broke down in Python 3.11, then here are the steps to go back to Python 3.10:
How to Downgrade Python from 3.11 to 3.10 in Termux
If you already installed python version 3.11 first uninstall it
You will get an error, ignore it. Just give next commands
ls
mkdir build
cd build
ar x ../python.deb
tar Jvxf data.tar.xz
cp -R data/data/pl.sviete.dom/files/usr/* $PREFIX/
cd ..
rm -rf data
echo "export LD_LIBRARY_PATH=$PREFIX/lib" > .bashrc
source .bashrc
Local install with something like pip install -e folder homeassistant
after that, start hass started
during start, it hangs at installing PyTurboJPEG
(fixing ystemError: One of the required function to build numpy is not available (the list is [‘sin’, ‘cos’, ‘tan’, ‘sinh’, ‘cosh’, ‘tanh’, ‘fabs’, ‘floor’, ‘ceil’, ‘sqrt’, ‘log10’, ‘log’, ‘exp’, ‘asin’, ‘acos’, ‘atan’, ‘fmod’, ‘modf’, ‘frexp’, ‘ldexp’])
fix is running: MATHLIB=“m” pip3 install PyTurboJPEG==1.6.7
same for numpy: MATHLIB=“m” pip3 install numpy
BTW. The process of starting hass with more installs during its boot, takes quite some time.
few errors left like CRITICAL : Can’t open /proc/net/dev and Can’t open* /proc/net/route but these see no dealbreakers for running HA clients
Hi thanks for the tips. I have downgraded phyton, and have try to install homeassistant but now i have a completely different error during the installation
Hey guys, new here, sorry if my question was already answered, but i’m having problems trying to install HA on my old Galaxy Tab A 10.1 (2016).
Sorry for my dumb linux-related questions, but is my first time working with it.
When trying to install HA (using this tutorial), i get the following error on the orjson part (i believe it’s a rust compiler error, correct me if i’m wrong)
Log:
~ $ python -m venv hass
~ $ source hass/bin/activate
(hass) ~ $ pip install homeassistant
Collecting homeassistant
Using cached homeassistant-2022.12.0-py3-none-any.whl (20.6 MB)
Collecting aiohttp==3.8.3
Using cached aiohttp-3.8.3.tar.gz (7.3 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting astral==2.2
Using cached astral-2.2-py2.py3-none-any.whl (30 kB)
Collecting async-timeout==4.0.2
Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting attrs==21.2.0
Using cached attrs-21.2.0-py2.py3-none-any.whl (53 kB)
Collecting atomicwrites-homeassistant==1.4.1
Using cached atomicwrites_homeassistant-1.4.1-py2.py3-none-any.whl (7.1 kB)
Collecting awesomeversion==22.9.0
Using cached awesomeversion-22.9.0-py3-none-any.whl (12 kB)
Collecting bcrypt==3.1.7
Using cached bcrypt-3.1.7.tar.gz (42 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting certifi>=2021.5.30
Using cached certifi-2022.12.7-py3-none-any.whl (155 kB)
Collecting ciso8601==2.2.0
Using cached ciso8601-2.2.0.tar.gz (18 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting httpx==0.23.1
Using cached httpx-0.23.1-py3-none-any.whl (84 kB)
Collecting home-assistant-bluetooth==1.8.1
Using cached home_assistant_bluetooth-1.8.1.tar.gz (10 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting ifaddr==0.1.7
Using cached ifaddr-0.1.7-py2.py3-none-any.whl (10 kB)
Collecting jinja2==3.1.2
Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting lru-dict==1.1.8
Using cached lru-dict-1.1.8.tar.gz (10 kB)
Preparing metadata (setup.py) ... done
Collecting PyJWT==2.5.0
Using cached PyJWT-2.5.0-py3-none-any.whl (20 kB)
Collecting cryptography==38.0.3
Using cached cryptography-38.0.3.tar.gz (599 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting orjson==3.8.1
Using cached orjson-3.8.1.tar.gz (860 kB)
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [56 lines of output]
Collecting maturin<0.14,>=0.13
Using cached maturin-0.13.7.tar.gz (154 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: maturin
Building wheel for maturin (pyproject.toml): started
Building wheel for maturin (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Building wheel for maturin (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [34 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-cpython-311
creating build/lib.linux-aarch64-cpython-311/maturin
copying maturin/__init__.py -> build/lib.linux-aarch64-cpython-311/maturin
copying maturin/import_hook.py -> build/lib.linux-aarch64-cpython-311/maturin
copying maturin/__main__.py -> build/lib.linux-aarch64-cpython-311/maturin
running egg_info
creating maturin.egg-info
writing maturin.egg-info/PKG-INFO
writing dependency_links to maturin.egg-info/dependency_links.txt
writing requirements to maturin.egg-info/requires.txt
writing top-level names to maturin.egg-info/top_level.txt
writing manifest file 'maturin.egg-info/SOURCES.txt'
reading manifest file 'maturin.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'maturin.egg-info/SOURCES.txt'
running build_ext
running build_rust
error: rustup could not choose a version of rustc to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for maturin
Failed to build maturin
ERROR: Could not build wheels for maturin, which is required to install pyproject.toml-based projects
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
(hass) ~ $
I followed your steps and everything was going as per normal. However, upon installing maturin, i got a similar error (can’t find Rust compiler)
~ $ pkg upgrade
No mirror or mirror group selected. You might want to select one by running 'termux-change-repo'
Testing the available mirrors:
[*] (10) https://packages-cf.termux.dev/apt/termux-main: ok
[*] (1) https://mirrors.cbrx.io/apt/termux/termux-main: ok
[*] (1) https://linux.domainesia.com/applications/termux/termux-main: ok
[*] (1) https://mirror.bardia.tech/termux/termux-main: ok
[*] (1) https://mirror.nevacloud.com/applications/termux/termux-main: bad
[*] (1) https://mirror.albony.xyz/termux/termux-main: ok
[*] (1) https://packages.nscdn.top/termux-main: bad
[*] (1) https://mirrors.sdu.edu.cn/termux/termux-main: ok
[*] (1) https://mirrors.sau.edu.cn/termux/apt/termux-main: bad
[*] (1) https://mirrors.ustc.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.cqupt.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.nju.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.pku.edu.cn/termux/termux-main/: bad
[*] (1) https://mirrors.njupt.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.bfsu.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.dgut.edu.cn/termux/apt/termux-main: bad
[*] (1) https://mirrors.hit.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirror.iscas.ac.cn/termux/apt/termux-main: ok
[*] (1) https://mirror.nyist.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.scau.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.aliyun.com/termux/termux-packages-24: bad
[*] (1) https://mirrors.sustech.edu.cn/termux/apt/termux-main: ok
[*] (1) https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main: ok
[*] (1) https://termux.3san.dev/termux/termux-main: ok
[*] (1) https://mirrors.sahilister.in/termux/termux-main: ok
[*] (1) https://termux.cdn.lumito.net/termux-main: ok
[*] (1) https://termux.librehat.com/apt/termux-main: ok
[*] (1) https://mirror.accum.se/mirror/termux.dev/termux-main: ok
[*] (1) https://mirror.termux.dev/termux-main: ok
[*] (1) https://termux.astra.in.ua/apt/termux-main: ok
[*] (4) https://grimler.se/termux/termux-main: ok
[*] (1) https://termux.mentality.rip/termux-main: ok
[*] (1) https://mirror.mwt.me/termux/main: ok
[*] (1) https://mirrors.utermux.dev/termux/termux-main: ok
[*] (1) https://plug-mirror.rcac.purdue.edu/termux/termux-main: ok
[*] (1) https://dl.kcubeterm.com/termux-main: ok
[*] (1) https://mirror.fcix.net/termux/termux-main: ok
[*] (1) https://mirror.vern.cc/termux/termux-main: ok
[*] (1) https://mirror.csclub.uwaterloo.ca/termux/termux-main: ok
[*] (1) https://mirror.mwt.me/termux/main: ok
[*] (4) https://packages.termux.dev/apt/termux-main: ok
[*] (1) https://mirror.surf/termux/termux-main/: ok
[*] (1) http://mirror.mephi.ru/termux/termux-main: ok
Picking mirror: (17) /data/data/com.termux/files/usr/etc/termux/mirrors/china/mirrors.nju.edu.cn
Get:1 https://mirrors.nju.edu.cn/termux/apt/termux-main stable InRelease [14.0 kB]
Get:2 https://mirrors.nju.edu.cn/termux/apt/termux-main stable/main aarch64 Packages [435 kB]
Fetched 449 kB in 2min 22s (3154 B/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
~ $ pkg install python nano make rust libcrypt libffi libjpeg-turbo binutils
No mirror or mirror group selected. You might want to select one by running 'termux-change-repo'
Checking availability of current mirror:
[*] https://mirrors.nju.edu.cn/termux/apt/termux-main: ok
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python is already the newest version (3.11.1).
nano is already the newest version (7.0).
make is already the newest version (4.4).
rust is already the newest version (1.65.0).
libcrypt is already the newest version (0.2-5).
libffi is already the newest version (3.4.4).
libffi set to manually installed.
libjpeg-turbo is already the newest version (2.1.4).
binutils is already the newest version (2.39-4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
~ $ python -m venv hass
~ $ source hass/bin/activate
(hass) ~ $ pip install --upgrade pip
Requirement already satisfied: pip in ./hass/lib/python3.11/site-packages (22.3.1)
(hass) ~ $ pip install wheel
Requirement already satisfied: wheel in ./hass/lib/python3.11/site-packages (0.38.4)
(hass) ~ $ pip install tzdata
Collecting tzdata
Downloading tzdata-2022.7-py2.py3-none-any.whl (340 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 340.1/340.1 kB 4.5 MB/s eta 0:00:00
Installing collected packages: tzdata
Successfully installed tzdata-2022.7
(hass) ~ $ pip install maturin
Collecting maturin
Using cached maturin-0.14.5.tar.gz (170 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: maturin
Building wheel for maturin (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for maturin (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [34 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-cpython-311
creating build/lib.linux-aarch64-cpython-311/maturin
copying maturin/__init__.py -> build/lib.linux-aarch64-cpython-311/maturin
copying maturin/import_hook.py -> build/lib.linux-aarch64-cpython-311/maturin
copying maturin/__main__.py -> build/lib.linux-aarch64-cpython-311/maturin
running egg_info
creating maturin.egg-info
writing maturin.egg-info/PKG-INFO
writing dependency_links to maturin.egg-info/dependency_links.txt
writing requirements to maturin.egg-info/requires.txt
writing top-level names to maturin.egg-info/top_level.txt
writing manifest file 'maturin.egg-info/SOURCES.txt'
reading manifest file 'maturin.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'maturin.egg-info/SOURCES.txt'
running build_ext
running build_rust
error: rustup could not choose a version of rustc to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for maturin
Failed to build maturin
ERROR: Could not build wheels for maturin, which is required to install pyproject.toml-based projects
(hass) ~ $