Problems with host-only networking

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
jernst
Posts: 32
Joined: 20. Sep 2013, 19:31
Primary OS: Other
VBox Version: OSE other
Guest OSses: Arch. UBOS.

Problems with host-only networking

Post by jernst »

My understanding is that host-only networking is supposed to let me connect from the VM to the host and vice versa, such as with ssh or, say, hitting the VM's web server with the browser on the host. Right?

With 6.1.30 on macOS 12.0.1 Monterey, I run a Linux VM. The VM has two virtual network interfaces, one NAT and one Host-only, connecting to vboxnet0.

vboxnet0 has been set up with File / Host Network Manager, Configure Adapter Manually with IP 192.168.56.1, netmask 255.255.255.0 and DHCP server on, with server address 192.168.56.2, and lower bound of 192.168.56.3.

Now, on the VM I get two network interfaces, with IP addresses from 10.0.2.15 (from NAT) and 192.168.56.3 (from Host-only). In the VM I can ping 192.168.56.2, but that's all I can. (curl and ssh to the same IP say "port 80: Protocol not available").

On the Host, I see, with ifconfig:

Code: Select all

vboxnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	ether 0a:00:27:00:00:00 
but nothing resembling a 192.168.56.X IP address. Also, any kind of ping / curl / ssh to 192.168.56.3 gets a "trying ..." but it never connects ... traceroute tells me it is trying to route via the upstream interface, which is not right. traceroute -i vboxnet0 produces

Code: Select all

traceroute: Can't find interface vboxnet0
I must be missing something really basic here?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Problems with host-only networking

Post by scottgus1 »

It looks like you have everything set up in Virtualbox correctly, and your expectations are reasonable.

There is a new requirement for Host-Only networks since 6.1.28 that plugs a security hole. See https://www.virtualbox.org/manual/ch06. ... k_hostonly, at the end of the section, starting at "On Linux, Mac OS X and Solaris Oracle VM VirtualBox...". See if that helps.
jernst
Posts: 32
Joined: 20. Sep 2013, 19:31
Primary OS: Other
VBox Version: OSE other
Guest OSses: Arch. UBOS.

Re: Problems with host-only networking

Post by jernst »

I have this:

Code: Select all

% cat /etc/vbox/networks.conf
10.0.0.0/8 192.168.0.0/16
2001::/64
% ls -al /etc/vbox              
total 8
drwxr-xr-x   3 root  wheel    96 Nov 24 21:19 .
drwxr-xr-x  82 root  wheel  2624 Nov 24 21:19 ..
-rw-r--r--   1 root  wheel    36 Nov 24 21:19 networks.conf
jernst
Posts: 32
Joined: 20. Sep 2013, 19:31
Primary OS: Other
VBox Version: OSE other
Guest OSses: Arch. UBOS.

Re: Problems with host-only networking

Post by jernst »

I tried on an old Mac running macOS 10.15.7 (Catalina) with VirtualBox 6.1.22. Works like a charm.

So something happened between 6.1.22 and 6.1.30, or since 10.15.7.

What can I do to help debug this?
paulmc
Posts: 72
Joined: 28. Aug 2019, 18:43
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Mac OS X, Linux, Windows
Location: Earth (Guyana / USA / South Africa)
Contact:

Re: Problems with host-only networking

Post by paulmc »

@jernst, I'm not sure about all the underlying causes that are relevant here, but at least one issue might just be syntax … E.g., upon looking through various related threads, such as 'Virtualbox-6.1.28 Does Not Assign IPs to HostOnly Network', it seems that in the 'networks.conf' file, as shown in the manual's examples, the leading asterisk & space ('* ') in each line are actually significant?

Anyway, that thread also contains other useful tips, which should be worth checking out too.

Good luck!
jernst
Posts: 32
Joined: 20. Sep 2013, 19:31
Primary OS: Other
VBox Version: OSE other
Guest OSses: Arch. UBOS.

Re: Problems with host-only networking

Post by jernst »

Downgrading to 6.1.26 makes everything work again.

Sounds like a regression.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Problems with host-only networking

Post by scottgus1 »

jernst wrote:% cat /etc/vbox/networks.conf
10.0.0.0/8 192.168.0.0/16
2001::/64
paulmc wrote:one issue might just be syntax … the leading asterisk & space ('* ')
the manual wrote:to allow 10.0.0.0/8 and 192.168.0.0/16 IPv4 ranges as well as 2001::/64 range put the following lines into /etc/vbox/networks.conf:
* 10.0.0.0/8 192.168.0.0/16
* 2001::/64
Such are missing in Jernst's 'cat'.
jernst wrote:Sounds like a regression.
More like a new feature for plugging a security hole. And we'd need to see that your local circumstances did not work after putting in the correct syntax before saying there's a possibility of a bug. Othe Host-Only users who have implemented the new arrangement have succeeded in applying the new Host-Only setup.
jernst wrote:Downgrading to 6.1.26 makes everything work again.
Running an old version that doesn't have the security plug would be expected to restore insecure operation.
Post Reply