Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]Virtualbox No Longer Assigns IPs to HostOnly Network
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 750

PostPosted: Thu Oct 21, 2021 10:26 pm    Post subject: [SOLVED]Virtualbox No Longer Assigns IPs to HostOnly Network Reply with quote

Virtualbox-6.1.26 was working without issue. Portage upgraded to virtualbox-6.1.28. Now when I launch a VM that uses host-only networking, the host's VirtualBox network device (ex: vboxnet0) no longer is assigned its IP address. The address is still listed in VirtualBox's "Host Network Manager" but it is not assigned. As root I can run "ip add" to solve the issue and then the VM can "talk" to the host.

Any idea why the VirtualBox host-only network devices on the host no longer are assigned an IP?

(Yes I did upgrade to virtualbox-modules-6.1.28 )


Last edited by jagdpanther on Tue Oct 26, 2021 6:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 3001
Location: Edge of marsh USA

PostPosted: Sat Oct 23, 2021 3:44 am    Post subject: Reply with quote

Go back to stable virtualbox (6.1.24).
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22417

PostPosted: Sat Oct 23, 2021 4:10 pm    Post subject: Reply with quote

While that might be a short term solution, OP will eventually need to upgrade, if for no other reason than VirtualBox's dependency on kernel module ABIs, which will force a VirtualBox upgrade if OP wishes to continue updating the host kernel. If, as seems likely, this is a bug in VirtualBox, then the bug needs to be isolated and a fix implemented. I see many open bug reports for VirtualBox, but none that, based on their subject lines, report OP's problem.
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 750

PostPosted: Sat Oct 23, 2021 4:58 pm    Post subject: Reply with quote

Thanks for the replies.

I reverted from virtualbox-6.1.28 to virtualbox-6.1.26 and Virtualbox is working as expected.

I should have posted that I am running Linux kernel 5.14.14 from gentoo-sources-5.14.14.

I have also posted a similar message to the virtualbox forums:
https://forums.virtualbox.org/viewtopic.php?f=7&t=104198
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Sun Oct 24, 2021 12:37 am    Post subject: Reply with quote

With VirtualBox I use the access by bridge in the network configuration. Than I use tap0 from the host network interfaces as the VirtualBox network interface. On the host tap0 is in the br0 bridge who have a 255.255.255.0 ip address. Like this I can configure the VirtualBox guest network interface eth0 to be in the same network than br0 on the host with the br0 ip address as the default route on the guest. All is fine for Internet and the local network services.

I don't need VirtualBox to act as a dhcp and dns servers but if I do so it work too when I configure the VirtualBox machine network interface to use NAT.
_________________
Paul
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 750

PostPosted: Mon Oct 25, 2021 5:28 pm    Post subject: Reply with quote

As was pointed out on the VirtualBox forum there are now restrictions by default on host-only network IP ranges for several platforms including Linux.

I should have read the change log more carefully:
Quote:
Network: More administrative control over network ranges, see user manual



From Virtualbox-6.1.28 user manual on page 116:

Quote:
On Linux, Mac OS X and Solaris Oracle VM VirtualBox will only allow IP addresses
in 192.68.56.0/21 range to be assigned to host-only adapters. For IPv6 only link-local
addresses are allowed. If other ranges are desired, they can be enabled by creating
/etc/vbox/networks.conf and specifying allowed ranges there. For example, 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


After I try this, I'll report back.
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 750

PostPosted: Mon Oct 25, 2021 7:00 pm    Post subject: Reply with quote

Creating the /etc/vbox/networks.conf file did NOT solve this issue for me. My /etc/vbox networks.conf contains the following (excluding some commented lines at the top):
Code:

* 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12

# * 0.0.0.0/0 ::/0


I have tried the following on my Linux host (running kernel 5.14.14):
1. Re-installing virtualbox.
2. removing the three virtualbox kernel modules and putting them back with "modprobe -r <module>" and "modprobe <module" for
vboxdrv, vboxnetadp, and vboxnetflt
3. In the Virtualbox "Host Network Manager" removing all the vboxnet* devices and putting them back. However, I am no longer allowed to change the default IP suppllied by the "Host Network Manager" I receive a little error window when I do stating: "Failed to save host network interface parameter" Details: Callee RC: NS_ERROR_FAILURE (0x80004005)"
4. Trying different entries in /etc/vbox/networks.conf. (Including "* 0.0.0.0/0" which according to the docs should allow any IPV4 address.)

In all cases when Virtualbox is launched, if they don't already exist, I see the network devices added, without assigned IPs and in the down state. (Ex vboxnet0). When I launch a VM, the host-only network device (ex: vboxnet0) stays "down" and no IP is assigned. (I can add an IP by hand (as root, "ip addr add ...") and bring the device UP to get networking working.

