hostonlyif ipconfig problem

Discussions related to using VirtualBox on Linux hosts.
Post Reply
mgogala
Posts: 12
Joined: 20. Nov 2011, 23:44
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: OL 6.1, Centos 6, Ubuntu 11.10

hostonlyif ipconfig problem

Post by mgogala »

I am testing Docker on Fedora and it works fine. However, when I try docker machine, I am getting the following error:

Code: Select all

docker-machine create default
Running pre-create checks...
Creating machine...
(default) Copying /home/mgogala/.docker/machine/cache/boot2docker.iso to /home/mgogala/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Found a new host-only adapter: "vboxnet4"
Error creating machine: Error in driver during machine creation: Error setting up host only network on machine start: /usr/bin/VBoxManage hostonlyif ipconfig vboxnet4 --ip 192.168.99.1 --netmask 255.255.255.0 failed:
VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp

The code in the error fails even when I execute it as root:

Code: Select all

[root@medo Downloads]# /usr/bin/VBoxManage hostonlyif ipconfig vboxnet4 --ip 192.168.99.1 --netmask 255.255.255.0
VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp
This looks like a VirtualBox bug
Regards
mgogala
Posts: 12
Joined: 20. Nov 2011, 23:44
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: OL 6.1, Centos 6, Ubuntu 11.10

Re: hostonlyif ipconfig problem

Post by mgogala »

BTW, this is the latest Fedora 36 and the latest VirtualBox:

[root@medo Downloads]# uname -a
Linux medo.home.com 5.18.17-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 11 14:36:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@medo Downloads]# rpm -qa|grep -i virtualbox
VirtualBox-6.1-6.1.36_152435_fedora36-1.x86_64
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: hostonlyif ipconfig problem

Post by scottgus1 »

mgogala wrote:Error setting up host only network on machine start: /usr/bin/VBoxManage hostonlyif ipconfig vboxnet4 --ip 192.168.99.1 --netmask 255.255.255.0 failed:
https://www.virtualbox.org/manual/ch06. ... k_hostonly
On Linux, Mac OS X and Solaris Oracle VM VirtualBox will only allow IP addresses in 192.168.56.0/21 range to be assigned to host-only adapters. ... 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
mgogala
Posts: 12
Joined: 20. Nov 2011, 23:44
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: OL 6.1, Centos 6, Ubuntu 11.10

Re: hostonlyif ipconfig problem

Post by mgogala »

Thanks, this works!
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: hostonlyif ipconfig problem

Post by scottgus1 »

Great! Glad you're up and running.
Post Reply