Run Linux ELF binary (aarch64 and x86_64) on HarmonyOS PC, inspired by Termony, based on harmony-qemu.
To build and install to your device, see Build Termony on Linux
- Build and sign hap of Harmonix
- or download unsigned hap from Release page and sign the hap by your self
- Install Harmonix to your HarmonyOS PC
- Open Harmonix or HiShell, and run
harmonix install
to install Alpine Linux - After Alpine Linux installed, run
harmonix run
to start Alpine Linux - Run
cd /
cd to/
and runls
, you can see the root changed! - Run
uname -a
to display system info - Run
apk
to install packages
You can also run Linux program of x86_64 on HarmonyOS PC by qemu-harmonix-x86_64 in Harmonix.
- Download alpine minimal root filesystem from https://alpinelinux.org/downloads/, choose "Mini root filesystem" -> "x86_64"
- Extract downloaded rootfs tar.gz file to data directory, for example
/data/storage/el2/base/files/alpine_x64
- Run
qemu-harmonix-x86_64
to load busybox shell with rootfs and environment variables
cd /data/storage/el2/base/files/alpine_x64
qemu-harmonix-x86_64 -E PATH=/bin:/usr/bin:/sbin -E HOME=/root -L ./ ./bin/busybox sh -c 'cd ~ && sh'
- Run
uname -a
to display system info.
- In Alpine Linux, you can use
apk
to install packages. - Install
gcc
andmusl-dev
byapk add gcc musl-dev
, then you can compile C code and run. - Install
python
byapk add python3
, then you can run python script. - Install
openjdk17-jdk
byapk add openjdk17-jdk
, then you can compile Java code byjavac
. - More external programs from packages works.