Unable to ping default gateway and no internet connection

Discussions related to using VirtualBox on Linux hosts.
kkaito
Posts: 7
Joined: 5. Nov 2020, 22:28

Re: Unable to ping default gateway and no internet connection

Post by kkaito »

fth0 wrote:I've just noticed something that was hiding in your information from the beginning: ;)

The Kali Linux guest reports a different MAC address for eth0 each time (mine doesn't, BTW). Since your .vbox files showed that you've configured MAC addresses with the "VirtualBox" OUI (08:00:27), I'd guess that Kali Linux uses randomized MAC addresses for privacy reasons. Try to prevent this and see if your problem persists.
I've written @reboot macchanger -rb eth0 in my root crontab and once i deleted it and reboot, everything seems working again.
But for my Parrot OS, i'm pretty sure i did not add this line to my crontab and it seems working again as well. I cannot tell why i faced this issue.
Anyway, thanks for your help! :)
BTW I really want to use random mac address every time i reboot, is there any way to do it and will not cause the same issue.
I'm sure this line in crontab is correct without any mistake as i did the same thing on my ubuntu host.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Unable to ping default gateway and no internet connection

Post by fth0 »

kkaito wrote:BTW I really want to use random mac address every time i reboot, is there any way to do it and will not cause the same issue.
I cannot give you a definite answer on that, but I'd guess that the VirtualBox source code would have to be changed for that. If this would be a simple bug fix or rather a design change, I don't know. You could search the Bugtracker and create a ticket if there isn't one already.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Unable to ping default gateway and no internet connection

Post by scottgus1 »

kkaito wrote:But for my Parrot OS, i'm pretty sure i did not add this line to my crontab and it seems working again as well. I cannot tell why i faced this issue.
I suspect Virtualbox might not expect or be programmed to allow a guest OS to change what Virtualbox says the MAC address should be. If the inside-the-guest command bunged the connection to the NAT network inside Virtualbox's code, then the whole NAT network might go down, affecting Parrot too.
kkaito wrote:I really want to use random mac address every time i reboot
You will need a startup script on your host PC to start the guest, but this might help, and stick within Virtualbox's known methods of assigning MAC addresses:

vboxmanage modifyvm "vm name" --macaddress<1-N> auto|<mac>
vboxmanage startvm "vm name"


<1-N> and <mac> should just be the adapter number by tab that is connected to the NAT network, and the MAC address, not including the <>'s.

When you want to reboot the guest and change the MAC address, shut down the guest instead and restart from the script.
Post Reply