📌  相关文章
📜  vboxnetadpctl:添加新界面时出错:无法打开 dev vboxnetctl:没有这样的文件或目录. (1)

📅  最后修改于: 2023-12-03 15:05:48.956000             🧑  作者: Mango

vboxnetadpctl: Adding new interface error

Introduction:

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.

Explanation:

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.

Solution:

To resolve this error, the following steps can be performed:

  1. Ensure that VirtualBox is properly installed and configured on your system. You can download the latest version of VirtualBox from the official website: https://www.virtualbox.org/.
  2. Verify that the vboxdrv kernel module is loaded by running the following command: sudo modprobe vboxdrv
  3. If the vboxdrv module is not loaded, try restarting the virtualbox.service to reload the kernel module: sudo service virtualbox restart
  4. Verify that the vboxnetctl device file exists by running the following command: ls -l /dev/vboxnetctl
  5. If the 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.

Code snippet:
# 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.