I also see entries in /var/log/messages like the following. (In this case I assigned the IP by hand in a previous attempt.)
Code:
Oct 25 11:53:39 fangorn kernel: vboxdrv: 00000000cf9ae7cc VMMR0.r0
Oct 25 11:53:39 fangorn kernel: VBoxNetAdpCtl[59927]: segfault at 0 ip 000056407deadc44 sp 00007ffe88286310 error 4 in VBoxNetAdpCtl[56407deac000+4000]
Oct 25 11:53:39 fangorn kernel: Code: ff 48 8b bd 98 fb ff ff be 00 04 00 00 e8 f4 e5 ff ff 48 85 c0 0f 84 db 01 00 00 48 8b bd 98 fb ff ff 48 89 de e8 dc e4 ff ff <80> 38 2a 0f 85 e3 00 00 00 80 78 01 00 0f 85 d9 00 00 00 66 0f 1f
Oct 25 11:53:39 fangorn kernel: vboxdrv: 0000000018273ff1 VBoxDDR0.r0
Oct 25 11:53:39 fangorn kernel: VBoxNetFlt: attached to 'vboxnet0' / 0a:00:27:00:00:00
Oct 25 11:53:39 fangorn kernel: vboxdrv: 00000000220e232f VBoxEhciR0.r0
Oct 25 11:53:39 fangorn kernel: VMMR0InitVM: eflags=246 fKernelFeatures=0x0 (SUPKERNELFEATURES_SMAP=0)
Oct 25 11:53:39 fangorn kernel: device vboxnet0 entered promiscuous mode
Oct 25 11:53:41 fangorn ntpd[2729]: Listen normally on 16 vboxnet0 192.168.15.1:123
Oct 25 11:53:41 fangorn ntpd[2729]: Listen normally on 17 vboxnet0 [fe80::800:27ff:fe00:0%14]:123


Any suggestions?
Back to top
View user's profile Send private message
CerealP0rt
n00b
n00b


Joined: 26 Oct 2021
Posts: 1

PostPosted: Tue Oct 26, 2021 9:55 am    Post subject: Reply with quote

I had to delete all affected hostonly networks and recreate them to have /etc/vbox/networks.conf take effect.
This can be done with the "File > Host Network Manager" or on cli "vboxmanage hostonlyif remove <networkname>"
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 750

PostPosted: Tue Oct 26, 2021 6:28 pm    Post subject: Reply with quote

Solved.

There were three issues with HostOnly networks when migrating to Virtualbox-6.1.28.

1. I needed to create a /etc/vbox/networks.conf file as described in the Virtualbox-6.1.28 user manual on page 116.

2. I needed to remove all blank lines from /etc/vbox/networks.conf file. As VirutalBox forum user aleksey-vb points out:

Quote:
There is a bug in VBoxNetAdpCtl that stumbles on empty lines. It will be fixed in the next maintenance release. A workaround solution is to remove all empty lines in /etc/vbox/networks.conf.


3. I removed and added back all of the VirtualBox HostOnly networks using the VirtualBox "Host Network Manager". (Thanks CerealP0rt)

Now Virtualbox-6.1.28 is working as expected.
Back to top
View user's profile Send private message
alfattal
n00b
n00b


Joined: 28 Jan 2022
Posts: 1

PostPosted: Fri Jan 28, 2022 9:45 pm    Post subject: Reply with quote

jagdpanther wrote:
Solved.

There were three issues with HostOnly networks when migrating to Virtualbox-6.1.28.

1. I needed to create a /etc/vbox/networks.conf file as described in the Virtualbox-6.1.28 user manual on page 116.

2. I needed to remove all blank lines from /etc/vbox/networks.conf file. As VirutalBox forum user aleksey-vb points out:

Quote:
There is a bug in VBoxNetAdpCtl that stumbles on empty lines. It will be fixed in the next maintenance release. A workaround solution is to remove all empty lines in /etc/vbox/networks.conf.


3. I removed and added back all of the VirtualBox HostOnly networks using the VirtualBox "Host Network Manager". (Thanks CerealP0rt)

Now Virtualbox-6.1.28 is working as expected.


@jagdpanther I'm having the same issue on macOS Monterey with the latest Virtualbox 6.1.32. tried to find the /etc/vbox/networks.conf but couldn't find it. You mentioned that you created this file and that solved the issue for you, where did you create it? There seems to be NO /vbox/ directory anywhere on my machine, should I create that directory as well?
Back to top
View user's profile Send private message
jagdpanther
l33t
l33t


Joined: 22 Nov 2003
Posts: 750

PostPosted: Fri Jan 28, 2022 11:30 pm    Post subject: Reply with quote

alfattal:

Yes, create the directory /etc/vbox and then create the file networks.conf inside /etc/vbox.

See VirtualBox User's guide (V. 6.1.32) page 116 for details and a small example of networks.conf.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum