Virtualbox - Activation of Network connection failed

Discussions about using Linux guests in VirtualBox.
Rearden
Posts: 5
Joined: 8. Aug 2018, 00:28

Virtualbox - Activation of Network connection failed

Post by Rearden »

Hi,

I am currently setting up a pen-test environment for practice on a new laptop. I have done this many times before but this time I have run into an error that has stumped me.

My Kali box and metasploitable2 box both are not assigned IP addresses from the host only adapter DHCP server.

On my kali box I get a notification that says "activation of network connection failed" a few seconds after boot up

I have gone through a lot of the standard troubleshooting recommendations from the google searches ive done but most don't focus on this specific error because when I bridge/NAT the boxes they do just fine. It seems to be a host only error.

I have tried removing all host only adapters and creating new ones but nothing happens. I feel like this is a virtualbox error not a linux process error within the machine. But idk that is why i'm here to see if any of you all have run into anything similar.

Thank you for taking the time to read this post, have a wonderful day!
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Virtualbox - Activation of Network connection failed

Post by socratis »

Rearden wrote:are not assigned IP addresses from the host only adapter DHCP server.
Have you enabled the DHCP server for the HostOnly interface on your host? What's the output of the commands:
  • 
    VBoxManage list hostonlyifs
    VBoxManage list dhcpservers
    
We're also going to need to see a VM log from a complete VM run:
  • Start the VM from cold-boot (not from a paused or saved state) / Observe error / Shutdown the VM (force close it if you have to).
  • With the VM completely shut down (not paused or saved), right-click on the VM in the VirtualBox Manager and select "Show Log".
  • Save only the first "VBox.log", ZIP it and attach it to your response. See the "Upload attachment" tab below the reply form.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Rearden
Posts: 5
Joined: 8. Aug 2018, 00:28

Re: Virtualbox - Activation of Network connection failed

Post by Rearden »

Hi socratis thank you for taking the time to reply.

How do I run the VBoxManage commands? Do I run that in the vm or on the host cmd line somewhere?

As for the log for the VM facing the rror I have attached the zipped file.
Attachments
KALI-2018-08-08-08-08-57.zip
KALI VM with network error
(29.73 KiB) Downloaded 178 times
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Virtualbox - Activation of Network connection failed

Post by socratis »

Rearden wrote:How do I run the VBoxManage commands? Do I run that in the vm or on the host cmd line somewhere?
You run them on the host. Usually you have to do a:
  • 
    cd "C:\Program Files\Oracle\VirtualBox\"
    VBoxManage list hostonlyifs
    VBoxManage list dhcpservers
Then from your guest, post the output of:
  • 
    nmcli dev show
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Rearden
Posts: 5
Joined: 8. Aug 2018, 00:28

Re: Virtualbox - Activation of Network connection failed

Post by Rearden »

Here you go
Attachments
nmcli
nmcli
nmcp.JPG (80.57 KiB) Viewed 36499 times
dhcpservers
dhcpservers
dhcpservers.png (14.18 KiB) Viewed 36499 times
hostonlyifs
hostonlyifs
hostonlyifs.PNG (25.28 KiB) Viewed 36499 times
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Virtualbox - Activation of Network connection failed

Post by socratis »

It seems that you've changed the defaults. May I ask why?
Also, your host's HostOnly adapter is not initialized. Go to the HostOnly network manager and set the address manually to 192.168.52.1, subnet mask 255.255.255.0.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Rearden
Posts: 5
Joined: 8. Aug 2018, 00:28

Re: Virtualbox - Activation of Network connection failed

Post by Rearden »

It is different from the default because I removed the default adapter and try to create a new default one with autopopulated setting just to see if that would work.

After taking your advice and changing the network address and mask the box still fails to make any sort of connection to the host network
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Virtualbox - Activation of Network connection failed

Post by socratis »

