Not able to connect with internet after installing virtualbox

I have installed virtual box using below tutorial from stack over flow… eventually i managed to run virtual box with that, but after following this procedure, i am unable to use internet on my fedora 36…

Need help here to get my machine back on internet.

---------------------tutorial I followed----------------------------------------

After some research, I found the solution.

Solution 1 : disable secure boot.

Solution 2 :

1- Install mokutil package

sudo dnf update
sudo dnf install mokutil

2- Create RSA key under new folder.

sudo -i
mkdir /root/signed-modules
cd /root/signed-modules
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VirtualBox/"
chmod 600 MOK.priv

3- This command will ask you to add a password, you need this password after the next reboot.

sudo mokutil --import MOK.der

4- Reboot your system and a blue screen appear, select Enroll MOK → Continue → put the previous password and your system will start.

5- Put the previous cmmands in a script to run it later (after system update)

cd /root/signed-modules
vi sign-virtual-box

Add the following cmd to this script :

#!/bin/bash

for modfile in $(dirname $(modinfo -n vboxdrv))/*.ko; do
  echo "Signing $modfile"
  /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 \
                                /root/signed-modules/MOK.priv \
                                /root/signed-modules/MOK.der "$modfile"
done

Use the below to find signfile if the above fails & edit script accordingly.

find /usr/src -name sign-file

5- Add exec permission and run the script

chmod 700 sign-virtual-box
./sign-virtual-box 

6- Launch VirtualBOx

modprobe vboxdrv

That process can be simplified if you install VirtualBox from the rpmfusion repo.

Secure Boot enabled:

  1. sudo dnf update
  2. sudo dnf install mokutil akmods
  3. sudo kmodgenca
  4. sudo mokutil --import /etc/pki/akmods/certs/public_key.der
    As stated this does ask for a password, which will be needed when you reboot.
  5. reboot
    This boot needs you to “Enroll MOK” → “continue” → “enter the password from step 4” then the system will continue starting.
  6. sudo dnf install VirtualBox
  7. reboot

The first reboot in step 5 loads the key into bios.
The second reboot in step 7 is done after installing virtualbox so the kernel loads the signed module (which is built by akmods when VirtualBox is installed) for use with secure boot enabled.

Installing akmods and installing VirtualBox from rpmfusion sets up an automatic build of the needed kernel modules to support virtual box (and all other modules that are built by akmods) automatically and will use the key generated in step 3 to sign them automatically.

This means that once you have done the 7 steps above you do not need to manually do the compile and signing of the modules when a kernel or package are updated.

Secure Boot disabled:

If you have secure boot disabled steps 3, 4, and 5 are not needed, though the other steps will still install akmods and virtualbox so you do not need to manually build the kernel modules.

1 Like

@computersavvy thanks… but as of now, after that installation i am unable to use internet, i am connected to my wifi network. But not able to browse anything. any suggestions on this?

If you are able to ping the router then try pinging something outside such as 8.8.8.8.
If you can ping an IP address outside your local network then the issue seems to be with DNS

What is the output of ip route show? And ip address show?

Not able to ping outside

Were you able to ping the router at 192.168.0.1? That is your default gateway.

Can you ping your own IP (192.168.0.102)?

Have you tried rebooting your router?

Did you uninstall virtual box then reinstall it as I suggested? Most packages from rpmfusion are tweaked and tested to work properly with fedora.

1 Like

Thanks @computersavvy … i troubleshooted the issue finally with your help…

I was able to ping my own ip, but gateway ip was not pingable. I am not sure what went wrong. But after flushing my router’s mac address filter i am able to connect with internet again. though before flushing the mac address filter on the router, via windows os(dual boot) i was able to access the internet without any glitch.

still i need to flip(enable/disable) mac address filter for my fedora36 to connect with internet every single time…

where as windows machine doesn’t need this work around on dual boot with the same mac address

Where are you doing that? The router or the fedora machine?

That should not need to be done and if it is then something is conflicting that needs fixed.

Yeah, something is conflicting, i am flushing it on the router only.

Re Installed the Fedora 36 fresh… :frowning: as i was not able to troubleshoot it further.

at last happy to have fedora back…