Hello everyone.
I'm trying to emulate AndroidTV 9.0.0 to test some features having access to the framework code. AOSP is built on Ubuntu 20.10 and everything happens on this exact system.
I was trying two different approaches:
1) I found
this article about cuttlefish building and tried to do like them. After making some investigations of what packages exactly I should have installed and installing them, I stuck with:
$ launch_cvd
launch_cvd I 10-29 19:15:08 8102 8102 main.cc:363] /home/user/aosp/r60_orig/out/target/product/vsoc_x86_64/userdata.img exists. Not creating it.
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] input_events: is 4096
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] screen: is 4096
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] gralloc_manager: is 4096
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] gralloc_memory: is 4096
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] socket_forward: is 2101248
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] wifi_exchange: is 135168
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] ril: is 4096
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] e2e_primary: is 4096
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] e2e_secondary: is 4096
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] e2e_manager: is 4096
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] e2e_managed: is 4096
launch_cvd I 10-29 19:15:08 8102 8102 vsoc_memory.cpp:84] audio_data: is 20480
launch_cvd I 10-29 19:15:08 8102 8102 main.cc:371] Setting up /var/run/libvirt-699acfc4-c8c4-11e7-882b-5065f31dc101
launch_cvd W 10-29 19:15:08 8102 8102 main.cc:375] Not enough permission to create /var/run/libvirt-699acfc4-c8c4-11e7-882b-5065f31dc101 retrying with sudo
[sudo] password для user:
launch_cvd I 10-29 19:15:11 8102 8102 virtual_adb_server.cpp:23] name_ empty, not starting server socket
launch_cvd I 10-29 19:15:11 8102 8102 server.cpp:35] Starting server socket: /var/run/libvirt-699acfc4-c8c4-11e7-882b-5065f31dc101/usb-ip
launch_cvd I 10-29 19:15:11 8102 8102 kernel_log_server.cpp:47] Starting server socket: /var/run/libvirt-699acfc4-c8c4-11e7-882b-5065f31dc101/kernel-log
launch_cvd I 10-29 19:15:11 8102 8117 hald_client.cc:85] New HALD requesting region: screen
launch_cvd I 10-29 19:15:11 8102 8117 hald_client.cc:124] HALD managing region: screen connected.
launch_cvd I 10-29 19:15:11 8102 8102 ril_region_handler.cc:50] Network config:
launch_cvd I 10-29 19:15:11 8102 8102 ril_region_handler.cc:51] ipaddr =
launch_cvd I 10-29 19:15:11 8102 8102 ril_region_handler.cc:52] gateway =
launch_cvd I 10-29 19:15:11 8102 8102 ril_region_handler.cc:53] dns = 8.8.8.8
launch_cvd I 10-29 19:15:11 8102 8102 ril_region_handler.cc:54] broadcast =
launch_cvd I 10-29 19:15:11 8102 8102 ril_region_handler.cc:55] prefix length = 4294967295
launch_cvd E 10-29 19:15:11 8102 8102 ril_region_handler.cc:128] Unable to obtain the network configuration
launch_cvd I 10-29 19:15:11 8102 8117 hald_client.cc:85] New HALD requesting region: wifi_exchange
launch_cvd I 10-29 19:15:11 8102 8117 hald_client.cc:124] HALD managing region: wifi_exchange connected.
launch_cvd I 10-29 19:15:11 8102 8102 wifi_region_handler.cc:41] Setting guest mac to 00:43:56:44:80:01
launch_cvd I 10-29 19:15:11 8102 8102 wifi_region_handler.cc:49] Setting host mac to 42:00:00:00:00:00
launch_cvd I 10-29 19:15:11 8102 8102 libvirt_manager.cpp:167] Interactive serial port set up. To access the console run:
launch_cvd I 10-29 19:15:11 8102 8102 libvirt_manager.cpp:168] $ sudo socat file:$(tty),raw,echo=0 /var/run/libvirt-699acfc4-c8c4-11e7-882b-5065f31dc101/kernel-log
launch_cvd I 10-29 19:15:11 8102 8102 libvirt_manager.cpp:167] Interactive serial port set up. To access the console run:
launch_cvd I 10-29 19:15:11 8102 8102 libvirt_manager.cpp:168] $ sudo socat file:$(tty),raw,echo=0 /var/run/libvirt-699acfc4-c8c4-11e7-882b-5065f31dc101/console
error: Failed to create domain from /dev/fd/0
error: Cannot get interface MTU on 'cvd-mobile-01': No such device
launch_cvd F 10-29 19:15:12 8102 8102 libvirt_manager.cpp:349] Launch command exited with status 256
What this error means remains unclear to me.
So, I cloned the repo, built .deb packages, installed, rebooted, all that stuff.
Then I do source and lunch, in the same terminal I do
$ cvd_docker_create -A -C
Defaulting Android path to /home/user/aosp/r60_orig/out/target/product/vsoc_x86_64
Defaulting Cuttlefish path to /home/user/aosp/r60_orig/out/host/linux-x86/cvd-host_package.tar.gz
Container cuttlefish does not exist.
Setting up Cuttlefish host image from /home/user/aosp/r60_orig/out/host/linux-x86/cvd-host_package.tar.gz in /tmp/tmp.F5HN4vaZLU.
Setting up Android images from /home/user/aosp/r60_orig/out/target/product/vsoc_x86_64 in /tmp/tmp.F5HN4vaZLU.
Starting container cuttlefish (id 0) from image cuttlefish.
77dd1b5893b6af014da7ab28a323090667111794c3c350f9edb85029a4e915ae
Waiting for cuttlefish to boot.
Done waiting for cuttlefish to boot.
To log into container cuttlefish without starting Android, call cvd_login_cuttlefish
To start Android in container cuttlefish, call cvd_start_cuttlefish
To stop Android in container cuttlefish, call cvd_stop_cuttlefish
To get the home directory of container cuttlefish, call cvd_gethome_cuttlefish
Log into container cuttlefish: cvd_login_cuttlefish
Start Cuttlefish: cvd_start_cuttlefish
Stop Cuttlefish: cvd_stop_cuttlefish
Delete container cuttlefish:
cvd_docker_rm
Delete all containers:
cvd_docker_rm_all
Create a cuttlefish container:
cvd_docker_create <options> [NAME] # by default names 'cuttlefish'
Options:
-s | --singleshot : run the container, log in once, then delete it on logout
: otherwise, the container is created as a daemon
-x | --with_host_x : run the container in singleshot and
: share X of the docker host
-A[/path] | --android[=/path] : mount Android images from path (defaults to $ANDROID_PRODUCT_OUT);
: requires -C to also be specified
: (Optional path argument must follow short-option name without intervening space;
: it must follow long-option name followed by an '=' without intervening space)
-C[/path] | --cuttlefish[=/path] : mount Cuttlefish host image from path (defaults to $ANDROID_HOST_OUT/cvd-host_package.tar.gz)
: (Optional path argument must follow short-option name without intervening space;
: it must follow long-option name followed by an '=' without intervening space)
-m | --share_dir dir1:dir2 : mount a host directory dir1 at dir2 of docker container
: dir1 should be an absolute path or relative path to /mnt/Android/RTK/TestApps/android-cuttlefish
: dir2 should be an absolute path or relative path to /home/vsoc-01/
: /home/slava is not allowed as dir1
: /home/vsoc-01 is not allowed as dir2
: For multiple mounts, use multiple -m options per pair
-h | --help : print this help message
The optional [NAME] will override -n option for backward compatibility
To list existing Cuttlefish containers:
cvd_docker_list
Existing Cuttlefish containers:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
77dd1b5893b6 cuttlefish "/lib/systemd/systemd" 4 seconds ago Up Less than a second 0.0.0.0:6444->6444/tcp, 0.0.0.0:6520->6520/tcp, 0.0.0.0:8443->8443/tcp, 0.0.0.0:15550-15553->15550-15553/tcp, 0.0.0.0:15550-15553->15550-15553/udp cuttlefish
And finally
$ cvd_start_cuttlefish
launch_cvd I 10-29 17:44:31 270 270 main.cc:363] /home/vsoc-01/userdata.img exists. Not creating it.
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] input_events: is 4096
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] screen: is 4096
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] gralloc_manager: is 4096
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] gralloc_memory: is 4096
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] socket_forward: is 2101248
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] wifi_exchange: is 135168
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] ril: is 4096
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] e2e_primary: is 4096
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] e2e_secondary: is 4096
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] e2e_manager: is 4096
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] e2e_managed: is 4096
launch_cvd I 10-29 17:44:31 270 270 vsoc_memory.cpp:84] audio_data: is 20480
launch_cvd I 10-29 17:44:31 270 270 main.cc:371] Setting up /var/run/libvirt-699acfc4-c8c4-11e7-882b-5065f31dc101
launch_cvd W 10-29 17:44:31 270 270 main.cc:375] Not enough permission to create /var/run/libvirt-699acfc4-c8c4-11e7-882b-5065f31dc101 retrying with sudo
And I don't speak of errors regarding that kernel and cmdline files were not found.
So, what exactly am I doing wrong? How do I launch the cuttlefish?