GithubHelp home page GithubHelp logo

thatoddmailbox / cuttlefish-docker Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 3.0 11 KB

Run the Android Cuttlefish virtual device from within a Docker container.

License: MIT License

Dockerfile 100.00%

cuttlefish-docker's Introduction

cuttlefish-docker

Run the Android Cuttlefish virtual device from within a Docker container. This still relies on the host's KVM support, so it's not fully isolated. (and the host will need to trust you, so this won't work on a cloud CI/CD system or similar without some control over the host)

Still very much a work-in-progress. (as in, it doesn't actually work yet)

Requirements

  • A Docker host that you have control over
  • On that host, working KVM (see here for instructions on how to check that)
    • Note that this means your CPU needs to support some form of virtualization extensions
    • This means you can't run this in a cloud VM, unless your cloud provider supports nested virtualization (Azure and Google Cloud both claim to, although this hasn't been tested on either)

Instructions

Download aosp_cf_x86_phone-img-6999531.zip and cvd-host_package.tar.gz as described in the official instructions.

On the host:

docker build --tag cuttlefish:latest .
docker run --network host --privileged -v /dev/log:/dev/log --device /dev/net/tun --device /dev/kvm --p 8444:8443 --user=0 -it cuttlefish:latest

Then, in the container:

cd cf
HOME=$PWD ./bin/launch_cvd -report_anonymous_usage_stats "y"

Limitations

  • It doesn't really work yet
  • Still need to figure out how to pass through hardware acceleration stuff
  • Path to aosp_cf_x86_phone-img is hardcoded to specific build ID
  • Requires manually running launch_cvd
    • This should be automated with the start of the container
  • /dev/log from the host needs to be passed through to make crosvm happy; there should be a way around that
    • rsyslogd is installed in the container, but it seems to need some configuration or something
  • The code in the container is run with uid 0 (aka root)
    • This should be fixable? Might need to change the usermod commands in the Dockerfile though.
  • Data persistence doesn't really work yet
    • Should be using a bind mount or volume to save the VM data

cuttlefish-docker's People

Contributors

thatoddmailbox avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dohyuu jvmkit turbin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.