📅  最后修改于: 2023-12-03 15:05:48.956000             🧑  作者: Mango
In VirtualBox, you may encounter the following error message when trying to add a new interface:
vboxnetadpctl: Adding new interface error: Could not open /dev/vboxnetctl: No such file or directory.
This error message can occur when attempting to add a host-only or NAT network adapter to a virtual machine.
This error message indicates that the VirtualBox service is unable to locate the vboxnetctl
device file, which is needed to create or manage virtual network interfaces. The most common cause for this error is a missing or corrupted installation of VirtualBox.
To resolve this error, the following steps can be performed:
vboxdrv
kernel module is loaded by running the following command: sudo modprobe vboxdrv
vboxdrv
module is not loaded, try restarting the virtualbox.service
to reload the kernel module: sudo service virtualbox restart
vboxnetctl
device file exists by running the following command: ls -l /dev/vboxnetctl
vboxnetctl
device file is missing, try re-installing VirtualBox using the package manager or by downloading the latest version from the official website. Once the above steps have been completed, you should be able to add new network interfaces without encountering the vboxnetadpctl
error message.
# Check if vboxdrv is loaded
$ lsmod | grep vboxdrv
# If vboxdrv is not loaded, load it manually
$ sudo modprobe vboxdrv
# Restart virtualbox service to reload kernel module
$ sudo service virtualbox restart
# Check vboxnetctl file
$ ls -l /dev/vboxnetctl
# Re-install VirtualBox
$ sudo apt-get remove virtualbox
$ sudo apt-get install virtualbox
Remember to execute the above commands as administrator or with sudo
.