{"id":20159821,"url":"https://github.com/diogok/termux-qemu-alpine-docker","last_synced_at":"2025-08-21T10:31:38.770Z","repository":{"id":47781717,"uuid":"196894768","full_name":"diogok/termux-qemu-alpine-docker","owner":"diogok","description":"Run Docker on Alpine, on Qemu, on Termux, on Android.","archived":false,"fork":false,"pushed_at":"2023-02-15T12:46:30.000Z","size":3,"stargazers_count":167,"open_issues_count":8,"forks_count":26,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-15T20:58:48.671Z","etag":null,"topics":["alpine","android","docker","qemu","termux"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/diogok.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}},"created_at":"2019-07-14T23:53:13.000Z","updated_at":"2024-12-13T23:57:57.000Z","dependencies_parsed_at":"2024-11-14T03:03:08.586Z","dependency_job_id":null,"html_url":"https://github.com/diogok/termux-qemu-alpine-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogok%2Ftermux-qemu-alpine-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogok%2Ftermux-qemu-alpine-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogok%2Ftermux-qemu-alpine-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogok%2Ftermux-qemu-alpine-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diogok","download_url":"https://codeload.github.com/diogok/termux-qemu-alpine-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230507051,"owners_count":18236944,"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","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":["alpine","android","docker","qemu","termux"],"created_at":"2024-11-14T00:10:34.992Z","updated_at":"2024-12-19T22:08:31.511Z","avatar_url":"https://github.com/diogok.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Termux + Qemu + Alpine + Docker + VNC\n\nThis is a setup for runing docker on android, by the means of Termux, running alpine in qemu and them enabling docker on the Alpine.\n\nThis was only tested on Samsung S10e.\n\n## [Install Termux](https://termux.com)\n\nAnd start it.\n\n## Setup VNC + Fluxbox\n\nFirst step was to setup VNC and Fluxbox, which is quite easy following [termux VNC guide](https://wiki.termux.com/wiki/Graphic_Environment):\n\nEnable x11 repository, install tiger-vnc and fluxbox:\n\n```\npkg install x11-repo\npkg install tigervnc fluxbox\n```\n\nThem start vncserver, it will ask you to setup password and other options, just follow on screen instructions:\n\n```\nvncserver\n```\n\nXvnc will them be running in background. We can now start fluxbox:\n\n```\nDISPLAY=\":1\" fluxbox\n```\n\nThis will start fluxbox on the Xvnc server and lock the current terminal. You can also append an \"\u0026\" on that command to start it in background.\n\nYou can stop fluxbox on the remote desktop.\n\nYou can stop vnc:\n\n```\nvncserver -kill :1\n```\n\nTo access your VNC server, choose your RDP client (like Vinagre on Ubuntu, or VNC Viewer on Android) and connect to your phone IP on port 5901 (for display :1).\n\nTo discover your phone IP on the wifi:\n\n```\nip addr show wlan0\n```\n\nInside Fluxbox you can right-click on the desktop to get a menu and launch stuff like \"aterm\".\n\n## Setup QEMU\n\nQemu setup is quite easy, just small gotcha is that I had to use qemu from x11-repo instead of unstable headless, and do not really know why.\n\nInstalling Qemu:\n\n```\npkg install unstable-repo\npkg install qemu-system-x64_64 qemu-utils\n```\n\nThat is it.\n\n## Preparing to install Alpine on Qemu\n\nYou will need the Alpine *virtual* ISO, that you can download from [alpine website](https://alpinelinux.org). Save it as alpine.iso to easy the typing:\n\n```\npkg install curl\ncurl http://dl-cdn.alpinelinux.org/alpine/v3.10/releases/x86_64/alpine-virt-3.10.1-x86_64.iso -o alpine.iso\n```\n\nThem you will need an image disk for the alpine installation to reside in:\n\n```\nqemu-img create -f qcow2 alpine.img 5g\n```\n\n## Starting Alpine installation on QEMU\n\nThem you can launch Qemu installation of Alpine. I fyou are on an XVNC session, it will launch a QEMU window.\n\n```\nqemu-system-x86_64 -hda alpine.img -cdrom alpine.iso -boot d -m 512\n```\n\nIf you want to keep on the same terminal (not launching a new window) you can append \"-nographic\" to that last command.\n\nIf you are on a QEMU window you can click it to grab focus, and can CTRL+ALT+G to release focus. You can also CTRL+ALT+F to go fullscreen.\n\nOn a terminal, you can stop emulation with CTRL+A+X. There are several others Ctrl+A commands.\n\nIt will take a while for alpine to boot, but will them present you with a \"Login:\" terminal, just enter \"root\" to start. \n\n## Setting up networking on Alpine on Qemu\n\nThis is a part that I had trouble, before starting setup inside alpine, you should setup proper network.\n\nFirst, setup the interfaces, by editing */etc/network/interfaces* to have the following content:\n\n```\nauto lo\niface lo inet loopback\nauto eth0\niface eth0 inet dhcp\n```\n\nSave it, and restart the alpine network:\n\n```\n/etc/init.d/networking restart\n```\n\nYou should get an IP from the Qemu user network. Please be aware that _ping_ does not work on this setup.\n\nThem, and only them, you also need to add DNS servers, by editing */etc/resolv.conf* to the following:\n\n```\nnameserver 8.8.8.8\n```\n\nYou can test by trying to setup just the repositories:\n\n```\nsetup-apkrepos\n```\n\nIf this gives you a list of repos to choose from (About 40+), them it worked.\n\n## Installing Alpine\n\nTo start installation:\n\n```\nsetup-alpine\n```\n\nJust follow on screen instructions with attention. Be sure to choose to install on disk \"sda\" when prompted.\n\nOnce the installation is complete, shutdown Alpine by issuing halt\"\n\n```\nhalt\n```\n\nWhen it says system halted, exit Qemu (either by CTRL+Alt+g and closing window, or by ctrl+a+x on the terminal).\n\n\n## Running installed Alpine on Qemu\n\nTo start alpine, simply run:\n\n```\nqemu-system-x86_64 -hda alpine.img -boot c -m 512\n```\n\nIt will be take a while and give you a login prompt for the root user you setup.\n\n## Installing Docker on Alpine\n\nThe reason I installed it all is to [run docker on alpine](https://wiki.alpinelinux.org/wiki/Docker).\n\nOn alpine, edit /etc/pkg/repositories and uncomment comunity repository, them install docker:\n\n```\napk update\napk add docker\n```\n\nStart the service and enable it on boot:\n\n```\nservice start docker\nupdate-rc enable docker\n```\n\nTest it out\n\n```\ndocker info\ndocker run alpine echo hello\n```\n\n## How slow is it?\n\nOn my machine a simple hello world take 1s to echo, while on this setup it takes 25s. Well, at least it works...\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiogok%2Ftermux-qemu-alpine-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiogok%2Ftermux-qemu-alpine-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiogok%2Ftermux-qemu-alpine-docker/lists"}