Virtual machine 警告:字符device/dev/vboxdrv不存在

Virtual machine 警告:字符device/dev/vboxdrv不存在,virtual-machine,virtualbox,windows-subsystem-for-linux,ubuntu-20.04,Virtual Machine,Virtualbox,Windows Subsystem For Linux,Ubuntu 20.04,我正在使用WSL2forMicrosoftWindows10(Ubuntu20.04WSL),当我试图编译代码并运行Virtualbox进程时,使用ISO my code Make,我得到了一个非常奇怪的错误 osdev@DESKTOP-2VDARGU:/mnt/c/Users/(hiding name)/Desktop/MyOS$ WARNING: The character device /dev/vboxdrv does not exist. Please install

我正在使用WSL2forMicrosoftWindows10(Ubuntu20.04WSL),当我试图编译代码并运行Virtualbox进程时,使用ISO my code Make,我得到了一个非常奇怪的错误

osdev@DESKTOP-2VDARGU:/mnt/c/Users/(hiding name)/Desktop/MyOS$ WARNING: The character device /dev/vboxdrv does not exist.
         Please install the virtualbox-dkms package and the appropriate
         headers, most likely linux-headers-standard.

         You will not be able to start VMs until this problem is fixed.
Qt WARNING: could not connect to display
Qt FATAL: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
我什么都试过了。我安装了这么多的头文件,安装了virtualbox dkms包,重新配置了它,等等。我不明白这为什么行不通。如果我能得到一些帮助,我将非常感激

如果需要启动VM的进程的代码,请执行以下操作:

run: mykernel.iso
    (killall VirtualBox && sleep 1) || true
    VirtualBox --startvm 'My Operating System' &

install: mykernel.bin
    sudo cp $< /boot/mykernel.bin
编辑2:重建virtualbox dkms的输出:

-------- Uninstall Beginning --------
Module:  virtualbox
Version: 6.1.10
Kernel:  5.4.0-53-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.4.0-53-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.4.0-53-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.4.0-53-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.

------------------------------
Deleting module version: 6.1.10
completely from the DKMS tree.
------------------------------
Done.
Loading new virtualbox-6.1.10 DKMS files...
It is likely that 4.19.128-microsoft-standard belongs to a chroot's host
Building for 5.4.0-53-generic
Building initial module for 5.4.0-53-generic
Done.

vboxdrv.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-53-generic/updates/dkms/

vboxnetadp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-53-generic/updates/dkms/

vboxnetflt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-53-generic/updates/dkms/

depmod...

DKMS: install completed.
invoke-rc.d: could not determine current runlevel

您正试图在WSL2(它本身就是一个Hyper-V虚拟机)下运行Virtualbox?呃,为什么??无论如何,试着使用root
modprobe vboxdrv
,然后查看
dmesg
输出的末尾,它吐出了什么。因此它实际上没有构建驱动程序。下一站:重新配置virtualbox dkms包的输出,以及为什么它没有为4.19.128-microsoft-standard构建。(注意:我认为这一切都行不通,你为什么还要这样做?@dratenik检查编辑
-------- Uninstall Beginning --------
Module:  virtualbox
Version: 6.1.10
Kernel:  5.4.0-53-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.4.0-53-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.4.0-53-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.4.0-53-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.

------------------------------
Deleting module version: 6.1.10
completely from the DKMS tree.
------------------------------
Done.
Loading new virtualbox-6.1.10 DKMS files...
It is likely that 4.19.128-microsoft-standard belongs to a chroot's host
Building for 5.4.0-53-generic
Building initial module for 5.4.0-53-generic
Done.

vboxdrv.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-53-generic/updates/dkms/

vboxnetadp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-53-generic/updates/dkms/

vboxnetflt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-53-generic/updates/dkms/

depmod...

DKMS: install completed.
invoke-rc.d: could not determine current runlevel