我在笔记本电脑上安装了 Ubuntu 18.04 (gnome)(与 Windows 10 双启动)。我无法将手机(Moto G5S plus)绑定到笔记本电脑(其他一些手机可以使用,但并非所有手机都可以)。手机上的网络共享已打开,并且可以与其他笔记本电脑(安装了 Ubuntu 16.04 至 18.04)配合使用。我在笔记本电脑上尝试了 ubuntu 16.04 实时启动 usb。网络共享在那里有效。
想知道这是驱动程序的问题还是其他问题以及如何解决,那就好了。
我已将尝试进行网络共享后添加的 dmesg 中的行包括在内。
[ 273.496487] usb 1-1: New USB device found, idVendor=22b8,
idProduct=2e82
[ 273.496492] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 273.496496] usb 1-1: Product: Moto G (5S) Plus
[ 273.496499] usb 1-1: Manufacturer: motorola
[ 273.496502] usb 1-1: SerialNumber: ZY3227KD5X
[ 308.485368] usb 1-1: USB disconnect, device number 8
[ 308.912138] usb 1-1: new high-speed USB device number 9 using xhci_hcd
[ 309.061446] usb 1-1: New USB device found, idVendor=22b8, idProduct=2e24
[ 309.061448] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 309.061450] usb 1-1: Product: Moto G (5S) Plus
[ 309.061451] usb 1-1: Manufacturer: motorola
[ 309.061452] usb 1-1: SerialNumber: ZY3227KD5X
[ 309.098517] usbcore: registered new interface driver cdc_ether
[ 309.101645] rndis_host 1-1:1.0 usb0: register 'rndis_host' at usb-0000:00:14.0-1, RNDIS device, a2:ff:40:66:ec:f6
[ 309.101716] usbcore: registered new interface driver rndis_host
[ 309.112511] rndis_host 1-1:1.0 enp0s20f0u1: renamed from usb0
[ 309.154818] IPv6: ADDRCONF(NETDEV_UP): enp0s20f0u1: link is not ready
[ 309.224187] rndis_host 1-1:1.0 enp0s20f0u1: unregister 'rndis_host' usb-0000:00:14.0-1, RNDIS device
[ 309.252183] rndis_host 1-1:1.0 usb0: register 'rndis_host' at usb-0000:00:14.0-1, RNDIS device, b2:4f:9e:67:b6:21
[ 309.255446] rndis_host 1-1:1.0 enp0s20f0u1: renamed from usb0
[ 364.510528] ------------[ cut here ]------------
[ 364.510534] NETDEV WATCHDOG: enp0s20f0u1 (rndis_host): transmit queue 0 timed out
[ 364.510567] WARNING: CPU: 5 PID: 0 at /build/linux-lZKWha/linux-4.15.0/net/sched/sch_generic.c:323 dev_watchdog+0x221/0x230
[ 364.510569] Modules linked in: rndis_host cdc_ether usbnet ccm thunderbolt rfcomm snd_hda_codec_hdmi nouveau bnep ttm snd_hda_codec_realtek snd_hda_codec_generic nls_iso8859_1 hid_multitouch dell_smbios_wmi dell_wmi mxm_wmi wmi_bmof intel_wmi_thunderbolt dell_wmi_descriptor arc4 snd_hda_intel dell_laptop dell_smbios_smm snd_hda_codec dell_smbios snd_hda_core intel_rapl dcdbas snd_hwdep x86_pkg_temp_thermal intel_powerclamp coretemp dell_smm_hwmon kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel iwlmvm pcbc mac80211 snd_pcm snd_seq_midi aesni_intel snd_seq_midi_event aes_x86_64 crypto_simd snd_rawmidi glue_helper cryptd intel_cstate intel_rapl_perf snd_seq iwlwifi joydev snd_seq_device uvcvideo snd_timer videobuf2_vmalloc btusb input_leds btrtl videobuf2_memops cfg80211 btbcm
[ 364.510654] serio_raw videobuf2_v4l2 btintel idma64 videobuf2_core snd virt_dma bluetooth soundcore videodev media cdc_acm mei_me intel_lpss_pci processor_thermal_device ecdh_generic mei intel_pch_thermal intel_lpss shpchp intel_soc_dts_iosf int3403_thermal wmi int3402_thermal mac_hid int340x_thermal_zone int3400_thermal intel_hid acpi_pad tpm_crb acpi_thermal_rel sparse_keymap sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 i915 i2c_algo_bit drm_kms_helper syscopyarea nvme sysfillrect sysimgblt psmouse fb_sys_fops r8169 drm nvme_core ahci mii libahci i2c_hid hid video
[ 364.510729] CPU: 5 PID: 0 Comm: swapper/5 Tainted: G W 4.15.0-22-generic #24-Ubuntu
[ 364.510732] Hardware name: Dell Inc. Inspiron 7577/0J8HMF, BIOS 1.4.2 01/25/2018
[ 364.510736] RIP: 0010:dev_watchdog+0x221/0x230
[ 364.510739] RSP: 0018:ffff918ecf543e58 EFLAGS: 00010286
[ 364.510742] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000006
[ 364.510745] RDX: 0000000000000007 RSI: 0000000000000092 RDI: ffff918ecf556490
[ 364.510747] RBP: ffff918ecf543e88 R08: 0000000000000001 R09: 00000000000005bc
[ 364.510749] R10: ffff918ecf543ee0 R11: 0000000000000000 R12: 0000000000000001
[ 364.510751] R13: ffff918eb7082000 R14: ffff918eb7082478 R15: ffff918eb489c680
[ 364.510754] FS: 0000000000000000(0000) GS:ffff918ecf540000(0000) knlGS:0000000000000000
[ 364.510757] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 364.510760] CR2: 00007f1de2989350 CR3: 000000040c80a003 CR4: 00000000003606e0
[ 364.510762] Call Trace:
[ 364.510765] <IRQ>
[ 364.510772] ? dev_deactivate_queue.constprop.33+0x60/0x60
[ 364.510780] call_timer_fn+0x30/0x130
[ 364.510786] run_timer_softirq+0x3fb/0x450
[ 364.510791] ? ktime_get+0x43/0xa0
[ 364.510798] ? lapic_next_deadline+0x26/0x30
[ 364.510805] __do_softirq+0xdf/0x2b2
[ 364.510811] irq_exit+0xb6/0xc0
[ 364.510816] smp_apic_timer_interrupt+0x71/0x130
[ 364.510822] apic_timer_interrupt+0x84/0x90
[ 364.510824] </IRQ>
[ 364.510830] RIP: 0010:cpuidle_enter_state+0xa7/0x2f0
[ 364.510833] RSP: 0018:ffffb92f0196fe68 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff11
[ 364.510837] RAX: ffff918ecf562880 RBX: 00000054de84efcb RCX: 000000000000001f
[ 364.510839] RDX: 00000054de84efcb RSI: fffffffddb4d39f5 RDI: 0000000000000000
[ 364.510841] RBP: ffffb92f0196fea8 R08: 0000000000002e70 R09: 00000000000000c8
[ 364.510843] R10: ffffb92f0196fe38 R11: 000000000000061a R12: ffff918ecf56cb00
[ 364.510845] R13: 0000000000000004 R14: ffffffff98771db8 R15: 0000000000000000
[ 364.510852] ? cpuidle_enter_state+0x97/0x2f0
[ 364.510858] cpuidle_enter+0x17/0x20
[ 364.510864] call_cpuidle+0x23/0x40
[ 364.510868] do_idle+0x18c/0x1f0
[ 364.510874] cpu_startup_entry+0x73/0x80
[ 364.510878] start_secondary+0x1a6/0x200
[ 364.510884] secondary_startup_64+0xa5/0xb0
[ 364.510887] Code: 38 00 49 63 4e e8 eb 92 4c 89 ef c6 05 28 56 d9 00 01 e8 23 38 fd ff 89 d9 48 89 c2 4c 89 ee 48 c7 c7 a0 73 39 98 e8 2f 04 81 ff <0f> 0b eb c0 90 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55
[ 364.510966] ---[ end trace cd363f8d000b7ca4 ]---
以下是 sudo lshw -C network 的结果
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:3b:00.0
logical name: enp59s0
version: 15
serial: 54:bf:64:09:1c:e2
size: 10Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168h-2_0.0.2 02/26/15 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
resources: irq:129 ioport:d000(size=256) memory:dd304000-dd304fff memory:dd300000-dd303fff
*-network
description: Wireless interface
product: Wireless 8265 / 8275
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:3c:00.0
logical name: wlp60s0
version: 78
serial: 34:41:5d:5c:47:0c
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless *-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:3b:00.0
logical name: enp59s0
version: 15
serial: 54:bf:64:09:1c:e2
size: 10Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168h-2_0.0.2 02/26/15 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
resources: irq:129 ioport:d000(size=256) memory:dd304000-dd304fff memory:dd300000-dd303fff
*-network
description: Wireless interface
product: Wireless 8265 / 8275
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:3c:00.0
logical name: wlp60s0
version: 78
serial: 34:41:5d:5c:47:0c
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=4.15.0-22-generic firmware=34.0.1 ip=192.168.1.8 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:138 memory:dd200000-dd201fff
*-network
description: Ethernet interface
physical id: 2
logical name: enp0s20f0u1
serial: 3e:2a:f0:fa:ff:0d
capabilities: ethernet physical
configuration: broadcast=yes driver=rndis_host driverversion=22-Aug-2005 firmware=RNDIS device link=yes multicast=yes
configuration: broadcast=yes driver=iwlwifi driverversion=4.15.0-22-generic firmware=34.0.1 ip=192.168.1.8 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:138 memory:dd200000-dd201fff
*-network
description: Ethernet interface
physical id: 2
logical name: enp0s20f0u1
serial: 3e:2a:f0:fa:ff:0d
capabilities: ethernet physical
configuration: broadcast=yes driver=rndis_host driverversion=22-Aug-2005 firmware=RNDIS device link=yes multicast=yes
答案1
更改 MAC 地址将解决问题。
第一次运行:
ip link show
这将列出网络设备,找到您想要更改的网络设备。
对于上述问题设备是enp0s20f0u1
下一步:
sudo ip link set dev <your_device> down
然后:
sudo ip link set dev <your_device> address <your_new_mac_address>
或者
如果你想生成随机 MAC 地址
通过运行安装 Macchanger
sudo apt install macchanger
更改 MAC 地址
sudo macchanger -r <your_device>
最后:
sudo ip link set dev <your_device> up
答案2
在手机上启用 USB 调试后,我能够使用 USB 网络共享。到目前为止,我使用的任何系统都不需要此功能,因此我不知道为什么需要此功能。
答案3
在 Ubuntu 18.04 上启用 USB 调试(OnePlus 3)对我来说仍然不起作用,但我通过删除网络配置文件中的 MAC 地址解决了这个问题。
这些是我的步骤(启用 USB 网络共享后):
- 打开设置,转到网络设置(在 Ubuntu 18.04 上)
- 在 USB 以太网组配置文件下,打开“自动”配置文件上的设置(齿轮图标)
- 选择“身份”选项卡
- 删除或清除可用的 MAC 地址,留空
- 应用更改
无需启用 USB 调试即可工作
答案4
对我来说 Android 9 Miui 10
1) usb debugging turns on
2) Connect to computer and choose Transfer files (MTP)
3) next turns on usb tethering
让我知道它是否对你有帮助