Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to create namespace #1

Open
intelligentpotato opened this issue Nov 7, 2023 · 2 comments
Open

Failed to create namespace #1

intelligentpotato opened this issue Nov 7, 2023 · 2 comments

Comments

@intelligentpotato
Copy link

intelligentpotato commented Nov 7, 2023

Hello.

I can not get the redroid-11-wifi image to work.

I enabled mac80211_hwsim via modprobe mac80211_hwsim

Verified that it works:

# iw dev
phy#0
        Interface wlan0
                ifindex 70
                wdev 0x1
                addr 02:00:00:00:00:00
                type managed
                txpower 20.00 dBm

Unfortunately the container gets stuck and keeps repeating the following errors in logcat:

11-07 17:23:07.439   152   195 E TrafficController: Failed to add iface wlan0(2): Operation not permitted
11-07 17:23:07.439   258   272 D WifiNl80211Manager: Scan result ready event
11-07 17:23:07.440   258   272 D WifiNative: Scan result ready event
11-07 17:23:07.440   258   275 I EthernetTracker: interfaceLinkStateChanged, iface: wlan0, up: false
11-07 17:23:09.811  2408  2408 E execns  : Cannot open network namespace 'router' at '/proc/115/ns/net': No such file or directory
11-07 17:23:09.980   160   160 D SockClient: Trying to connect to: /ipc/hwcomposer.sock
11-07 17:23:09.980   160   160 E SockClient: SockClient, connect to /ipc/hwcomposer.sock failed: No such file or directory
11-07 17:23:09.980   160   160 E RfbServer: start, connect to hwc failed!
11-07 17:23:10.099   258   283 E SchedPolicy: Failed to find cgroup for tid 258
11-07 17:23:10.100   258   283 E SchedPolicy: Failed to find cgroup for tid 258
11-07 17:23:10.204  2409  2409 E execns  : Cannot open network namespace 'router' at '/proc/115/ns/net': No such file or directory
11-07 17:23:10.840  1113  1113 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.gmscompliance.service.START dat=chimera-action: cmp=com.google.android.gms/.chimera.PersistentBoundBrokerService }
11-07 17:23:11.028  1280  1280 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.checkin.START pkg=com.google.android.gms }
11-07 17:23:11.446  1113  1113 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE dat=chimera-action: cmp=com.google.android.gms/.chimera.PersistentApiService }
11-07 17:23:12.518  1113  1113 D BoundBrokerSvc: onUnbind: Intent { act=com.google.android.gms.phenotype.service.START dat=chimera-action: cmp=com.google.android.gms/.chimera.PersistentApiService }
11-07 17:23:13.461   258   272 I ActivityManager: Killing 1754:com.android.shell/2000 (adj 975): empty #17
11-07 17:23:13.468   135   135 I Zygote  : Process 1754 exited due to signal 9 (Killed)
11-07 17:23:14.440   258   272 I WifiService: startScan uid=10095
11-07 17:23:14.815  2411  2411 E execns  : Cannot open network namespace 'router' at '/proc/115/ns/net': No such file or directory
11-07 17:23:14.862  1181  1446 I WorkerManager: dispose()
11-07 17:23:14.959   258   283 E SchedPolicy: Failed to find cgroup for tid 258
11-07 17:23:14.979   258   283 I chatty  : uid=1000(system) android.bg identical 8 lines
11-07 17:23:14.980   258   283 E SchedPolicy: Failed to find cgroup for tid 258
11-07 17:23:14.981   160   160 D SockClient: Trying to connect to: /ipc/hwcomposer.sock
11-07 17:23:14.981   160   160 E SockClient: SockClient, connect to /ipc/hwcomposer.sock failed: No such file or directory
11-07 17:23:14.981   160   160 E RfbServer: start, connect to hwc failed!

I am launching the image using the following command:

docker run -itd --rm --privileged \
    -v ~/data0:/data \
    -p 5550:5555 \
	--name redroid11 \
    teddynight/redroid:redroid-11-wifi \
    ro.product.cpu.abilist=x86_64,arm64-v8a,x86,armeabi-v7a,armeabi \
    ro.product.cpu.abilist64=x86_64,arm64-v8a \
    ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi \
    ro.dalvik.vm.isa.arm=x86 \
    ro.dalvik.vm.isa.arm64=x86_64 \
    ro.enable.native.bridge.exec=1 \
    ro.enable.native.bridge.exec64=1 \
    ro.dalvik.vm.native.bridge=libhoudini.so

The host system is Ubuntu 20.04.

Is this a known bug and what can I do to circumvent it?

Appreciate your work, your image with libhoudini saved me a lot of time!

@TeddyNight
Copy link
Owner

TeddyNight commented Nov 7, 2023

Virtwifi subsystem (init.wifi.sh) depends on the linux network namespace isolation to work. And the container got stuck because the init failed to execute the init.wifi.sh script.
execns : Cannot open network namespace 'router' at '/proc/115/ns/net': No such file or directory means that there's something wrong with the namespace.
Make sure that the folder /data/vendor/var/run/netns/ exists.
May be you can try to manually run the command createns router, and then execns router /system/bin/ip inside the container. If the createns command works, then it will output the help msg of the ip command instead of the error msg like Unable to open file /data/vendor/var/run/netns/router.pid for namespace router1: No such file or directory.
I've met this problem before when I was trying to intergrate the subsystem into redroid, but I have forgot how I solved it.
The image runs both on my laptop (Manjaro with zen kernel) & my server (debian 11 with proxmox kernel & cgroupv1 disabled).
I have to admit that I have little knowledge about that😳, hopefully information above may be helpful to you.

@TeddyNight
Copy link
Owner

In fact, the virtwifi subsystem is still buggy. The container will get stuck serval days later after it boots on my server(debian 11).

@TeddyNight TeddyNight changed the title Failed to add iface Failed to create namespace Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants