错误!尝试在 WSL2 上安装 usb_network_gate 时找不到内核 5.8.0-rc3-microsoft-standard 的内核标头

错误!尝试在 WSL2 上安装 usb_network_gate 时找不到内核 5.8.0-rc3-microsoft-standard 的内核标头

我正在尝试在 WSL2 上的 ubuntu 20.04 上安装 USB Network Gate,并安装此内核版本:

root@DESKTOP-N9UN2H3:~/Desktop# uname -a
Linux DESKTOP-N9UN2H3 5.8.0-rc3-microsoft-standard #2 SMP Tue Jun 30 14:38:02 CEST 2020 x86_64 x86_64 x86_64 GNU/Linux

不幸的是,它以我不知道如何修复的错误结束:

错误!找不到内核 5.8.0-rc3-microsoft-standard 的内核头文件

root@DESKTOP-N9UN2H3:~/Desktop# dpkg -i usb_network_gate_x64.deb
(Reading database ... 352800 files and directories currently installed.)
Preparing to unpack usb_network_gate_x64.deb ...
Unpacking eveusb (9.1.0) ...
dpkg: dependency problems prevent configuration of eveusb:
eveusb depends on libqt4-dbus (>= 4.8.1); however:
Package libqt4-dbus is not installed.
eveusb depends on libqt4-svg (>= 4.8.1); however:
Package libqt4-svg is not installed.

dpkg: error processing package eveusb (--install):
dependency problems - leaving unconfigured
Processing triggers for systemd (245.4-4ubuntu3.2) ...
Errors were encountered while processing:
eveusb

