{"id":31074171,"url":"https://github.com/harmoninux/hish","last_synced_at":"2026-01-18T14:09:28.929Z","repository":{"id":313481545,"uuid":"1051537567","full_name":"harmoninux/HiSH","owner":"harmoninux","description":"Run Linux Shell on HarmonyOS devices, including Phone, Pad, 2in1/PC (like iSH on iOS and iPadOS).","archived":false,"fork":false,"pushed_at":"2025-09-13T12:42:30.000Z","size":7992,"stargazers_count":30,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-13T13:58:50.107Z","etag":null,"topics":["emulator","harmonyos","linux","shell","terminal","virtual-machine"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harmoninux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-06T07:43:25.000Z","updated_at":"2025-09-13T12:42:33.000Z","dependencies_parsed_at":"2025-09-06T11:37:09.151Z","dependency_job_id":"cc154bc4-86ac-4e40-9d21-e37acc183720","html_url":"https://github.com/harmoninux/HiSH","commit_stats":null,"previous_names":["harmoninux/hish"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/harmoninux/HiSH","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmoninux%2FHiSH","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmoninux%2FHiSH/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmoninux%2FHiSH/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmoninux%2FHiSH/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harmoninux","download_url":"https://codeload.github.com/harmoninux/HiSH/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmoninux%2FHiSH/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275348511,"owners_count":25448626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emulator","harmonyos","linux","shell","terminal","virtual-machine"],"created_at":"2025-09-16T02:05:20.941Z","updated_at":"2026-01-18T14:09:28.910Z","avatar_url":"https://github.com/harmoninux.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HiSH\n\n[GitHub](https://github.com/harmoninux/HiSH) | [GitCode](https://gitcode.com/realhackeris/HiSH) | [Gitee](https://gitee.com/hackeris/HiSH) | [English](README_EN.md)\n\n在HarmonyOS设备上运行Linux Shell。基于[harmony-qemu](https://github.com/hackeris/harmony-qemu)，支持2in1(PC)、平板和手机。\n\n![多设备运行](docs/images/devices.png)\n\n## 如何获取\n\n可以选择下面任一方法获取HiSH：\n\n- 从[Releases](https://github.com/harmoninux/HiSH/releases)下载hap文件，自行签名后安装到设备或模拟器（支持JIT，运行效率更高）\n- 通过[应用市场](https://appgallery.huawei.com/app/detail?id=app.hackeris.hish)安装（不支持JIT，运行效率一般）\n- 使用DevEco Studio编译源码，参考 [构建HAP](#构建hap)（支持JIT，运行效率更高）\n\n## 核心功能\n\n- 完整的arm64 Linux内核\n- 网络支持，并支持端口转发\n- Alpine Linux根文件系统\n- 虚拟按键（Tab/Ctrl/Esc/方向键）\n- 共享文件夹\n- JIT（仅开发者可用）\n- 镜像导入（[Ubuntu24.04镜像](https://github.com/harmoninux/linux-config/releases/download/rootfs-20251213/ubuntu-base-24.04.zip) / [Debian12镜像](https://github.com/harmoninux/linux-config/releases/download/release-20251129-debian/debian12.zip)）\n\n## 使用指南\n\n参考 [使用指南](docs/guide)\n\n## 讨论交流\n\n微信群二维码\n\n\u003cimg src=\"docs/images/hish_wechat_group.png\" width=\"200\"/\u003e\n\n## 授权许可\n\n使用本项目代码，按照[惯例](https://www.n.cn/share/r1/d256b59a563047a3a052e58042ae2547)需在软件本体\"关于\"中注明基于本项目（HiSH）以及本项目的仓库地址。\n\n# 构建指南\n\n- HAP包\n- libqemu-system库（可选）\n- Linux内核（可选）\n- 根文件系统（可选）\n\n## 构建HAP\n\n* 克隆代码到本地\n* 复制`build-profile.template.json5`到`build-profile.json5`\n* 下载以下文件到指定位置：\n  - [entry/libs.zip](https://github.com/harmoninux/qemu/releases/download/hish-20260110/libs.zip)（解压到`entry/libs`）\n  - [entry/src/main/resources/rawfile/vm/kernel_aarch64](https://github.com/harmoninux/linux-config/releases/download/rootfs-20260117/kernel_aarch64)\n  - [entry/src/main/resources/rawfile/vm/rootfs_aarch64.qcow2](https://github.com/harmoninux/linux-config/releases/download/rootfs-20260117/rootfs_aarch64.qcow2)\n* 在DevEco Studio中构建项目\n* 签名后在设备或模拟器上运行\n\n## 构建libqemu-system（可选）\n\n在Ubuntu或Windows的WSL2环境下构建自定义的`libqemu-system-aarch64.so`：\n\n* 安装依赖：\n\n```shell \nsudo apt install -y build-essential cmake curl wget unzip python3 libncurses-dev \\\n    git flex bison bash make autoconf libcurl4-openssl-dev tcl \\\n    gettext zip pigz meson \n```\n\n* 从[华为开发者官网](https://developer.huawei.com/consumer/cn/download/)下载Linux版\"Command Line Tools\"\n* 解压后将`TOOL_HOME`环境变量设置为解压目录\n* 进入`deps`目录运行构建脚本`build.sh`（默认针对x86_64模拟器）：\n    * 针对真机的构建（arm64-v8a），需要将`build.sh`脚本中的`OHOS_ARCH`改为`aarch64`，`OHOS_ABI`改为`arm64-v8a`\n```shell \ncd deps \n./build.sh \n```\n* 构建产物位于`deps/output`目录\n\n## 构建Linux内核（可选）\n\n* 安装依赖：\n\n```shell \nsudo apt install build-essential gcc bc bison flex libssl-dev \\\n libncurses5-dev libelf-dev gcc-aarch64-linux-gnu \\\n clang lld llvm make \n```\n\n* 克隆Linux内核源码：\n\n```shell \ngit clone --depth=1 -b v6.12 https://github.com/torvalds/linux \n```\n\n* 下载内核配置：\n\n```shell \ncd linux \ncurl https://raw.githubusercontent.com/harmoninux/linux-config/refs/heads/master/arm64_virt \u003e .config \n```\n\n* 编译内核：\n\n```shell\nexport KCFLAGS='-march=armv8.5-a+crc+crypto+lse+rcpc+rng+sm4+sha3+dotprod+fp16 -mtune=neoverse-n1 -O2 -falign-functions=64 -fno-strict-aliasing -mllvm -vectorize-loops -mllvm -force-vector-width=2'\nenv KCFLAGS=\"$KCFLAGS\" make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LLVM=1 LLVM_IAS=1 menuconfig\nenv KCFLAGS=\"$KCFLAGS\" make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LLVM=1 LLVM_IAS=1 -j$(nproc)\n```\n\n* 内核镜像位于`arch/arm64/boot/Image`，复制到项目对应目录\n\n## 构建Linux根文件系统（可选）\n\n以下是构建自定义根文件系统的完整流程\n\n* 准备Alpine根文件系统\n\n```shell \n# 创建目录并解压Alpine最小根文件系统 \nmkdir alpine \nwget https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/aarch64/alpine-minirootfs-3.22.1-aarch64.tar.gz \ntar xvf alpine-minirootfs-3.22.1-aarch64.tar.gz -C alpine \n```\n\n* 创建磁盘镜像文件\n\n```shell \n# 创建8GB大小的原始镜像文件（可根据需要调整大小）\nqemu-img create -f raw rootfs.img 8G \n \n# 格式化为ext4文件系统 \nmkfs.ext4 rootfs.img \n```\n\n* 挂载并填充文件系统\n\n```shell \n# 创建挂载点并挂载镜像 \nsudo mkdir -p /mnt/rootfs \nsudo mount -o loop rootfs.img /mnt/rootfs \n \n# 复制Alpine文件系统内容 \nsudo cp -a alpine/* /mnt/rootfs/\n \n# 卸载镜像 \nsudo umount /mnt/rootfs \n```\n\n* 转换为qcow2格式\n\n```shell \n# 转换格式（qcow2支持动态分配空间）\nqemu-img convert -p -f raw -O qcow2 rootfs.img rootfs.qcow2 \n```\n\n* 部署到项目\n\n```shell \n# 将生成的文件放入项目目录 \nmkdir -p entry/src/main/resources/rawfile/vm/\nmv rootfs.qcow2 entry/src/main/resources/rawfile/vm/rootfs_aarch64.qcow2 \n```\n\n# Star history\n\n[![星标历史图表](https://api.star-history.com/svg?repos=harmoninux/hish\u0026type=Date)](https://www.star-history.com/#harmoninux/hish\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmoninux%2Fhish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharmoninux%2Fhish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmoninux%2Fhish/lists"}