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 # Install build dependencies and build debian packages 31 ./tools/buildutils/build_packages.sh 32 sudo dpkg -i ./cuttlefish-base_*_*64.deb || sudo apt-get install -f 33 sudo dpkg -i ./cuttlefish-user_*_*64.deb || sudo apt-get install -f 34 sudo usermod -aG kvm,cvdnetwork,render $USER 35 sudo reboot 36 ``` 37 38 The reboot will trigger installing additional kernel modules and applying 39 udev rules. 40 413. Go to http://ci.android.com/ 424. Enter a branch name. Start with `aosp-main` if you don't know what you're 43 looking for 445. Navigate to `aosp_cf_x86_64_phone` and click on `userdebug` for the latest build 45 46*** promo 47 For ARM, use branch `aosp-main-throttled` and device target `aosp_cf_arm64_only_phone-trunk_staging-userdebug` 48*** 49 506. Click on `Artifacts` 517. Scroll down to the OTA images. These packages look like 52 `aosp_cf_x86_64_phone-img-xxxxxx.zip` -- it will always have `img` in the name. 53 Download this file 548. Scroll down to `cvd-host_package.tar.gz`. You should always download a host 55 package from the same build as your images. 569. On your local system, combine the packages: 57 58 ```bash 59 mkdir cf 60 cd cf 61 tar xvf /path/to/cvd-host_package.tar.gz 62 unzip /path/to/aosp_cf_x86_64_phone-img-xxxxxx.zip 63 ``` 64 6510. Launch cuttlefish with: 66 67 `$ HOME=$PWD ./bin/launch_cvd` 68 69## Debug Cuttlefish 70 71You can use `adb` to debug it, just like a physical device: 72 73 `$ ./bin/adb -e shell` 74 75## Launch Viewer (WebRTC) 76 77When launching with `---start_webrtc` (the default), you can see a list of all 78available devices at `https://localhost:8443` . For more information, see the 79WebRTC on Cuttlefish 80[documentation](https://source.android.com/setup/create/cuttlefish-ref-webrtc). 81 82## Stop Cuttlefish 83 84You will need to stop the virtual device within the same directory as you used 85to launch the device. 86 87 `$ HOME=$PWD ./bin/stop_cvd` 88 89