Error in setting up VirtualBox

I’ve just started with OpenShift for the Absolute Beginners - Hands-on course on Udemy. Here, I followed the steps to setup GitLab. Unfortunately, where I’m getting error in creating host network as guided in Appendix A of of the course.

Error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory.

I’m working on Ubuntu focal.
I need to resolve this error to complete this course. Please help.

Try this sudo modprobe vboxnetadp

Received following error/warning when installed virtual box;

$ sudo gdebi virtualbox-6.1_6.1.26-145957~Ubuntu~eoan_amd64.deb
:
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-generic linux-headers-5.8.0-36-generic
There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.

$ sudo apt install virtualbox-guest-utils virtualbox-guest-dkms
:
Module build for kernel 5.8.0-36-generic was skipped since the
kernel headers for this kernel does not seem to be installed.

Not able to run your suggested command

$ sudo modprobe vboxnetadp
modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/5.8.0-36-generic

try
sudo apt update -y
sudo apt upgrade -y
sudo apt install --reinstall virtualbox-dkms
sudo apt install -f
sudo modprobe vboxnetadp

It didn’t work. Copy pasting the commands where I seen the issue.

$ sudo apt install --reinstall virtualbox-dkms
The following additional packages will be installed:
  dctrl-tools dkms libgsoap-2.8.91 liblzf1 libvncserver1 virtualbox virtualbox-qt
Suggested packages:
  debtags menu vde2 virtualbox-guest-additions-iso
The following packages will be REMOVED:
  virtualbox-6.1
The following NEW packages will be installed:
  dctrl-tools dkms libgsoap-2.8.91 liblzf1 libvncserver1 virtualbox virtualbox-dkms virtualbox-qt
:
Setting up virtualbox-dkms (6.1.22-dfsg-2~ubuntu1.20.04.1) ...
Loading new virtualbox-6.1.22 DKMS files...
Building for 5.8.0-36-generic
Module build for kernel 5.8.0-36-generic was skipped since the
kernel headers for this kernel does not seem to be installed.
Setting up virtualbox (6.1.22-dfsg-2~ubuntu1.20.04.1) ...
invoke-rc.d: policy-rc.d denied execution of restart.
Setting up virtualbox-qt (6.1.22-dfsg-2~ubuntu1.20.04.1) ...

$ sudo modprobe vboxnetadp
modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/5.8.0-36-generic

I found a script on askubuntu which solved my issue. Thanks

@amitgupta , Thanks for sharing. Glad to hear that the issue has been resolved.