{"id":19952079,"url":"https://github.com/econcz/chroot_x86_64","last_synced_at":"2026-03-06T22:02:09.240Z","repository":{"id":134701201,"uuid":"384929456","full_name":"econcz/chroot_x86_64","owner":"econcz","description":"QEMU-based x86_64 chroot for Raspberry Pi 4B or later with (in-built) Stata® and other x86_64 software support","archived":false,"fork":false,"pushed_at":"2025-12-18T01:15:00.000Z","size":44,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-21T11:42:08.496Z","etag":null,"topics":["chroot","libguestfs","qemu","raspberry-pi-4b","rsync","samba","udisks2"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/econcz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-07-11T11:19:16.000Z","updated_at":"2025-12-17T01:35:14.000Z","dependencies_parsed_at":"2024-02-15T23:23:10.180Z","dependency_job_id":"c494b95c-de87-45e4-8084-c41786120d57","html_url":"https://github.com/econcz/chroot_x86_64","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/econcz/chroot_x86_64","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/econcz%2Fchroot_x86_64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/econcz%2Fchroot_x86_64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/econcz%2Fchroot_x86_64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/econcz%2Fchroot_x86_64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/econcz","download_url":"https://codeload.github.com/econcz/chroot_x86_64/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/econcz%2Fchroot_x86_64/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30200756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["chroot","libguestfs","qemu","raspberry-pi-4b","rsync","samba","udisks2"],"created_at":"2024-11-13T01:11:28.108Z","updated_at":"2026-03-06T22:02:09.199Z","avatar_url":"https://github.com/econcz.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QEMU-based x86_64 chroot for Raspberry Pi 4B or later with (in-built) Stata® and other x86_64 software support\n\nThis script a) creates a [QEMU VM qcow2 file](https://qemu.readthedocs.io/en/latest/) from an automatically downloaded ISO image, b) rsyncs (copies) its filesystem into a chroot, c) upgrades it when necessary, d) configures the chroot to launch x86_64 software on machines with arm64 (aarch64) CPU architecture.\n\nTailored for [Raspberry Pi 4B (64-bit microcomputer) or later](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) and SW like [Stata®](https://www.stata.com/) (in-built support), [Conda (Anaconda, Miniconda) 3+](https://www.anaconda.com/), Adobe Acrobat DC (Legacy) etc.\n\n**NB** [CrossOver 20+](https://www.codeweavers.com/crossover/) doesn’t yet seem to be working under chroot, please use Wine instead!\n\n### Requirements:\n- Debian/Ubuntu-based system (preferably Raspberry Pi OS)\n- qemu (with x86_64 support) - has to be built (see below)!\n- qemu-user-static\n- samba\n- libguestfs-tools\n- udisks2\n- zsh (I switched to Zsh some years ago, sorry)\n\n```\n# qemu and qemu-system (the build takes ca. 1-2 hours)\n# courtesy of https://www.raspberrypi.org/forums/viewtopic.php?t=246886\n####\nsudo apt install build-essential ninja-build libepoxy-dev libdrm-dev libgbm-dev libx11-dev libvirglrenderer-dev libpulse-dev libsdl2-dev git libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev libepoxy-dev libdrm-dev libgbm-dev libx11-dev libvirglrenderer-dev libpulse-dev libsdl2-dev git\ngit clone https://git.qemu.org/git/qemu.git\ncd qemu\ngit submodule init\ngit submodule update --recursive\n./configure --enable-sdl  --enable-opengl --enable-virglrenderer --enable-system --enable-modules --audio-drv-list=pa --enable-kvm\nninja -C build\nsudo ninja install -C build\n\n# qemu-user-static, samba, libguestfs-tools, udisks2, and zsh\n####\nsudo apt install qemu-user-static samba libguestfs-tools udisks2 zsh\n```\n\n**NB** You can backup the build for repeated use with `tar czfv ~/qemu.tar.gz ~/qemu` before deleting it with `rm -rf ~/qemu`.\n\n### Configuration:\n`user____________=\"pi\"` Raspberry Pi (host) user (\"pi\")  \n`user_chroot_____=\"pi\"` Chroot user (\"pi\" is recommended)  \n`display_________=0` Raspberry Pi display (0)  \n`path_filesystem_=\"/tmp\"` SD Card, USB drive etc.  \n`path_software___=\"/tmp\"` SD Card, USB drive etc.  \n`path_backup_file=\"/home/pi/Documents/non_qcow2.tar.gz\"` Backup tar.gz archive for `chroot_x86_64 --backup`  \n`qemu_image_url__=\"https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.10.0-amd64-netinst.iso\"` ISO image URL  \n`qemu_image_size_=\"16G\"` QEMU VM, image size, at least 16GB (maximum size)  \n`qemu_smp________=2` QEMU VM, number of cores, 50% of host (recommended)  \n`qemu_m__________=\"4G\"` QEMU VM, RAM size, 50% of host (recommended)  \n`qemu_ssh_port___=22000` QEMU VM, SSH port  \n`path_local_sw___=\"/usr/local\"` Path to Stata® and other SW  \n`path_mountpoint_=\"/mnt\"` Mountpoint location in host  \n`path_chroot_____=\"/var/chroot_x86_64\"` Chroot location in host  \n`path_user_chroot=\"/home/pi\"` Chroot user home folder (~)  \n`vm_on_upgrade___=1` Run QEMU VM on `chroot_x86_64 --upgrade` (1 for yes, 0 for no)    \n`rsync_ignore____=\"/home/pi/ ${path_local_sw___}/stata17/\"` Chroot locations to ignore on `chroot_x86_64 --upgrade` and to backup with `chroot_x86_64 --backup` (no patterns allowed!)  \n\n**NB** If `chroot_x86_64 --upgrade` is interrupted, unsynced files (defined in `$rsync_ignore____`) can be found in `~/.rsync_ignore/`!\n\n### Usage:\n`chroot_x86_64 --install` to install the chroot environment  \n`chroot_x86_64 --setup` to setup the chroot environment  \n`chroot_x86_64 --upgrade` to upgrade the chroot environment  \n`chroot_x86_64 --backup` to backup unsynced folders/files  \n`chroot_x86_64 --restore` to restore the chroot environment  \n`chroot_x86_64 \u003ccmd\u003e` to run \u003ccmd\u003e under chroot\n\n### Running Stata (change paths and version if necessary):\nRequires `libncurses5` and `libgtk2.0-0` installed in QEMU VM and rsynced to chroot.  \nIf intended to be run over SSH, don’t forget to set DISPLAY `export DISPLAY=:0`.\n\nSlower but with Java and Python (Azul Zulu JDK build shipped with Stata doesn’t seem to be working under qemu-user-static, probably because of dynamic library loading):  \n`qemu-x86_64 /usr/local/stata17/stata` (Stata IC console)  \n`qemu-x86_64 /usr/local/stata17/xstata` (Stata IC GUI)  \n`qemu-x86_64 /usr/local/stata17/stata-se` (Stata SE console)  \n`qemu-x86_64 /usr/local/stata17/xstata-se` (Stata SE GUI)  \n```\n# For Jupyter kernel (to launch from chroot):\necho \"#!/bin/bash\" | sudo tee /var/chroot_x86_64/usr/local/bin/stata-se\necho \"chmod 0600 ~/.ssh/id_rsa; ssh -oAddressFamily=inet -oStrictHostKeyChecking=no -t -i ~/.ssh/id_rsa pi@localhost 'cd; qemu-x86_64 /usr/local/stata17/stata-se'\" | sudo tee -a /var/chroot_x86_64/usr/local/bin/stata-se\n```\n\nFaster but without Java and Python:  \n`/usr/local/stata17/stata` (Stata IC console)  \n`/usr/local/stata17/xstata` (Stata IC GUI)  \n`/usr/local/stata17/stata-se` (Stata SE console)  \n`/usr/local/stata17/xstata-se` (Stata SE GUI)\n\n**NB** Most Stata commands are C-based (especially compiled Mata .mo and .mlib files), only a small fraction are Java-based (for example, `sdmxuse`) or Python-based (for example, `pyconvertu`).  \n**NB** The `ado` directory and hidden `.stata17` folder will be created in host `~/`.\n\n### Running other software:\n`sudo chroot_x86_64 \u003ccmd\u003e` (Any command, for example, `acroread`).  \n**NB** The hidden folders will be created in chroot, for example, `/var/chroot_x86_64/home/pi/`.\n\nHappy usage!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feconcz%2Fchroot_x86_64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feconcz%2Fchroot_x86_64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feconcz%2Fchroot_x86_64/lists"}