{{tag>virtualbox troubleshooting networking}}
====== Virtualbox troubleshooting ======
===== Problem with assigning static ip to vm =====
Error:
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["hostonlyif", "ipconfig", "vboxnet0", "--ip", "10.0.0.1", "--netmask", "255.255.255.0"]
Stderr: 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
From virtualbox version 6.1.28 you need to whitelist the IPs from which the virtualbox can assign addresses. Create a file ///etc/vbox/networks.conf// with content:
* 10.0.0.0/8 192.168.0.0/16
Note the asterisk at the beginning.
This will allow the above IP ranges to be assigned to the vms.
==== Tested on ====
* Ubuntu 20.04.4 LTS
* virtualbox 6.1.32-dfsg-1~ubuntu1.20.04.1
===== Date and time wrong (frozen) in VM? =====
Restart the timedate service. In Debian 11 do
systemctl restart chronyd
Seems to be caused by the [[https://www.virtualbox.org/ticket/14605|absence of VBoxService]].
==== Tested on ====
* Debian 11
* vagrant install
===== References =====
* http://virtualbox.org/manual/ch06.html#network_hostonly