root@DESKTOP-N9UN2H3:~/Desktop# apt install libqt4-dbus
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
eveusb : Depends: libqt4-svg (>= 4.8.1) but it is not going to be installed
libqt4-dbus : Depends: qdbus (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

root@DESKTOP-N9UN2H3:~/Desktop# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libfprint-2-tod1 libjpeg62 libllvm9:i386 libtirpc-common libtirpc3
linux-headers-5.4.0-39 linux-headers-5.4.0-39-generic
linux-image-5.4.0-39-generic linux-modules-5.4.0-39-generic
linux-modules-extra-5.4.0-39-generic
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
libqt4-dbus libqt4-svg qdbus
The following NEW packages will be installed:
libqt4-dbus libqt4-svg qdbus
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 387 kB of archives.
After this operation, 947 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/rock-core/qt4/ubuntu focal/main amd64 qdbus amd64 5:4.8.7+dfsg-7ubuntu4rock7 [99.9 kB]
Get:2 http://ppa.launchpad.net/rock-core/qt4/ubuntu focal/main amd64 libqt4-dbus amd64 5:4.8.7+dfsg-7ubuntu4rock7 [76.0 kB]
Get:3 http://ppa.launchpad.net/rock-core/qt4/ubuntu focal/main amd64 libqt4-svg amd64 5:4.8.7+dfsg-7ubuntu4rock7 [211 kB]
Fetched 387 kB in 1s (502 kB/s)
Selecting previously unselected package qdbus.
(Reading database ... 352926 files and directories currently installed.)
Preparing to unpack .../qdbus_5%3a4.8.7+dfsg-7ubuntu4rock7_amd64.deb ...
Unpacking qdbus (5:4.8.7+dfsg-7ubuntu4rock7) ...
Selecting previously unselected package libqt4-dbus:amd64.
Preparing to unpack .../libqt4-dbus_5%3a4.8.7+dfsg-7ubuntu4rock7_amd64.deb ...
Unpacking libqt4-dbus:amd64 (5:4.8.7+dfsg-7ubuntu4rock7) ...
Selecting previously unselected package libqt4-svg:amd64.
Preparing to unpack .../libqt4-svg_5%3a4.8.7+dfsg-7ubuntu4rock7_amd64.deb ...
Unpacking libqt4-svg:amd64 (5:4.8.7+dfsg-7ubuntu4rock7) ...
Setting up libqt4-svg:amd64 (5:4.8.7+dfsg-7ubuntu4rock7) ...
Setting up qdbus (5:4.8.7+dfsg-7ubuntu4rock7) ...
Setting up libqt4-dbus:amd64 (5:4.8.7+dfsg-7ubuntu4rock7) ...
Setting up eveusb (9.1.0) ...
/var/lib/dpkg/info/eveusb.postinst configure
Unable to identify user running this installation.
Please add users manually to the 'eveusb' group so they can control the daemon u
sing GUI and console utilities.
Examples:
gpasswd -a eveusb
groupmod --add-user eveusb # SUSE
usermod --append --groups eveusb
usermod --add-to-group eveusb # SUSE
Synchronizing state of eveusb.service with SysV service script with /lib/systemd
/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable eveusb

Creating symlink /var/lib/dkms/eveusb/1.0.0/source ->
/usr/src/eveusb-1.0.0

DKMS: add completed.
Error! Your kernel headers for kernel 5.8.0-rc3-microsoft-standard cannot be fou
nd.
Please install the linux-headers-5.8.0-rc3-microsoft-standard package,
or use the --kernelsourcedir option to tell DKMS where it's located
Traceback (most recent call last):
File "/var/lib/dpkg/info/eveusb.postinst", line 549, in
make_all()
File "/var/lib/dpkg/info/eveusb.postinst", line 528, in make_all
process_module(True)
File "/var/lib/dpkg/info/eveusb.postinst", line 268, in process_module
check_call([dkms, action] + mod_ver)
File "/var/lib/dpkg/info/eveusb.postinst", line 30, in check_call
subprocess.check_call(cmd)
File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['dkms', 'build', '-m', 'eveusb', '-v',
'1.0.0']' returned non-zero exit status 1
dpkg: error processing package eveusb (--configure):
installed eveusb package post-installation script subprocess returned error exi
t status 1
/bin/df: /proc/sys/fs/binfmt_misc: Too many levels of symbolic links
Processing t
riggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Processing triggers for systemd (245.4-4ubuntu3.2) ...
Errors were encountered while processing:
eveusb
E: Sub-process /usr/bin/dpkg returned an error code (1)

root@DESKTOP-N9UN2H3:~/Desktop# dpkg -i usb_network_gate_x64.deb
(Reading database ... 352951 files and directories currently installed.)
Preparing to unpack usb_network_gate_x64.deb ...
/var/lib/dpkg/info/eveusb.prerm upgrade 9.1.0
Synchronizing state of eveusb.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable eveusb
Deleting module version: 1.0.0
completely from the DKMS tree.

Done.
groupdel: group 'eveusb' does not exist
Unpacking eveusb (9.1.0) over (9.1.0) ...
/var/lib/dpkg/info/eveusb.postrm upgrade 9.1.0
Setting up eveusb (9.1.0) ...
/var/lib/dpkg/info/eveusb.postinst configure
Unable to identify user running this installation.
Please add users manually to the 'eveusb' group so they can control the daemon using GUI and console utilities.
Examples:
gpasswd -a eveusb
groupmod --add-user eveusb # SUSE
usermod --append --groups eveusb
usermod --add-to-group eveusb # SUSE
Synchronizing state of eveusb.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable eveusb

Creating symlink /var/lib/dkms/eveusb/1.0.0/source ->
/usr/src/eveusb-1.0.0

DKMS: add completed.
Error! Your kernel headers for kernel 5.8.0-rc3-microsoft-standard cannot be found.
Please install the linux-headers-5.8.0-rc3-microsoft-standard package,
or use the --kernelsourcedir option to tell DKMS where it's located
Traceback (most recent call last):
File "/var/lib/dpkg/info/eveusb.postinst", line 549, in
make_all()
File "/var/lib/dpkg/info/eveusb.postinst", line 528, in make_all
process_module(True)
File "/var/lib/dpkg/info/eveusb.postinst", line 268, in process_module
check_call([dkms, action] + mod_ver)
File "/var/lib/dpkg/info/eveusb.postinst", line 30, in check_call
subprocess.check_call(cmd)
File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['dkms', 'build', '-m', 'eveusb', '-v', '1.0.0']' returned non-zero exit status 1
dpkg: error processing package eveusb (--install):
installed eveusb package post-installation script subprocess returned error exit status 1
Processing triggers for systemd (245.4-4ubuntu3.2) ...
Errors were encountered while processing:
eveusb

root@DESKTOP-N9UN2H3:~/Desktop# uname -a
Linux DESKTOP-N9UN2H3 5.8.0-rc3-microsoft-standard #2 SMP Tue Jun 30 14:38:02 CEST 2020 x86_64 x86_64 x86_64 GNU/Linux

root@DESKTOP-N9UN2H3:~/Desktop# apt install linux-headers-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-generic is already the newest version (5.4.0.45.49).
linux-headers-generic set to manually installed.
The following packages were automatically installed and are no longer required:
libfprint-2-tod1 libjpeg62 libllvm9:i386 libtirpc-common libtirpc3
linux-headers-5.4.0-39 linux-headers-5.4.0-39-generic
linux-image-5.4.0-39-generic linux-modules-5.4.0-39-generic
linux-modules-extra-5.4.0-39-generic
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up eveusb (9.1.0) ...
/var/lib/dpkg/info/eveusb.postinst configure
Unable to identify user running this installation.
Please add users manually to the 'eveusb' group so they can control the daemon u
sing GUI and console utilities.
Examples:
gpasswd -a eveusb
groupmod --add-user eveusb # SUSE
usermod --append --groups eveusb
usermod --add-to-group eveusb # SUSE
Synchronizing state of eveusb.service with SysV service script with /lib/systemd
/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable eveusb
Deleting module version: 1.0.0
completely from the DKMS tree.

Done.

Creating symlink /var/lib/dkms/eveusb/1.0.0/source ->
/usr/src/eveusb-1.0.0

DKMS: add completed.
Error! Your kernel headers for kernel 5.8.0-rc3-microsoft-standard cannot be fou
nd.
Please install the linux-headers-5.8.0-rc3-microsoft-standard package,
or use the --kernelsourcedir option to tell DKMS where it's located
Traceback (most recent call last):
File "/var/lib/dpkg/info/eveusb.postinst", line 549, in
make_all()
File "/var/lib/dpkg/info/eveusb.postinst", line 528, in make_all
process_module(True)
File "/var/lib/dpkg/info/eveusb.postinst", line 268, in process_module
check_call([dkms, action] + mod_ver)
File "/var/lib/dpkg/info/eveusb.postinst", line 30, in check_call
subprocess.check_call(cmd)
File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['dkms', 'build', '-m', 'eveusb', '-v',
'1.0.0']' returned non-zero exit status 1
dpkg: error processing package eveusb (--configure):
installed eveusb package post-installation script subprocess returned error exi
t status 1
Errors were encountered while processing:
eveusb
E: Sub-process /usr/bin/dpkg returned an error code (1)

root@DESKTOP-N9UN2H3:~/Desktop# sudo apt-get install linux-headers-$(uname -r)

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-5.8.0-rc3-microsoft-standard
E: Couldn't find any package by glob 'linux-headers-5.8.0-rc3-microsoft-standard'
E: Couldn't find any package by regex 'linux-headers-5.8.0-rc3-microsoft-standard'

有什么帮助吗?

答案1

USB Network Gate 显然需要某种内核扩展。在标准 Debian 或 Ubuntu 安装中,可以通过提供源并使用 DKMS 系统为适当的内核构建内核模块来添加此类扩展。然而,这样做需要适当内核的内核头,这些头通常由发行版打包在包中提供。

然而,对于 WSL,使用的内核不是发行版提供的内核,而是 Microsoft 提供的特定内核。虽然内核确实支持模块,但它不会被编译为使用任何模块,因此,微软不会为任何内核头提供包(尽管源代码可以在 GitHub 上找到)。您的发行版不负责 Microsoft 的内核,因此他们也不为其提供任何标头。

因此,实际上不可能为 WSL 构建内核模块。如果你想使用需要内核模块的东西,你将需要一个真正的 Linux 系统,无论是在虚拟机中还是在真实的硬件上。

相关内容