Skip to content

No Internet Access on Kali Linux VM When Both NAT and Host-Only Adapters Are Enabled in VirtualBox #1

@Ashutosh-dash19

Description

@Ashutosh-dash19

Issue: No Internet Access on Kali Linux VM When Both NAT and Host-Only Adapters Are Enabled in VirtualBox

Description

I am running Kali Linux in VirtualBox on a Windows host. I have configured two network adapters for the VM:

  1. Adapter 1 (NAT) — Enabled
  2. Adapter 2 (Host-Only Adapter) — Enabled

Observed Behavior:

  • When only NAT is enabled, the VM has internet access, and ip a (or ifconfig) shows the correct inet IP address for the NAT adapter.
  • When both NAT and Host-Only adapters are enabled:
    • Internet access is lost in the VM.
    • The VM only displays the Host-Only adapter's IP (usually in the 192.168.56.0/24 range).
    • The inet IP for the NAT interface is not shown, and tools like ping, apt, or curl fail due to lack of connectivity.

Steps to Reproduce

  1. Launch VirtualBox and open Settings for the Kali Linux VM.
  2. Under Network, enable two adapters:
    • Adapter 1: Attached to NAT
    • Adapter 2: Attached to Host-Only Adapter
  3. Start the VM and run ip a or ifconfig.
  4. Attempt to access the internet using ping google.com or similar commands.

Expected Behavior

  • The VM should retain internet access through the NAT adapter, even when a Host-Only adapter is also enabled.
  • Both adapters should have their own inet IPs, and NAT should continue to provide a route to the internet.

Actual Behavior

  • Only the Host-Only adapter's IP is active.
  • Internet access is lost.
  • The NAT adapter seems to be inactive or misconfigured when both adapters are enabled.

Environment

  • Host OS: Windows 10 / 11
  • Guest OS: Kali Linux (latest version)
  • Guest Additions Installed: No
  • Network Settings:
    • Adapter 1: NAT
    • Adapter 2: Host-Only Adapter

Additional Notes

  • Once both the adapters are enabled, I can ping the host only adapter ip from my windows machine
  • Disabling the Host-Only adapter restores internet access immediately.
  • This may be a routing or priority issue with how VirtualBox sets up interfaces when multiple adapters are used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions