USB Ethernet interface in virtual Ubuntu 18.04 disabled after every reboot

Hen*_*rik 3 usb networking ethernet virtualbox-networking

(tl;dr) 我的 USB 3.0 以太网适配器已找到 (lsusb),但在 Ubuntu 18.04 beta 2 中每次重新启动后以太网接口都会被禁用,即使我使用以下命令启用它ip or ifconfig command (funny: it's found during installation and even connects, via dhcp, but is disabled after first reboot).

Long version: I am trying to get a DELOCK 62966 USB 3.0 > 4x Ethernet Adapter to work in a Ubuntu machine. Important: Ubuntu runs as VM in the latest Virtualbox, with a USB filter allowing access from the VM. It works well in a parallel running Windows VM. I also tried a different adapter (Lenovo Thinkpad USB 3.0 Ethernet adapter).

sudo lshw -C network给出以下结果:

*-network DISABLED
description: Ethernet interface
physical id: 1
logical name: enx00e04c6801e1
[...]
Run Code Online (Sandbox Code Playgroud)

我尝试了过去10年多个论坛的解决方案,例如:

sudo ip link set enx00e04c6801e1 up
sudo ip l s dev enx00e04c6801e1 up
Run Code Online (Sandbox Code Playgroud)

这导致sudo lshw -C network不再显示“已禁用”,但是ifconfig shows that the interface does not have a valid IP. So I used sudo dhclient enx00e04c6801e1. Then, finally it showed a valid IP address.

仅供参考,我的/etc/network/interfaces完全是空的。我尝试添加以下行,但它们没有任何区别(我尝试/重新启动多次)

auto lo
iface lo inet loopback
auto enx00e04c6801e1
iface enx00e04c6801e1 inet dhcp
Run Code Online (Sandbox Code Playgroud)

Do I have to add all these steps in a script which starts at boot (if so how?) or is there a simple solution to tell ubuntu to use the adapter every time I boot?

感谢您的帮助!!

更新 1:这是结果cat /etc/netplan/*.yaml

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        enp0s3:
            addresses: []
            dhcp4: true
    version: 2
Run Code Online (Sandbox Code Playgroud)

-> 意味着我还需要添加 enx... ?

小智 6

根据错误报告,解决方案是将缺少的配置文件(/etc/NetworkManager/conf.d/10-globally-managed-devices.conf)添加到NetworkManager,然后重新启动。

sudo touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
sudo reboot
Run Code Online (Sandbox Code Playgroud)