Rearden wrote:I removed the default adapter and try to create a new default one with autopopulated setting just to see if that would work.
Well apparently what you did (or didn't) do, doesn't work.
  1. Uninstall VirtualBox. Your VMs are going to be untouched. Reboot.
  2. You may want to clean up your registry and/or filesystem at this point. CCleaner is a freeware utility that could help you. Mind the installation, it comes with "offers" from 3rd parties, known as "bundleware". Also, check out Device Cleanup program that helps you to remove any unused devices from your computer, mainly multiple "Host-Only Adapter #n".
  3. Download (if you haven't already) the latest VirtualBox and its matching ExtPack. Store them in a common location, i.e. not on "Desktop", or "Documents", but to "Public/Downloads" for example.
  4. Uninstall (don't simply disable) all 3rd party antivirus. If you're afraid about your computer being vulnerable, pull the Ethernet plug, disconnect your WiFi, don't go browsing around.
  5. Locate the downloaded file in Windows Explorer. Right-click on the installer and select "Run-as-Administrator", even if you are the administrator. At the end of the installation, choose to "Start Oracle VM VirtualBox". Do not worry if your VMs do not show up.
  6. If you're going to install the ExtPack, go to File » Preferences » Extensions. Click on the icon with the orange, down-pointing arrow on the right. Select the ExtPack from the previous steps.
  7. Quit VirtualBox. Re-start VirtualBox as you would normally, i.e. from the Desktop shortcut or the Start menu.
  8. Update the Guest Additions (GAs) in your guest(s), if the GAs are available for a specific guest.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Rearden
Posts: 5
Joined: 8. Aug 2018, 00:28

Re: Virtualbox - Activation of Network connection failed

Post by Rearden »

So after following you recommendation it still wont activate the host only network. I did however make a very strange discovery. if I start the VM's in bridged mode and then while they are running I switch it to host only it will work and I can ping each of them. This lasts for a short bit until the Kali box errors out and loses the connection to the network manager (wired is now turned off due to unable to activate it)
Shrav
Posts: 3
Joined: 31. Jul 2020, 05:31

Re: Virtualbox - Activation of Network connection failed

Post by Shrav »

Every time i restart my laptop I am getting this Error "Activation of Network connection failed " ,As per the procedure Shared in the thread, I am uninstalling the Extension pack and then Uninstalling the Virtual box and after restarting my PC, Installing the Virtual box and Extension pack, then only Ethernet connectivity is up, Every time i have to do this if i restart my Laptop. Can you please check and suggest what can be done.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Virtualbox - Activation of Network connection failed

Post by scottgus1 »

Shrav, please do the tests that Socratis asked for here: viewtopic.php?f=3&t=89006#p426824

Also, please provide the guest's .vbox file and vbox.log:

Start the guest from full power off, not save-state. Run until you see the problem happen, then shut down the guest from within the guest OS if possible. If not possible, close the Virtualbox window for the guest with the Power Off option set.

Please right-click the guest in the main Virtualbox window's guest list, choose Show Log. Save the far left tab's log, zip the log file, and post the zip file, using the forum's Upload Attachment tab.

Please right-click the guest in the main Virtualbox window's guest list, choose "Show in Explorer/Finder/File Manager". In the window that opens, zip the guest's .vbox file, and post the zip file, using the forum's Upload Attachment tab.
Shrav
Posts: 3
Joined: 31. Jul 2020, 05:31

Re: Virtualbox - Activation of Network connection failed

Post by Shrav »

Hi scottgus1, I have attached the required files

//*
C:\Program Files\Oracle\VirtualBox>VBoxManage list hostonlyifs
Name: VirtualBox Host-Only Ethernet Adapter
GUID: 1a6e085b-e43a-42db-8557-c5a1cbd229f0
DHCP: Disabled
IPAddress: 192.168.56.1
NetworkMask: 255.255.255.0
IPV6Address: fe80::580:f99d:7d8a:cb64
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:3e
MediumType: Ethernet
Wireless: No
Status: Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter


C:\Program Files\Oracle\VirtualBox>VBoxManage list dhcpservers
NetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter
Dhcpd IP: 192.168.56.100
LowerIPAddress: 192.168.56.101
UpperIPAddress: 192.168.56.254
NetworkMask: 255.255.255.0
Enabled: Yes
Global Configuration:
minLeaseTime: default
defaultLeaseTime: default
maxLeaseTime: default
Forced options: None
Suppressed opts.: None
1/legacy: 255.255.255.0
Groups: None
Individual Configs: None

C:\Program Files\Oracle\VirtualBox>
*//
Attachments
nmcli output
nmcli output
nmcli dev show.jpg (70.17 KiB) Viewed 28286 times
Rhel8_Enterpris-2020-08-01-07-42-30.zip
Vbox.log file
(32.22 KiB) Downloaded 23 times
Rhel8_Enterpris.zip
.Vbox File
(1.7 KiB) Downloaded 18 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Virtualbox - Activation of Network connection failed

Post by scottgus1 »

I don't see anything egregious about network in the log. Two things I do see, your host memory is extremely tight during this run, might want to shut down an app or two or get more memory. Also all four host physical cores are slated for guest usage, which will slow down the guest unless there's special parallel processing code running in the guest that will use all four cores. If the guest does so, the host will go unstable. (hyperthreads don't count for Virtualbox)

Your guest is Bridged to a Wi-fi adapter:
<Network>
<Adapter slot="0" enabled="true" MACAddress="080027EBDFC0" promiscuousModePolicy="AllowAll" type="82540EM">
<DisabledModes>
<InternalNetwork name="intnet"/>
<NATNetwork name="NatNetwork"/>
</DisabledModes>
<BridgedInterface name="Intel(R) Dual Band Wireless-AC 8265"/>
</Adapter>
</Network>
Bridged does not always work with Wi-Fi, due to limitations in the Wi-fi protocol. Virtualbox Networks: In Pictures: Bridged Adapter
Your guest's enp0s3's adapter is not getting an IP address. Try wired Ethernet.
Shrav
Posts: 3
Joined: 31. Jul 2020, 05:31

Re: Virtualbox - Activation of Network connection failed

Post by Shrav »

Hi scottgus1, Thanks issue is resolved after assigning static route, Thanks for your valuble time supporting me.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Virtualbox - Activation of Network connection failed

Post by scottgus1 »

Thanks for letting us know, glad you're up and running!

Just curious, was that a real static route, or a static IP address in the guest?
Post Reply