• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Cuttlefish Getting Started
2
3## Try Cuttlefish
4
51. Make sure virtualization with KVM is available.
6
7   ```bash
8   grep -c -w "vmx\|svm" /proc/cpuinfo
9   ```
10
11   This should return a non-zero value. If running on a cloud machine, this may
12   take cloud-vendor-specific steps to enable. For Google Compute Engine
13   specifically, see the [GCE guide].
14
15  [GCE guide]: https://cloud.google.com/compute/docs/instances/enable-nested-virtualization-vm-instances
16
17*** promo
18   ARM specific steps:
19   - When running on an ARM machine, the most direct way is to check
20   for the existence of `/dev/kvm`. Note that this method can also be used to
21   confirm support of KVM on any environment.
22***
23
242. Download, build, and install the host debian packages:
25
26   ```bash
27   sudo apt install -y git devscripts config-package-dev debhelper-compat golang curl
28   git clone https://github.com/google/android-cuttlefish
29   cd android-cuttlefish
30   sudo apt install devscripts equivs
31   for dir in base frontend; do
32     pushd $dir
33     sudo mk-build-deps -i
34     dpkg-buildpackage -uc -us
35     popd
36   done
37   sudo dpkg -i ./cuttlefish-base_*_*64.deb || sudo apt-get install -f
38   sudo dpkg -i ./cuttlefish-user_*_*64.deb || sudo apt-get install -f
39   sudo usermod -aG kvm,cvdnetwork,render $USER
40   sudo reboot
41   ```
42
43   The reboot will trigger installing additional kernel modules and applying
44   udev rules.
45
463. Go to http://ci.android.com/
474. Enter a branch name. Start with `aosp-main` if you don't know what you're
48   looking for
495. Navigate to `aosp_cf_x86_64_phone` and click on `userdebug` for the latest build
50
51*** promo
52   For ARM, use branch `aosp-main-throttled` and device target `aosp_cf_arm64_only_phone-trunk_staging-userdebug`
53***
54
556. Click on `Artifacts`
567. Scroll down to the OTA images. These packages look like
57   `aosp_cf_x86_64_phone-img-xxxxxx.zip` -- it will always have `img` in the name.
58   Download this file
598. Scroll down to `cvd-host_package.tar.gz`. You should always download a host
60   package from the same build as your images.
619. On your local system, combine the packages:
62
63   ```bash
64   mkdir cf
65   cd cf
66   tar xvf /path/to/cvd-host_package.tar.gz
67   unzip /path/to/aosp_cf_x86_64_phone-img-xxxxxx.zip
68   ```
69
7010. Launch cuttlefish with:
71
72   `$ HOME=$PWD ./bin/launch_cvd`
73
74## Debug Cuttlefish
75
76You can use `adb` to debug it, just like a physical device:
77
78   `$ ./bin/adb -e shell`
79
80## Launch Viewer (WebRTC)
81
82When launching with `---start_webrtc` (the default), you can see a list of all
83available devices at `https://localhost:8443` . For more information, see the
84WebRTC on Cuttlefish
85[documentation](https://source.android.com/setup/create/cuttlefish-ref-webrtc).
86
87## Stop Cuttlefish
88
89You will need to stop the virtual device within the same directory as you used
90to launch the device.
91
92   `$ HOME=$PWD ./bin/stop_cvd`
93
94