redroid-doc icon indicating copy to clipboard operation
redroid-doc copied to clipboard

Cannot ADB Connect (offline) on Google Cloud ARM VM (T2A)

Open titusbiao opened this issue 6 months ago • 2 comments

Hello,

I just started the official Redroid 12 on an ARM VM (T2A) on Google Cloud in the us-central1f region, with Ubuntu 20.04.6 LTS ARM. Of course, the 5555 port is allowed to be inbound via the Firewall Policy. However, it will encounter an ADB connect offline error.

Step 1 Following the README.md, Let's install the required kernel modules.

titusbiao@redroid12ubuntu2004arm:~$ sudo apt install linux-modules-extra-`uname -r` -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  wireless-regdb
Suggested packages:
  crda
The following NEW packages will be installed:
  linux-modules-extra-5.15.0-1066-gcp wireless-regdb
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 63.2 MB of archives.
After this operation, 452 MB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 wireless-regdb all 2022.06.06-0ubuntu1~20.04.1 [9872 B]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 linux-modules-extra-5.15.0-1066-gcp arm64 5.15.0-1066.74~20.04.1 [63.2 MB]
Fetched 63.2 MB in 1min 38s (645 kB/s)                                                                                                                                                  
Selecting previously unselected package wireless-regdb.
(Reading database ... 63598 files and directories currently installed.)
Preparing to unpack .../wireless-regdb_2022.06.06-0ubuntu1~20.04.1_all.deb ...
Unpacking wireless-regdb (2022.06.06-0ubuntu1~20.04.1) ...
Selecting previously unselected package linux-modules-extra-5.15.0-1066-gcp.
Preparing to unpack .../linux-modules-extra-5.15.0-1066-gcp_5.15.0-1066.74~20.04.1_arm64.deb ...
Unpacking linux-modules-extra-5.15.0-1066-gcp (5.15.0-1066.74~20.04.1) ...
Setting up wireless-regdb (2022.06.06-0ubuntu1~20.04.1) ...
Setting up linux-modules-extra-5.15.0-1066-gcp (5.15.0-1066.74~20.04.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for linux-image-5.15.0-1066-gcp (5.15.0-1066.74~20.04.1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.15.0-1066-gcp
flash-kernel: deferring update (trigger activated)
/etc/kernel/postinst.d/zz-flash-kernel:
flash-kernel: deferring update (trigger activated)
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/40-force-partuuid.cfg'
Sourcing file `/etc/default/grub.d/50-cloudimg-settings.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
GRUB_FORCE_PARTUUID is set, will attempt initrdless boot
Found linux image: /boot/vmlinuz-5.15.0-1066-gcp
Found initrd image: /boot/initrd.img-5.15.0-1066-gcp
done
Processing triggers for flash-kernel (3.103ubuntu1~20.04.4) ...
Unsupported platform on EFI system, doing nothing.

titusbiao@redroid12ubuntu2004arm:~$ sudo modprobe binder_linux devices="binder,hwbinder,vndbinder" && sudo modprobe ashmem_linux

Step 2 Pull and run the official Redroid 12 docker image:

titusbiao@redroid12ubuntu2004arm:~$ docker run -itd --rm --privileged \
>     --pull always \
>     -v ~/data12:/data \
>     -p 5555:5555 \
>     --name redroid12 \
>     redroid/redroid:12.0.0-latest
12.0.0-latest: Pulling from redroid/redroid
fe7545716e43: Pull complete 
Digest: sha256:52332b2d74f337982d5ac281a8020ec297fb1ea05cbdcdaaa9c19a2065ae1adc
Status: Downloaded newer image for redroid/redroid:12.0.0-latest
1327057223e508bfa90017549715e97a2d5f6b1ceaff2a85a6b67ec92dc29f80

titusbiao@redroid12ubuntu2004arm:~$ docker --version && docker ps -as
Docker version 24.0.7, build 24.0.7-0ubuntu2~20.04.1
CONTAINER ID   IMAGE                           COMMAND                  CREATED         STATUS         PORTS                                       NAMES       SIZE
1327057223e5   redroid/redroid:12.0.0-latest   "/init qemu=1 androi…"   3 minutes ago   Up 3 minutes   0.0.0.0:5555->5555/tcp, :::5555->5555/tcp   redroid12   0B (virtual 1.63GB)

Step 3 When I use Windows CMD and try to ADB connect, it shows an error (10060)!

Microsoft Windows [Version 10.0.20348.2582]
(c) Microsoft Corporation. All rights reserved.

C:\Users\titusbiao\Desktop\scrcpy-win64-v2.6.1>adb connect 34.173.167.103:5555
* daemon not running; starting now at tcp:5037
* daemon started successfully
cannot connect to 34.173.167.103:5555: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)

C:\Users\titusbiao\Desktop\scrcpy-win64-v2.6.1>

Step 4 Then I back to the VM machine, and try to ADB connect itself, the localhost. However, it shows connected but offline!

titusbiao@redroid12ubuntu2004arm:~$ adb connect localhost:5555
* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to localhost:5555

titusbiao@redroid12ubuntu2004arm:~$ adb devices
List of devices attached
emulator-5554	offline

Step 5 I try to ADB disconnect everything on the VM, restart the container and ADB connect again, but no luck, still offline!

titusbiao@redroid12ubuntu2004arm:~$ adb disconnect
disconnected everything

titusbiao@redroid12ubuntu2004arm:~$ docker restart redroid12
redroid12

titusbiao@redroid12ubuntu2004arm:~$ docker --version && docker ps -as
Docker version 24.0.7, build 24.0.7-0ubuntu2~20.04.1
CONTAINER ID   IMAGE                           COMMAND                  CREATED         STATUS          PORTS                                       NAMES       SIZE
1327057223e5   redroid/redroid:12.0.0-latest   "/init qemu=1 androi…"   6 minutes ago   Up 11 seconds   0.0.0.0:5555->5555/tcp, :::5555->5555/tcp   redroid12   0B (virtual 1.63GB)

titusbiao@redroid12ubuntu2004arm:~$ adb connect localhost:5555
connected to localhost:5555

titusbiao@redroid12ubuntu2004arm:~$ adb devices
List of devices attached
localhost:5555	offline
emulator-5554	device

Step 6 Following the Troubleshooting section, I get the logs. redroid-debug.HwR1Vx8i.zip (I zipped the file for uploading to github)

titusbiao@redroid12ubuntu2004arm:~$ curl -fsSL https://raw.githubusercontent.com/remote-android/redroid-doc/master/debug.sh | sudo bash -s -- redroid12
Collecting, please wait...
Error: argument "eth0" is wrong: table id value is invalid


===================================
Please provide the collected logs
(zh_CN) 请提供此处收集的日志
/tmp/redroid-debug.HwR1Vx8i.tgz
===================================

Step 7 Also following the Troubleshooting section, use "ps -A" command to show more:

titusbiao@redroid12ubuntu2004arm:~$ docker exec -it redroid12 sh

1327057223e5:/ # ps -A
USER           PID  PPID     VSZ    RSS WCHAN            ADDR S NAME                       
root             1     0 10889396  9556 ep_poll             0 S init
root             8     1 10831920  6272 do_sys_po+          0 S init
root            10     1 10958112  6324 do_sys_po+          0 S ueventd
logd            18     1 10895796  5648 sigsuspend          0 S logd
lmkd            19     1 10792592  2392 ep_poll             0 S lmkd
system          20     1 10895396  4936 ep_poll             0 S servicemanager
system          24     1 10895228  6280 ep_poll             0 S hwservicemanager
shell           25     1 10830376  2632 wait_woken          0 S sh
root            26     1 10948232  8076 hrtimer_n+          0 S vold
system          33     1 10874092  5200 binder_th+          0 S [email protected]
keystore        34     1 11131320 13376 binder_th+          0 S keystore2
nobody          35     1 10810516  6840 binder_th+          0 S [email protected]
tombstoned      40     1 10838604  2140 ep_poll             0 S tombstoned
system          72     1 10845444  4208 binder_th+          0 S [email protected]
bluetooth       74     1 10799592  6264 binder_th+          0 S [email protected]
system          76     1 10841484  5652 binder_th+          0 S [email protected]
system          77     1 10921684  5176 binder_th+          0 S [email protected]
system          78     1 10994084  7280 binder_th+          0 S [email protected]
system          79     1 10859304  5484 ep_poll             0 S [email protected]
wifi            80     1 10856260  9004 binder_th+          0 S [email protected]
nobody          82     1 10810820  4608 binder_th+          0 S android.hardware.power-service.example
credstore       84     1 10867520  6920 binder_th+          0 S credstore
gpu_service     85     1 10926552  7256 binder_th+          0 S gpuservice
system          88     1 11252776 49792 ep_poll             0 S surfaceflinger
shell           99     1 10940700  5836 ep_poll             0 S adbd
mdnsr          118     1 8674096    992 do_select           0 S mdnsd
nobody         119     1 10860188  3572 do_sys_po+          0 S traced_probes
nobody         120     1 10848896  3476 do_sys_po+          0 S traced
system         127     1 10902148  5820 binder_th+          0 S idmap2d
incidentd      128     1 10821796  5072 ep_poll             0 S incidentd
root           129     1 10897148  5328 binder_th+          0 S installd
mediaex        130     1 11227216 26076 binder_th+          0 S media.extractor
media          132     1 10847064  6932 binder_th+          0 S media.metrics
root           135     1 10926600  4940 binder_th+          0 S storaged
radio          139     1 10963680  5448 hrtimer_n+          0 S rild
mediacodec     140     1 10884872 13836 binder_th+          0 S media.swcodec
statsd         142     1 10895868  4892 ep_poll             0 S statsd
system         180     1 10846800  5948 binder_th+          0 S gatekeeperd
llkd           186     1 10804260  3384 hrtimer_n+          0 S llkd
root          9493     0 10791180  3304 sigsuspend          0 S sh
cameraserver 21917     1 11209684 24052 hrtimer_n+          0 S cameraserver
root         21919     1 11047472  8516 binder_th+          0 S netd
wifi         21920     1 10899804  6296 ep_poll             0 S wificond
root         21981  9493 10814220  3360 0                   0 R ps

Step 8 I also refer to #673 to add androidboot.redroid_gpu_mode=guest, but still offline.

Base upon the above information, anyone can help me?

titusbiao avatar Aug 11 '24 04:08 titusbiao