Nat Network not working for CentOS 7 guest

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
mc5000
Posts: 1
Joined: 9. Jan 2023, 01:38

Nat Network not working for CentOS 7 guest

Post by mc5000 »

Hello,

I've installed VirtualBox 7.0.2 on my MacOS Ventura 13.1 (Intel processor) and I tried creating a new CentOS 7 VM (minimal install) with 2 network adapters. The 1st adapter is of type 'Nat Network', and the second of type 'Host-only Network'. I've previously created new instances of each of those types of networking with most of the default settings, with an exception for the Nat Network, where I changed the default IPv4 prefix from 10.0.2.0/24 to 10.1.2.0/24. DHCP is enabled on Nat Network. I have no other VMs previously created and the created networks have never been used before by any other VM.

I want regular internet access inside the VM and also to be able to connect to it from the host via SSH.

I installed the CentOS VM (Minimum Install) from an ISO image and enabled both the network interfaces and also configured them to connect automatically (before the CentOS installation).

The issue is that I don't have internet access within the CentOS 7 guest, but I can SSH into it from the host OS. Both network interfaces have IPs acquired, so it's not a DHCP issue. I don't have any other leftover DHCP server configured by VB. I'm not a network guru, but I think that the Nat Network configuration should work out of the box, just as NAT, but it's not the case for my particular setup. I've searched the forums for a similar problem, but couldn't find any.

One more thing: if I stop the VM and I change the configuration of the VM, of the 1st network adapter, from NAT Network to NAT, then everything works fine.
I've also replicated the problem with a Ubuntu Desktop 22.04.1 guest, so it's probably not a CentOS issue. I'm guessing the issue lies with the VirtualBox app for MacOS somehow.

I want to preemptively say that I need a NAT Network and not a simple NAT for my VM, because I will use the same NAT Network for multiple VMs.

My setup is simple to replicate by anyone with an Intel MacOS. I can provide any additional setup information, if requested.

Thank you in advance for any help!
Post Reply