google / android-emulator-container-scripts

Apache License 2.0
1.89k stars 266 forks source link

ERROR: Not enough disk space to run AVD 'Pixel2'. Exiting... #357

Closed CAMOBAP closed 1 year ago

CAMOBAP commented 1 year ago

I trying to run a docker container in my portainer environment, here is docker-compose.yaml:

version: '3'

services:
  android-30-google-x64:
    image: us-docker.pkg.dev/android-emulator-268719/images/30-google-x64-no-metrics:30.1.2
    environment:
    - |
      ADBKEY=
      -----BEGIN PRIVATE KEY-----
      ...
      -----END PRIVATE KEY-----
    - AVD_CONFIG=disk.dataPartition.size=2024M
    - EMULATOR_PARAMS=-no-audio
    devices: 
    - "/dev/kvm:/dev/kvm" 
    ports:
    - 8554:8554/tcp
    - 5554:5554/tcp
    - 5555:5555/tcp

Unfortunately it ends with:

... ERROR: Not enough disk space to run AVD 'Pixel2'. Exiting...

Check full logs

``` version: Android emulator version 30.1.2.0 (build_id 6800617) (CL:N/A) version: launch_script: 0+untagged.240.g410ef1e version: Pkg.Desc=System Image x86_64 with Google APIs. version: Pkg.Revision=7 version: Pkg.Dependencies=emulator#30.0.4 version: AndroidVersion.ApiLevel=30 version: SystemImage.Abi=x86_64 version: SystemImage.TagId=google_apis version: SystemImage.TagDisplay=Google APIs version: SystemImage.GpuSupport=true version: Addon.VendorId=google version: Addon.VendorDisplay=Google Inc.  COMMAND: rm -rf /tmp/adb.0.log /tmp/android-unknown /tmp/pulse-n8caDTCpD66d /tmp/pulse-socket /tmp/pulseverbose.log COMMAND: rm -rf /android-home/Pixel2.avd/*.lock emulator: No console token provided, console disabled. COMMAND: rm -f /root/.android/adbkey /root/.android/adbkey.pub emulator: Using provided adb private key COMMAND: chmod 600 /root/.android/adbkey COMMAND: mkdir -p /root/.config/pulse COMMAND: pulseaudio -D -vvvv --log-time=1 --log-target=newfile:/tmp/pulseverbose.log --log-time=1 --exit-idle-time=-1 COMMAND: pactl list pulse: ( 0.000| 0.000) W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified). pulse: ( 0.000| 0.000) I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted pulse: ( 0.000| 0.000) I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted pulse: ( 0.000| 0.000) D: [pulseaudio] core-rtclock.c: Timer slack is set to 50 us. pulse: ( 0.001| 0.000) E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory pulse: ( 0.001| 0.000) E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory pulse: ( 0.001| 0.000) E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory pulse: ( 0.001| 0.000) E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory pulse: ( 0.001| 0.000) E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory pulse: ( 0.001| 0.000) E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory pulse: ( 0.001| 0.000) E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory pulse: ( 0.001| 0.000) E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory pulse: ( 0.001| 0.000) E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory pulse: ( 0.001| 0.000) E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory pulse: ( 0.001| 0.000) E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory pulse: ( 0.001| 0.000) I: [pulseaudio] core-util.c: Failed to acquire high-priority scheduling: Input/output error pulse: ( 0.001| 0.000) I: [pulseaudio] main.c: This is PulseAudio 10.0 pulse: ( 0.001| 0.000) D: [pulseaudio] main.c: Compilation host: x86_64-pc-linux-gnu  0 Name: module-null-sink Argument: sink_name=NOP sink_properties=device.description=NOP Usage counter: 0  Properties: module.author = "Lennart Poettering" module.description = "Clocked NULL sink" module.version = "10.0"  1 Name: module-native-protocol-unix Argument: auth-anonymous=1 socket=/tmp/pulse-socket Usage counter: n/a  Properties: module.author = "Lennart Poettering" module.description = "Native protocol (UNIX sockets)" module.version = "10.0"  2 Name: module-native-protocol-tcp Argument: auth-anonymous=1 Usage counter: n/a  Properties: module.author = "Lennart Poettering" module.description = "Native protocol (TCP sockets)" module.version = "10.0" Sink #0  State: IDLE Name: NOP Description: NOP Driver: module-null-sink.c Sample Specification: s16le 2ch 44100Hz Channel Map: front-left,front-right Owner Module: 0  o Volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB balance 0.00 Base Volume: 65536 / 100% / 0.00 dB Monitor Source: NOP.monitor Latency: 2208524 usec, configured 2000000 usec Flags: DECIBEL_VOLUME LATENCY  Properties: device.description = "NOP" device.class = "abstract" device.icon_name = "audio-card"  : pcm  0  State: IDLE Name: NOP.monitor Description: Monitor of NOP Driver: module-null-sink.c Sample Specification: s16le 2ch 44100Hz Channel Map: front-left,front-right Owner Module: 0  o Volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB balance 0.00 Base Volume: 65536 / 100% / 0.00 dB Monitor of Sink: NOP Latency: 0 usec, configured 2000000 usec Flags: DECIBEL_VOLUME LATENCY  Properties: device.description = "Monitor of NOP" device.class = "monitor" device.icon_name = "audio-input-microphone"  : pcm  0 Driver: protocol-native.c Owner Module: 1  Properties: application.name = "pactl" native-protocol.peer = "UNIX socket client" native-protocol.version = "32" application.process.id = "33" application.process.user = "root" application.process.host = "ab88e1d7ccc6" application.process.binary = "pactl" application.language = "C" application.process.machine_id = "c31eea55a29431535ff01de94bdcf5cf" pulse: ( 0.001| 0.000) D: [pulseaudio] main.c: Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/pulseaudio-ZMrhzG/pulseaudio-10.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -fno-common -fdiagnostics-show-option -fdiagnostics-color=auto COMMAND: mkdir /tmp/android-unknown pulse: ( 0.001| 0.000) D: [pulseaudio] main.c: Running on host: Linux x86_64 5.15.0-84-generic #93-Ubuntu SMP Tue Sep 5 17:16:10 UTC 2023 pulse: ( 0.001| 0.000) D: [pulseaudio] main.c: Found 1 CPUs. pulse: ( 0.001| 0.000) I: [pulseaudio] main.c: Page size is 4096 bytes pulse: ( 0.001| 0.000) D: [pulseaudio] main.c: Compiled with Valgrind support: no pulse: ( 0.001| 0.000) D: [pulseaudio] main.c: Running in valgrind mode: no pulse: ( 0.001| 0.000) D: [pulseaudio] main.c: Running in VM: yes pulse: ( 0.001| 0.000) D: [pulseaudio] main.c: Optimized build: yes pulse: ( 0.001| 0.000) D: [pulseaudio] main.c: FASTPATH defined, only fast path asserts disabled. pulse: ( 0.001| 0.000) I: [pulseaudio] main.c: Machine ID is c31eea55a29431535ff01de94bdcf5cf. pulse: ( 0.001| 0.000) I: [pulseaudio] main.c: Using runtime directory /root/.config/pulse/c31eea55a29431535ff01de94bdcf5cf-runtime. pulse: ( 0.001| 0.000) I: [pulseaudio] main.c: Using state directory /root/.config/pulse. pulse: ( 0.001| 0.000) I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-10.0/modules. pulse: ( 0.001| 0.000) I: [pulseaudio] main.c: Running in system mode: no COMMAND: mkfifo /tmp/android-unknown/kernel.log pulse: ( 0.002| 0.000) I: [pulseaudio] main.c: System supports high resolution timers pulse: ( 0.002| 0.000) D: [pulseaudio] memblock.c: Using shared memfd memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472 pulse: ( 0.002| 0.000) I: [pulseaudio] cpu-x86.c: CPU flags: CMOV MMX SSE SSE2 SSE3 SSSE3 SSE4_1 SSE4_2 pulse: ( 0.002| 0.000) I: [pulseaudio] svolume_mmx.c: Initialising MMX optimized volume functions. pulse: ( 0.002| 0.000) I: [pulseaudio] remap_mmx.c: Initialising MMX optimized remappers. pulse: ( 0.002| 0.000) I: [pulseaudio] svolume_sse.c: Initialising SSE2 optimized volume functions. pulse: ( 0.002| 0.000) I: [pulseaudio] remap_sse.c: Initialising SSE2 optimized remappers. pulse: ( 0.002| 0.000) I: [pulseaudio] sconv_sse.c: Initialising SSE2 optimized conversions. pulse: ( 0.002| 0.000) I: [pulseaudio] svolume_orc.c: Initialising ORC optimized volume functions. pulse: ( 0.003| 0.000) I: [pulseaudio] sink.c: Created sink 0 "NOP" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right COMMAND: mkfifo /tmp/android-unknown/logcat.log pulse: ( 0.003| 0.000) I: [pulseaudio] sink.c: device.description = "NOP" pulse: ( 0.003| 0.000) I: [pulseaudio] sink.c: device.class = "abstract" pulse: ( 0.003| 0.000) I: [pulseaudio] sink.c: device.icon_name = "audio-card" pulse: ( 0.003| 0.000) I: [pulseaudio] source.c: Created source 0 "NOP.monitor" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right pulse: ( 0.003| 0.000) I: [pulseaudio] source.c: device.description = "Monitor of NOP" pulse: ( 0.003| 0.000) I: [pulseaudio] source.c: device.class = "monitor" pulse: ( 0.003| 0.000) I: [pulseaudio] source.c: device.icon_name = "audio-input-microphone" pulse: ( 0.003| 0.000) D: [null-sink] module-null-sink.c: Thread starting up pulse: ( 0.003| 0.000) I: [pulseaudio] module.c: Loaded "module-null-sink" (index: #0; argument: "sink_name=NOP sink_properties=device.description=NOP"). pulse: ( 0.004| 0.000) I: [pulseaudio] module.c: Loaded "module-native-protocol-unix" (index: #1; argument: "auth-anonymous=1 socket=/tmp/pulse-socket"). pulse: ( 0.005| 0.000) I: [pulseaudio] module.c: Loaded "module-native-protocol-tcp" (index: #2; argument: "auth-anonymous=1"). emulator: It is safe to ignore the warnings from tail. The files will come into existence soon. Adding disk.dataPartition.size=2024M to config.ini pulse: ( 0.005| 0.000) W: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 pulse: ( 0.005| 0.000) W: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 pulse: ( 0.006| 0.006) I: [pulseaudio] main.c: Daemon startup successful. pulse: ( 0.007| 0.002) I: [pulseaudio] main.c: Daemon startup complete. tail: * daemon not running; starting now at tcp:5037 warning: --retry only effective for the initial open tail: cannot open '/tmp/android-unknown/goldfish_rtc_0' for reading: No such file or directory pulse: ( 0.016| 0.008) I: [pulseaudio] client.c: Created 0 "Native client (UNIX socket client)" pulse: ( 0.016| 0.000) I: [pulseaudio] protocol-native.c: Client authenticated anonymously. pulse: ( 0.020| 0.003) D: [pulseaudio] protocol-native.c: Protocol version: remote 32, local 32 pulse: ( 0.020| 0.000) D: [pulseaudio] protocol-native.c: SHM possible: yes pulse: ( 0.020| 0.000) D: [pulseaudio] protocol-native.c: Negotiated SHM: yes pulse: ( 0.020| 0.000) D: [pulseaudio] protocol-native.c: Memfd possible: yes pulse: ( 0.020| 0.000) D: [pulseaudio] protocol-native.c: Negotiated SHM type: shared memfd pulse: ( 0.020| 0.000) D: [pulseaudio] memblock.c: Using shared memfd memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65472 pulse: ( 0.020| 0.000) D: [pulseaudio] srbchannel.c: SHM block is 65472 bytes, ringbuffer capacity is 2 * 32712 bytes pulse: ( 0.020| 0.000) D: [pulseaudio] protocol-native.c: Enabling srbchannel... pulse: ( 0.021| 0.001) D: [pulseaudio] protocol-native.c: Client enabled srbchannel. pulse: ( 0.023| 0.001) I: [pulseaudio] client.c: Freed 0 "pactl" pulse: ( 0.023| 0.000) I: [pulseaudio] protocol-native.c: Connection died. * daemon started successfully COMMAND: exec emulator/emulator -avd Pixel2 -verbose -ports 5556,5557 -grpc 8554 -no-window -skip-adb-auth -no-snapshot -shell-serial file:/tmp/android-unknown/kernel.log -logcat-output /tmp/android-unknown/logcat.log -feature AllowSnapshotMigration -gpu swiftshader_indirect -metrics-collection -shell-serial file:/tmp/android-unknown/kernel.log -logcat-output /tmp/android-unknown/logcat.log -no-audio -qemu -append panic=1 emulator: autoconfig: -skin 1080x1920 emulator: autoconfig: -skindir (null) emulator: autoconfig: -kernel /android/sdk/system-images/android/x86_64//kernel-ranchu emulator: Target arch = 'x86_64' emulator: Auto-detect: Kernel image requires new device naming scheme. emulator: Auto-detect: Kernel does not support YAFFS2 partitions. emulator: autoconfig: -ramdisk /android/sdk/system-images/android/x86_64//ramdisk.img emulator: Using initial system image: /android/sdk/system-images/android/x86_64//system.img emulator: Using initial vendor image: /android/sdk/system-images/android/x86_64//vendor.img emulator: autoconfig: -initdata /android/sdk/system-images/android/x86_64//userdata.img emulator: autoconfig: -cache /android-home/Pixel2.avd/cache.img emulator: Physical RAM size: 4096MB emulator: VM heap size 512MB is below hardware specified minimum of 576MB,setting it to that value emulator: System image is read only emulator: Found 1 DNS servers: 127.0.0.11 emulator: ERROR: Not enough disk space to run AVD 'Pixel2'. Exiting... ```

CAMOBAP commented 1 year ago

While collecting technical information to report this issue, I actually found a way to resolve it, by mounting `/

So working docker-compose.yaml for me is

version: '3'

services:
  android-30-google-x64:
    image: us-docker.pkg.dev/android-emulator-268719/images/30-google-x64-no-metrics:30.1.2
    environment:
    - |
      ADBKEY=
      -----BEGIN PRIVATE KEY-----
      ...
      -----END PRIVATE KEY-----
    - EMULATOR_PARAMS=-no-audio
    devices: 
    - "/dev/kvm:/dev/kvm" 
    ports:
    - 8554:8554/tcp
    - 5554:5554/tcp
    - 5555:5555/tcp
    volumes:
    - home:/android-home

volumes:
  home:
    external: true

Screen mirroring doesn't work out of the box, but it's a different issue