{"id":13442941,"url":"https://github.com/sickcodes/dock-droid","last_synced_at":"2025-04-12T21:29:40.853Z","repository":{"id":41168593,"uuid":"382717148","full_name":"sickcodes/dock-droid","owner":"sickcodes","description":"Docker Android - Run QEMU Android in a Docker! X11 Forwarding! CI/CD for Android!","archived":false,"fork":false,"pushed_at":"2022-04-22T19:39:18.000Z","size":35923,"stargazers_count":1157,"open_issues_count":22,"forks_count":90,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-11T13:43:48.035Z","etag":null,"topics":["android","docker","droid","kvm","linux","qemu","x86","x86-64"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/sickcodes/dock-droid","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sickcodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"sickcodes"}},"created_at":"2021-07-03T22:06:35.000Z","updated_at":"2025-04-08T23:22:20.000Z","dependencies_parsed_at":"2022-07-14T09:22:19.149Z","dependency_job_id":null,"html_url":"https://github.com/sickcodes/dock-droid","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/sickcodes%2Fdock-droid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sickcodes%2Fdock-droid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sickcodes%2Fdock-droid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sickcodes%2Fdock-droid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sickcodes","download_url":"https://codeload.github.com/sickcodes/dock-droid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248634559,"owners_count":21137067,"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":["android","docker","droid","kvm","linux","qemu","x86","x86-64"],"created_at":"2024-07-31T03:01:53.601Z","updated_at":"2025-04-12T21:29:40.824Z","avatar_url":"https://github.com/sickcodes.png","language":"Dockerfile","readme":"# Dock-Droid · [Follow @sickcodes on Twitter](https://twitter.com/sickcodes)\n\n![Running Android x86 \u0026 Android ARM in a Docker container](/dock-droid-docker-android.png?raw=true \"ANDROID KVM IN DOCKER CONTAINER\")\n\nDocker Android - Run QEMU Android x86 and Android ARM in a Docker! X11 Forwarding! CI/CD for Android!\n\n## Capabilities\n- Security Research of ARM apps on x86!\n- ADB on port `:5555`\n- Magisk, riru, LSPosed on Android x86\n- SSH enabled (`localhost:50922`)\n- SCRCPY enabled (`localhost:5555`)\n- WebCam forwarding enabled (`/dev/video0`)\n- Audio forwarding enabled (`/dev/snd`)\n- GPU passthrough (`/dev/dri`)\n- X11 forwarding is enabled\n- runs on top of QEMU + KVM\n- supports BlissOS, custom images, VDI files, any Android x86 image, Xvfb headless mode\n- you can clone your container with `docker commit`\n\n## Author\n\nThis project is maintained by @sickcodes [Sick.Codes](https://sick.codes/). [(Twitter)](https://twitter.com/sickcodes)\n\nAdditional credits can be found here: https://github.com/sickcodes/dock-droid/blob/master/CREDITS.md\n\nEpic thanks to [@BlissRoms](https://github.com/BlissRoms) who maintain absolutely incredible Android x86 images. If you love their images, consider donating to the project: [https://blissos.org/](https://blissos.org/)!\n\nSpecial thanks to [@zhouziyang](https://github.com/zhouziyang) who maintains an even more native fork [Redroid](https://github.com/remote-android/redroid-doc)!\n\nThis project is heavily based on Docker-OSX: https://github.com/sickcodes/Docker-OSX\n\n\u003ca href=\"https://hub.docker.com/r/sickcodes/dock-droid\"\u003e\u003cimg src=\"https://dockeri.co/image/sickcodes/dock-droid\"/\u003e\u003c/a\u003e\n\n### Related:\n- Next Generation Anbox Style LXC:\n\n[https://github.com/sickcodes/droid-native](https://github.com/sickcodes/droid-native)\n\n- Android in a Docker using [BlissOS](https://blissos.org/):\n\n[https://github.com/sickcodes/dock-droid](https://github.com/sickcodes/dock-droid)\n\n- binder(fs) and ashmem for use in anbox related 5.7+ Kernel distribuitons (soon to be all):\n\n[https://github.com/sickcodes/anbox-modules-dkms](https://github.com/sickcodes/anbox-modules-dkms)\n\n### Requirements\n\n- 4GB disk space for bare minimum installation\n- virtualization should be enabled in your BIOS settings\n- a kvm-capable host (not required, but slow otherwise)\n\n## Initial setup\nBefore you do anything else, you will need to turn on hardware virtualization in your BIOS. Precisely how will depend on your particular machine (and BIOS), but it should be straightforward.\n\nThen, you'll need QEMU and some other dependencies on your host:\n\n```bash\n# ARCH\nsudo pacman -S qemu libvirt dnsmasq virt-manager bridge-utils flex bison iptables-nft edk2-ovmf\n\n# UBUNTU DEBIAN\nsudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager\n\n# CENTOS RHEL FEDORA\nsudo yum install libvirt qemu-kvm\n```\n\nThen, enable libvirt and load the KVM kernel module:\n\n```bash\nsudo systemctl enable --now libvirtd\nsudo systemctl enable --now virtlogd\n\necho 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs\n\nsudo modprobe kvm\n```\n\n## Quick Start Dock-Droid\n\nYou can run the Live OS image, or install to disk.\n\nConnect to the WiFi network called `VirtWifi`.\n\n### BlissOS x86 Image [![https://img.shields.io/docker/image-size/sickcodes/dock-droid/latest?label=sickcodes%2Fdock-droid%3Alatest](https://img.shields.io/docker/image-size/sickcodes/dock-droid/latest?label=sickcodes%2Fdock-droid%3Alatest)](https://hub.docker.com/r/sickcodes/dock-droid/tags?page=1\u0026ordering=last_updated)\n\n```bash\ndocker run -it \\\n    --device /dev/kvm \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -p 5555:5555 \\\n    sickcodes/dock-droid:latest\n```\n\nHeadlessly (on a server, or locally)\n\n```bash\ndocker run -it \\\n    --device /dev/kvm \\\n    -e EXTRA=\"-display none -vnc 0.0.0.0:99,password=on\" \\\n    -p 5555:5555 \\\n    -p 5999:5999 \\\n    sickcodes/dock-droid:latest\n```\nFor headless, in the QEMU console, type `change vnc password user`\n\nAnd then connect on `localhost:5999`, or the server IP, or Docker IP.\n\n### No Image (:naked) [![https://img.shields.io/docker/image-size/sickcodes/dock-droid/naked?label=sickcodes%2Fdock-droid%3Anaked](https://img.shields.io/docker/image-size/sickcodes/dock-droid/naked?label=sickcodes%2Fdock-droid%3Anaked)](https://hub.docker.com/r/sickcodes/dock-droid/tags?page=1\u0026ordering=last_updated)\n\n```bash\ndocker run -it \\\n    --device /dev/kvm \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -v \"${PWD}/android.qcow2:/home/arch/dock-droid/android.qcow2\" \\\n    -p 5555:5555 \\\n    sickcodes/dock-droid:naked\n\n```\n\n### Run without KVM (Work in Progress)\n\nThis will boot, but currently does not \"work\". \n\nChange `CPU` to `Penryn`, which is normally `host`\n\nChange `ENABLE_KVM`, which is normally `-enable-kvm`\n    \nChange `KVM`, which is normally `accel=kvm:tcg`\n\nChange `CPUID_FLAGS`, which is normally very long.\n\n```\n# use a spacebar in quotes\n-e CPU=qemu64 \\\n-e ENABLE_KVM=' ' \\\n-e KVM=' ' \\\n-e CPUID_FLAGS=' ' \\\n```\n\nFor example **(Work in Progress)**:\n\n```bash\ndocker run -it \\\n    -e CPU=Penryn \\\n    -e ENABLE_KVM=' ' \\\n    -e KVM=' ' \\\n    -e CPUID_FLAGS=' ' \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -p 5555:5555 \\\n    sickcodes/dock-droid:latest\n```\n\n### Increase RAM\n\nIncrease RAM by adding this line: `-e RAM=10 \\` for 10GB.\n\n## Docker Virtual Machine WebCam\n\n![Android WebCam Passthrough SPICE USBREDIR QEMU Android x86](/Android-WebCam-Passthrough-QEMU-Android-x86.png?raw=true \"Android WebCam Passthrough SPICE USBREDIR QEMU Android x86\")\n\nWant to use your Laptop/USB WebCam and Audio too?\n\nThere are two options: **usb passthrough**, or **usb redirect (network)**.\n\n`v4l2-ctl --list-devices`\n\n`lsusb`\n\nFind the `hostbus` and `hostaddr`:\n\n```console\nBus 003 Device 003: ID 13d3:56a2 IMC Networks USB2.0 HD UVC WebCam\n```\nWould be `-device usb-host,hostbus=3,hostaddr=3`\n\n### Passthrough Android Camera over USB\n\n```bash\ndocker run -it \\\n    --device /dev/kvm \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -p 5555:5555 \\\n    -e EXTRA='-device usb-host,hostbus=3,hostaddr=3' \\\n    sickcodes/dock-droid:latest\n```\n\n### Passthrough Android WebCam Camera over the Network!\n\n```console\nlsusb\n# Bus 003 Device 003: ID 13d3:56a2 IMC Networks USB2.0 HD UVC WebCam\n```\n\nVendor ID is `13d3`\nProduct ID is `56a2`\n\nIn one Terminal on host:\n```bash\nsudo usbredirserver -p 7700 13d3:56a2\n```\n\nIn another Terminal on host:\n\n```bash\n# 172.17.0.1 is the IP of the Docker Bridge, usually the host, but you can change this to anything.\nPORT=7700\nIP_ADDRESS=172.17.0.1\n\ndocker run -it \\\n    --device /dev/kvm \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -p 5555:5555 \\\n    -e EXTRA=\"-chardev socket,id=usbredirchardev1,port=${PORT},host=${IP_ADDRESS} -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=ehci.0,debug=4\" \\\n    sickcodes/dock-droid:latest\n```\n\n### Android x86 Docker GPU \u0026 Hardware Acceleration\n\nCurrently in development by BlissOS team: mesa graphics card + OpenGL3.2.\n\nWant to use SwiftShader acceleration?\n\n```bash\ndocker run -it \\\n    --privileged \\\n    --device /dev/kvm \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -p 5555:5555 \\\n    -p 50922:10022 \\\n    --device=/dev/dri \\\n    --group-add video \\\n    -e EXTRA='-display sdl,gl=on' \\\n    sickcodes/dock-droid:latest\n```\n\n### Use your own image/naked version\n\n```bash\n\n# get container name from \ndocker ps -a\n\n# copy out the image\ndocker cp container_name:/home/arch/dock-droid/android.qcow2 .\n```\n\nUse any generic ISO or use your own Android AOSP raw image or qcow2\n\nWhere, `\"${PWD}/disk.qcow2\"` is your image in the host system.\n```bash\ndocker run -it \\\n    -v \"${PWD}/android.qcow2:/home/arch/dock-droid/android.qcow2\" \\\n    --privileged \\\n    --device /dev/kvm \\\n    --device /dev/video0 \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -p 5555:5555 \\\n    -p 50922:10022 \\\n    -e EXTRA='-device usb-host,hostbus=3,hostaddr=3' \\\n    sickcodes/dock-droid:latest\n```\n\n### UEFI BOOT\n\nAdd the following: `-bios /usr/share/OVMF/x64/OVMF.fd \\` to Launch.sh\n\nOr as a `docker run` argument:\n\nUEFI Boot\n```bash\ndocker run -it \\\n    --device /dev/kvm \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -p 5555:5555 \\\n    -e EXTRA='-bios /usr/share/OVMF/x64/OVMF.fd' \\\n    sickcodes/dock-droid:latest\n```\n\n### Custom Build\n\nTo use an alternative `CDROM`, you have two choices: runtime or buildtime.\n\nYou can add your image to the Dockerfile during the build:\n\n```bash\n\nCDROM_IMAGE_URL='https://sourceforge.net/projects/blissos-x86/files/Official/bleeding_edge/Generic%20builds%20-%20Pie/11.13/Bliss-v11.13--OFFICIAL-20201113-1525_x86_64_k-k4.19.122-ax86-ga-rmi_m-20.1.0-llvm90_dgc-t3_gms_intelhd.iso'\n\ndocker build \\\n    -t dock-droid-custom \\\n    -e CDROM_IMAGE_URL=\"${CDROM_IMAGE_URL}\" .\n\n```\n\n**OR** you can add it during runtime to the docker hub images as follows.\n\n```console\n    -v \"${CDROM}:/cdrom\" \\\n    -e CDROM=/cdrom \\\n\n```\nFor example:\n\n```bash\n# full path to your image on the host\nCDROM=\"${HOME}/Downloads/image.iso\"\n\ndocker run -it \\\n    --device /dev/kvm \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -p 5555:5555 \\\n    -v \"${CDROM}:/cdrom\" \\\n    -e CDROM=/cdrom \\\n    sickcodes/dock-droid:latest\n```\n\n\n### Force Boot CDROM QEMU\n\n`-boot d ` will force QEMU to boot from the CDROM.\n\n`-e EXTRA='-boot d ' \\`\n\n### Naked Container\n\nReduces the image size by 600Mb if you are using a local directory disk image:\n```\ndocker cp  image_name /home/arch/dock-droid/android.qcow2 .\n```\n\n# Modifying the Android filesystem.\n\nThe following groups of commands is for editing `android.qcow2`.\n\nFirst, we will mount the main `qcow2` file using `libguestfstools`\n\nThen, inside that qcow2 image, there are:\n`system.img`\n`ramdisk.img`\n\nGRUB is also in there.\n\nMount the qcow2 using:\n\n```bash\n# on the host\n# enable qemu-nbd for network device mounting\n# wget -O android.qcow2 https://image.sick.codes/android.BlissOS_Stable.qcow2\n\nsudo modprobe nbd\nsudo qemu-nbd --connect=/dev/nbd0 android.qcow2 -f qcow2\nsudo fdisk /dev/nbd0 -l\nmkdir -p /tmp/image\nsudo mount /dev/nbd0p1 /tmp/image\n```\n\nNow you can mount the internal disks in other places...\n```bash\n# make a folder to mount the whole resizable image \n# make another to mount the raw Android image within that resizable image.\nmkdir -p /tmp/system\nsudo mount /tmp/image/bliss-x86-11.13/system.img /tmp/system\n\nls /tmp/system\nls /tmp/image/bliss-x86-11.13\n# don't forget to unmount\n```\n\n### Swap from Houdini to `ndk_translation` Android x86\n\nExtract the native-bridge using the following: https://github.com/sickcodes/Droid-NDK-Extractor\n\nThanks to [Frank from Redroid](https://github.com/zhouziyang) for the idea!\n\n[https://github.com/remote-android/redroid-doc/tree/master/native_bridge](https://github.com/remote-android/redroid-doc/tree/master/native_bridge)\n\n```bash\n# warning, this will extract overwriting /etc/system/... so make sure you're in /tmp\ncd /tmp \\\n    \u0026\u0026 sudo wget https://github.com/sickcodes/dock-droid/raw/master/native-bridge.tar.gz \\\n    \u0026\u0026 sudo tar -xzvf native-bridge.tar.gz \\\n    \u0026\u0026 sudo rm native-bridge.tar.gz\n\nsudo touch /tmp/system/vendor/etc/init/nativebridge.rc\nsudo tee /tmp/system/vendor/etc/init/nativebridge.rc \u003c\u003cEOF\non early-init\n    setprop ro.product.cpu.abilist x86_64,arm64-v8a,x86,armeabi-v7a,armeabi\n    setprop ro.product.cpu.abilist64 x86_64,arm64-v8a\n    setprop ro.product.cpu.abilist32 x86,armeabi-v7a,armeabi\n    setprop ro.dalvik.vm.isa.arm x86\n    setprop ro.dalvik.vm.isa.arm64 x86_64\n    setprop ro.enable.native.bridge.exec 1\n    setprop ro.dalvik.vm.native.bridge libndk_translation.so\n    setprop ro.ndk_translation.version 0.2.2\nEOF\n\n\n# # Enable native bridge for target executables\n# on early-init\n#     mount binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc\n\n# on property:ro.enable.native.bridge.exec=1\n#     copy /system/etc/binfmt_misc/arm_exe /proc/sys/fs/binfmt_misc/register\n#     copy /system/etc/binfmt_misc/arm_dyn /proc/sys/fs/binfmt_misc/register\n\n# on property:ro.enable.native.bridge.exec64=1\n#     copy /system/etc/binfmt_misc/arm64_exe /proc/sys/fs/binfmt_misc/register\n#     copy /system/etc/binfmt_misc/arm64_dyn /proc/sys/fs/binfmt_misc/register\n\n\n# add armeabi\nsudo sed -i -e 's/abilist32\\=x86\\,armeabi\\-v7a/abilist32\\=x86\\,armeabi\\-v7a\\,armeabi/g' /tmp/system/vendor/build.prop\nsudo sed -i -e 's/abilist\\=x86_64\\,x86\\,arm64\\-v8a\\,armeabi\\-v7a/abilist\\=x86_64\\,x86\\,arm64\\-v8a\\,armeabi\\-v7a\\,armeabi/g' /tmp/system/vendor/build.prop\n\nsudo rm /tmp/system/bin/enable_nativebridge \\\n    /tmp/system/etc/binfmt_misc/arm_exe \\\n    /tmp/system/etc/binfmt_misc/arm64_dyn \\\n    /tmp/system/etc/binfmt_misc/arm_dyn \\\n    /tmp/system/etc/binfmt_misc/arm64_exe\n\nsudo rm /tmp/system/vendor/etc/binfmt_misc/*\n\nsudo rm /tmp/system/etc/init/houdini.rc\n\nsudo tee -a /tmp/system/product/build.prop \\\n    -a /tmp/system/vendor/build.prop \\\n    -a /tmp/system/build.prop \u003c\u003cEOF\nro.product.cpu.abilist64=x86_64,arm64-v8a\nro.product.cpu.abilist32=x86,armeabi-v7a,armeabi\nro.dalvik.vm.isa.arm=x86\nro.dalvik.vm.isa.arm64=x86_64\nro.enable.native.bridge.exec=1\nro.dalvik.vm.native.bridge=libndk_translation.so\nro.secure=0\nro.debuggable=1\nro.adb.secure=0\nservice.adb.root=1\nEOF\n\n# also swap libhoudini to libndk_translation in the ramdisk\nmkdir -p /tmp/ramdisk\nsudo /bin/bash -c \"cd /tmp/ramdisk \\\n    \u0026\u0026 zcat /tmp/image/bliss-x86-11.13/ramdisk.img \\\n    | cpio -iud\"\n\nsed -i -e 's/libhoudini/libndk_translation/g' /tmp/ramdisk/default.prop\ntouch /tmp/image/bliss-x86-11.13/ramdisk.img\nfind . | cpio -o -H newc | gzip \u003e /tmp/ramdisk.img.new\nmv /tmp/ramdisk.img.new /tmp/image/bliss-x86-11.13/ramdisk.img\n\n# sudo tee -a /tmp/system/build.prop \u003c\u003c'EOF'\n# ro.dalvik.vm.native.bridge=libndk_translation.so\n# ro.product.cpu.abilist=x86_64,arm64-v8a,x86,armeabi-v7a,armeabi\n# ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi\n# ro.ndk_translation.version=0.2.2\n# EOF\n\n# don't forget to unmount\n```\n\n# Install Magisk using [https://github.com/axonasif/rusty-magisk](rusty-magisk) by [@axonasif](https://github.com/axonasif)\n\nInside the `ramdisk.img`, we would like to overwrite `init` with `rusty-magisk`\n\n```bash\nmkdir -p /tmp/ramdisk\n\nsudo /bin/bash -c \"\ncd /tmp/ramdisk\nzcat /tmp/image/bliss-x86-11.13/ramdisk.img | cpio -iud \u0026\u0026 mv /tmp/ramdisk/init /tmp/ramdisk/init.real\n\nwget -O /tmp/ramdisk/init https://github.com/axonasif/rusty-magisk/releases/download/v0.1.7/rusty-magisk_x86_64 \n\nchmod a+x /tmp/ramdisk/init\ntouch /tmp/image/bliss-x86-11.13/ramdisk.img\n/bin/bash -c 'find . | cpio -o -H newc | sudo gzip \u003e /tmp/image/bliss-x86-11.13/ramdisk.img'\n\"\nsudo rm -rf /tmp/ramdisk\n# don't forget to unmount\n```\n\nDuring the next boot you will have Magisk installed.\n\n\n### Add secure ADB keys.\n\n```bash\n# generate keys if you don't have already\nKEYNAME=adbkey\nadb keygen ~/.android/\"${KEYNAME}\"\ntouch ~/.android/\"${KEYNAME}.pub\"\nadb pubkey ~/.android/\"${KEYNAME}\" \u003e ~/.android/\"${KEYNAME}.pub\"\n\n# put some keys in the box and copy to your host ~/.android folder\nmkdir -p /tmp/image/bliss-x86-11.13/data/.android\nmkdir -p /tmp/image/bliss-x86-11.13/data/misc/adb\ntee /tmp/image/bliss-x86-11.13/data/misc/adb/adb_keys \u003c ~/.android/\"${KEYNAME}.pub\"\n# don't forget to unmount\n```\n\n# Unmount when finished\n\nAfter completing any of the above automation, you need to unmount the disk.\n\n```bash\n# sudo mount /tmp/image/bliss-x86-11.13/ramdisk.img /tmp/ramdisk\n# unmount both disks when you're done\nsudo umount /tmp/ramdisk\nsudo umount /tmp/system\nsudo umount /tmp/image\nsudo qemu-nbd -d /dev/nbd0\n```\n\n# Use Frida (latest)\n```bash\n# choose a version from https://github.com/frida/frida/releases/\n# use arm if you're debugging arm apps, via houdini or native bridge (ndk)\nHOST_ARCH=x86_64\n# HOST_ARCH=arm\nGUEST_SYS=android\nFRIDA_RELEASE=frida-server\n\nFRIDA_RELEASES=($(curl https://github.com/frida/frida/releases | grep -Po \"(?\u003c=\\\u003ca\\ href\\=\\\")(\\/frida\\/frida\\/releases\\/download\\/\\d+\\.\\d.\\d+\\/${FRIDA_RELEASE}-\\d+\\.\\d+.\\d+-${GUEST_SYS}-${HOST_ARCH}.xz)(?=\\\"\\ )\"))\n\nRELEASE_LINK=\"https://github.com${FRIDA_RELEASES[0]}\"\n# RELEASE_LINK='https://github.com/frida/frida/releases/download/15.0.8/frida-server-15.0.8-android-x86_64.xz'\n\n\nmkdir -p ./frida\ncd ./frida\n\nwget \"${RELEASE_LINK}\"\nunxz -d \"$(basename \"${RELEASE_LINK}\")\"\nfind -name \"${FRIDA_RELEASE}-*.*.*-${GUEST_SYS}-${HOST_ARCH}\" | xargs -i mv \"{}\" frida-server\n\nadb -s localhost:5555 push frida-server /data/local/tmp/frida-server\nadb -s localhost:5555 shell \"su -c chmod 755 /data/local/tmp/frida-server\"\nadb -s localhost:5555 shell \"/data/local/tmp/frida-server\"\n\n```\n\n# Misc Optimizations\n\nGreat list by [@eladkarako](https://github.com/eladkarako)\n\n[https://gist.github.com/eladkarako/5694eada31277fdc75cee4043461372e](https://gist.github.com/eladkarako/5694eada31277fdc75cee4043461372e)\n\n## Run adb/start adbd\n\nBoot the container.\n\nOpen `Terminal Emulator` in the Android:\n\n```bash\n# on android\nsu\nstart adbd\n\n# setprop persist.adb.tcp.port 5555\n```\n\nConnect to the virtual WiFi inside Android!\n\nNow, from the host, use the new key to `adb` into the guest:\n\n```bash\n# on the host\nexport ADB_VENDOR_KEYS=~/.android/adbkey\nadb kill-server\nadb connect localhost\nadb -s localhost:5555 root\nadb -s localhost:5555 shell\n```\n\nIn the Android terminal emulator, run `adbd`\n\nThen from the host, you can can connect using either:\n`adb connect localhost:5555`\n\n`adb connect 172.17.0.2:5555`\n\nIf you have more than \"one emulator\" you may have to use:\n\n`adb -s localhost:5555 shell`\n\n`adb -s 172.17.0.2:5555 shell`\n\nE.g.\n\n```bash\nsu\nsed -i -e 's/ro\\.adb\\.secure\\=1/ro\\.adb\\.secure\\=0/' /default.prop\n\n```\n\nIn the Android terminal emulator, run `adbd`\n\nThen from the host, you can can connect using either:\n`adb connect localhost:5555`\n\n`adb connect 172.17.0.2:5555`\n\n\n\n### Professional support\n\nFor more sophisticated endeavours, we offer the following support services:\n\n- Enterprise support, business support, or casual support.\n- Custom images, custom scripts, consulting (per hour available!)\n- One-on-one conversations with you or your development team.\n\nIn case you're interested, contact [@sickcodes on Twitter](https://twitter.com/sickcodes) or submit a contact form [here](https://sick.codes/contact).\n\n![How to Install Bliss OS](/bliss_os_installation_instructions_docker.gif?raw=true \"How to Install Bliss OS\")\n\n## License/Contributing\n\ndock-droid is licensed under the [GPL v3+](LICENSE), also known as the GPL v3 or later License. Contributions are welcomed and immensely appreciated.\n\nDon't be shy, [the GPLv3+](https://www.gnu.org/licenses/quick-guide-gplv3.html) allows you to use Dock-Droid as a tool to create proprietary software, as long as you follow any other license within the software.\n\n## Disclaimer\n\nThis is a Dockerized Android setup/tutorial for conducting Android Security Research.\n\nProduct names, logos, brands and other trademarks referred to within this project are the property of their respective trademark holders. These trademark holders are not affiliated with our repository in any capacity. They do not sponsor or endorse this project in any way.\n\n\n### Other cool Docker/QEMU based projects\n\n- [Run macOS in a Docker container with Docker-OSX](https://github.com/sickcodes/Docker-OSX) - [https://github.com/sickcodes/Docker-OSX](https://github.com/sickcodes/Docker-OSX)\n- [Run iOS in a Docker container with Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS) - [https://github.com/sickcodes/Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS)\n\n# Passthrough your WebCam to the Android container.\n\nIdentify your webcam:\n\n```bash\nlsusb | grep -i cam\n```\n\n```console\nBus 003 Device 003: ID 13d3:56a2 IMC Networks USB2.0 HD UVC WebCam\n```\n\nUsing `Bus` and `Device` as `hostbus` and `hostaddr`, include the following docker command:\n\n## VFIO Passthrough\n\n*Waiting for public `mesa` builds: https://blissos.org/*\n\nWhen these hardware accelerated images are released, you can follow the Issue opened by: [@M1cha](https://github.com/M1cha)\n\nSee [https://github.com/sickcodes/dock-droid/issues/2](https://github.com/sickcodes/dock-droid/issues/2)\n\n\u003e the online documentation for that is very bad and mostly outdated(due to kernel and qemu updates). But here's some references that helped me set it up several times:\n\u003e \n[https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Plain_QEMU_without_libvirt](https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Plain_QEMU_without_libvirt)\n\u003e \n[https://www.kernel.org/doc/Documentation/vfio.txt](https://www.kernel.org/doc/Documentation/vfio.txt)\n\u003e \n\u003e \n\u003e the general summary:\n\u003e \n\u003e     * make sure your hardware supports VT-d/AMD-VI and UEFI and linux have it enabled\n\u003e \n\u003e     * figure out which devices are in the same iommu group\n\u003e \n\u003e     * detach all drivers from those devices\n\u003e \n\u003e     * attach vfio-pci to those devices\n\nAdd the following lines when you are ready:\n\n```bash\n    --privileged \\\n    -e EXTRA=\"-device vfio-pci,host=04:00.0' \\\n```\n\n## GPU Sharing\n\nWork in progress\n\n```bash\n\nsudo tee -a /etc/libvirt/qemu.conf \u003c\u003c'EOF'\ncgroup_device_acl = [\n    \"/dev/null\", \"/dev/full\", \"/dev/zero\",\n    \"/dev/random\", \"/dev/urandom\",\n    \"/dev/ptmx\", \"/dev/kvm\",\n    \"/dev/vfio/vfio\",\n    \"/dev/dri/card0\",\n    \"/dev/dri/card1\",\n    \"/dev/dri/renderD128\"\n]\nEOF\n\n# --device /dev/video0 \\\n# --device /dev/video1 \\\n\ngrep \"video\\|render\" /etc/group\n\n# render:x:989:\n# video:x:986:sddm\n\nsudo usermod -aG video \"${USER}\"\n\nsudo systemctl restart libvirtd\n\ndocker run -it \\\n    -v \"${PWD}/android.qcow2:/home/arch/dock-droid/android.qcow2\" \\\n    --privileged \\\n    --device /dev/kvm \\\n    --device /dev/video1 \\\n    -v /tmp/.X11-unix:/tmp/.X11-unix \\\n    -e \"DISPLAY=${DISPLAY:-:0.0}\" \\\n    -p 5555:5555 \\\n    -p 50922:10022 \\\n    --user 1000:1000 \\\n    --group-add=966 \\\n    --group-add=989 \\\n    --device /dev/dri/renderD128:/dev/dri/renderD128 \\\n    --device /dev/dri/card0:/dev/dri/card0 \\\n    --device /dev/dri/card1:/dev/dri/card1 \\\n    sickcodes/dock-droid:naked\n\n# pick which graphics card\n# --device /dev/dri/card0:/dev/dri/card0 \\\n\n```\n\n\n### Convert BlissOS Virtual Box to Dock-Droid\n\n\n```bash\nqemu-img convert -f vdi -O qcow2 BlissOS.vdi android.qcow2\n```\n\n## Building a headless container to run remotely with secure VNC\n\nAdd the following line:\n\n`-e EXTRA=\"-display none -vnc 0.0.0.0:99,password=on\"`\n\nIn the Docker terminal, press `enter` until you see `(qemu)`.\n\nType `change vnc password someusername`\n\nEnter a password for your new vnc username^.\n\nYou also need the container IP: `docker inspect \u003ccontainerid\u003e | jq -r '.[0].NetworkSettings.IPAddress'`\n\nOr `ip n` will usually show the container IP first.\n\nNow VNC connect using the Docker container IP, for example `172.17.0.2:5999`\n\nRemote VNC over SSH: `ssh -N root@1.1.1.1 -L  5999:172.17.0.2:5999`, where `1.1.1.1` is your remote server IP and `172.17.0.2` is your LAN container IP.\n\nNow you can direct connect VNC to any container built with this command!\n\n\n# BlissOS Image Builder Using Platform Manifests\n\n**This requires 250GB of REAL space.**\n\nThis was previously at `./build`, but due to Docker Hub using the wrong README.md file, I have added these instructions below:\n\nMake and add a non-root user\n```bash\n\nUSERADD=user\nuseradd \"${USERADD}\" -p \"${USERADD}\"\ntee -a /etc/sudoers \u003c\u003c\u003c \"${USERADD} ALL=(ALL) NOPASSWD: ALL\"\nmkdir -p \"/home/${USERADD}\"\nchown \"${USERADD}:${USERADD}\" \"/home/${USERADD}\"\n\n# passwd user \u003c\u003cEOF\n# 1000\n# 1000\n# EOF\n\nchsh -s /bin/bash \"${USERADD}\"\n\nusermod -aG docker \"${USERADD}\"\n\nsu user\n\n```\n\n```bash\n\nBUILD_DIRECTORY=/mnt/volume_nyc3_01\n\n# create a persistent folder on the host for building stuff\nmkdir \"${BUILD_DIRECTORY}/blissos-r36\"\n\ncd \"${BUILD_DIRECTORY}/blissos-r36\"\n\nwget https://raw.githubusercontent.com/sickcodes/dock-droid/master/Dockerfile.build\n\ndocker build -t blissos-builder .\n\ndocker run -it \\\n    -e REVISION=r11-r36 \\\n    -e MANIFEST_REPO=https://github.com/BlissRoms-x86/manifest.git \\\n    -v \"${BUILD_DIRECTORY}/blissos-r36:/blissos-r36\" \\\n    blissos-builder\n\n```\n\n","funding_links":["https://github.com/sponsors/sickcodes"],"categories":["Dockerfile"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsickcodes%2Fdock-droid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsickcodes%2Fdock-droid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsickcodes%2Fdock-droid/lists"}