Connect via ADB to a physical X86 via USB

246 views
Skip to first unread message

Alexandre Andrade

unread,
Apr 29, 2020, 6:29:25 AM4/29/20
to Android-x86
Hi there,
I have Android-x86 (version 9.0-r2) running in a Lenovo MIIX-320 and I have another PC running Linux. 
From the Linux host I can connect to any other Android device using an USB cable. But I can't connect to the Lenovo. 
Googling around I noticed that the vast majority of people connect to Android-x86 host via ADB using the network, what is not an option in my case (for performance). 
Is there any service in the Android-x86 that I should use to allow ADB connections using USB?

Cheers,
Alex 

youling 257

unread,
Apr 29, 2020, 9:45:34 AM4/29/20
to Android-x86
first request hardware support dwc3 gadget.
lspci
00:16.0 Class 0c03: 8086:0f37 dwc3-pci
00:14.0 Class 0c03: 8086:0f35 xhci_hcd

Alexandre Andrade

unread,
Apr 30, 2020, 1:33:17 AM4/30/20
to Android-x86
Hi Youling,
I run:

# modprobe dwc3-pci

But 'lspci' doesn't show any new hardware:

➜  ~ lspci
00:1c.0 Class 0604: 8086:22c8
00:1f.0 Class 0601: 8086:229c
01:00.0 Class 0280: 8086:3165
00:00.0 Class 0600: 8086:2280
00:03.0 Class 0480: 8086:22b8
00:1a.0 Class 1080: 8086:2298
00:0b.0 Class 1180: 8086:22dc
00:02.0 Class 0300: 8086:22b0
00:14.0 Class 0c03: 8086:22b5

Am I missing something?

Cheers,
Alex

youling 257

unread,
Apr 30, 2020, 2:01:51 AM4/30/20
to Android-x86
lspci -k
bios setting USB otg pci.


在 2020年4月30日星期四 UTC+8下午1:33:17,Alexandre Andrade写道:
33335859-82dd7fd2-d42b-11e7-8525-d4d1359c9fa5.jpg
2016-09-04 10.10.52.jpg

Alexandre Andrade

unread,
Apr 30, 2020, 6:39:00 AM4/30/20
to Android-x86
Hi Youling,
This tittle Lenovo doesn't have that option on the BIOS.
But thank you very much for your support!

Cheers,
Alex

Aorsini Gamer

unread,
Feb 5, 2023, 6:33:42 AM2/5/23
to Android-x86
I have the otg pci option, how do I get adb to work?

youli...@gmail.com

unread,
Feb 8, 2023, 12:37:22 PM2/8/23
to Android-x86
then request kernel config and androidx86 userspace support.

youli...@gmail.com

unread,
Feb 8, 2023, 12:41:16 PM2/8/23
to Android-x86
kernel config

CONFIG_USB_DWC3=m
CONFIG_USB_DWC3_ULPI=y
# CONFIG_USB_DWC3_HOST is not set
CONFIG_USB_DWC3_GADGET=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DEBUG=y
CONFIG_USB_GADGET_VERBOSE=y
CONFIG_USB_GADGET_DEBUG_FILES=y
CONFIG_USB_GADGET_DEBUG_FS=y
CONFIG_USB_GADGET_VBUS_DRAW=500
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
CONFIG_CONFIGFS_FS=y

youli...@gmail.com

unread,
Feb 8, 2023, 12:42:18 PM2/8/23
to Android-x86
androidx86 userspace.
init.android_x86.rc
on boot
    # USB gadget configuration
    setprop sys.usb.configfs 1
    mkdir /config/usb_gadget/g1
    mkdir /config/usb_gadget/g1/strings/0x409
    mkdir /config/usb_gadget/g1/configs/b.1
    mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409
    write /config/usb_gadget/g1/idVendor 0x18d1
    write /config/usb_gadget/g1/idProduct 0x4ee1
    write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
    write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
    write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
    mkdir /config/usb_gadget/g1/functions/ffs.adb
    mkdir /config/usb_gadget/g1/functions/ffs.mtp
    mkdir /config/usb_gadget/g1/functions/ffs.ptp
    mkdir /config/usb_gadget/g1/functions/accessory.gs2
    mkdir /config/usb_gadget/g1/functions/audio_source.gs3
    mkdir /config/usb_gadget/g1/functions/rndis.gs4
    mkdir /config/usb_gadget/g1/functions/midi.gs5
    setprop sys.usb.controller dwc3.3.auto
    mkdir /dev/usb-ffs 0775 shell shell
    mkdir /dev/usb-ffs/adb 0770 shell shell
    mkdir /dev/usb-ffs/mtp 0770 mtp mtp
    mkdir /dev/usb-ffs/ptp 0770 mtp mtp
    mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
    mount functionfs mtp /dev/usb-ffs/mtp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1
    mount functionfs ptp /dev/usb-ffs/ptp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1

Huy Minh Bùi (HMTheBoy154)

unread,
Feb 8, 2023, 1:21:53 PM2/8/23
to Android-x86
so this is what USB Gadget driver is for

Vào lúc 00:41:16 UTC+7 ngày Thứ Năm, 9 tháng 2, 2023, youli...@gmail.com đã viết:

youli...@gmail.com

unread,
Feb 8, 2023, 11:53:25 PM2/8/23
to Android-x86
CONFIG_USB_ROLE_SWITCH=y
CONFIG_USB_ROLES_INTEL_XHCI=m
/sys/class/usb_role/intel_xhci_usb_sw-role-switch/role can switch host and device.

Aorsini Gamer

unread,
Feb 11, 2023, 4:14:23 AM2/11/23
to Android-x86
How do I request kernel configuration and userzone support from androidx86? I mean a terminal or how?

Huy Minh Bùi (HMTheBoy154)

unread,
Feb 12, 2023, 5:02:59 AM2/12/23
to Android-x86
I saw Celadon have     "mount configfs none /config"

Do I have to put it in ?
Vào lúc 00:42:18 UTC+7 ngày Thứ Năm, 9 tháng 2, 2023, youli...@gmail.com đã viết:

youli...@gmail.com

unread,
Feb 12, 2023, 11:28:17 AM2/12/23
to Android-x86
in the old android init.rc
    mount configfs none /config
    chmod 0775 /config/sdcardfs
    chown system package_info /config/sdcardfs
Reply all
Reply to author
Forward
0 new messages