VirtualBox: NS_ERROR_FAILURE error on MacOS Sierra - macos

I am using virtualbox+vagrant for running a virtual machine for development purposes. It was running perfectly fine before I made the stupid mistake of upgrading to Sierra. Here's the trace:
nkohlis-MacBook-Pro:vagrant nkohli$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["hostonlyif", "create"]
Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface:
failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterface, interface IHostNetworkInterface
VBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 66 of file VBoxManageHostonly.cpp
I tried one of the solutions suggested elsewhere:
nkohlis-MacBook-Pro:vagrant nkohli$ sudo /Library/Application\ Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh restart
Password:
/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart => /Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart-amd64
/Applications/VirtualBox.app/Contents/MacOS/VBoxBalloonCtrl => /Applications/VirtualBox.app/Contents/MacOS/VBoxBalloonCtrl-amd64
/Applications/VirtualBox.app/Contents/MacOS/VBoxDD2GC.gc => /Applications/VirtualBox.app/Contents/MacOS/VBoxDD2GC.gc-amd64
/Applications/VirtualBox.app/Contents/MacOS/VBoxDDGC.gc => /Applications/VirtualBox.app/Contents/MacOS/VBoxDDGC.gc-amd64
/Applications/VirtualBox.app/Contents/MacOS/VBoxExtPackHelperApp => /Applications/VirtualBox.app/Contents/MacOS/VBoxExtPackHelperApp-amd64
/Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless => /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless-amd64
/Applications/VirtualBox.app/Contents/MacOS/VBoxManage => /Applications/VirtualBox.app/Contents/MacOS/VBoxManage-amd64
/Applications/VirtualBox.app/Contents/MacOS/VBoxNetAdpCtl => /Applications/VirtualBox.app/Contents/MacOS/VBoxNetAdpCtl-amd64
/Applications/VirtualBox.app/Contents/MacOS/VBoxNetDHCP => /Applications/VirtualBox.app/Contents/MacOS/VBoxNetDHCP-amd64
/Applications/VirtualBox.app/Contents/MacOS/VBoxNetNAT => /Applications/VirtualBox.app/Contents/MacOS/VBoxNetNAT-amd64
/Applications/VirtualBox.app/Contents/MacOS/VBoxSVC => /Applications/VirtualBox.app/Contents/MacOS/VBoxSVC-amd64
/Applications/VirtualBox.app/Contents/MacOS/VBoxXPCOMIPCD => /Applications/VirtualBox.app/Contents/MacOS/VBoxXPCOMIPCD-amd64
/Applications/VirtualBox.app/Contents/MacOS/VMMGC.gc => /Applications/VirtualBox.app/Contents/MacOS/VMMGC.gc-amd64
/Applications/VirtualBox.app/Contents/MacOS/VirtualBox => /Applications/VirtualBox.app/Contents/MacOS/VirtualBox-amd64
/Applications/VirtualBox.app/Contents/MacOS/VirtualBoxVM => /Applications/VirtualBox.app/Contents/MacOS/VirtualBoxVM-amd64
/Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv => /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv-amd64
Loading VBoxDrv.kext
/Library/Application Support/VirtualBox/VBoxDrv.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).
Error: Failed to load /Library/Application Support/VirtualBox/VBoxDrv.kext
Loading VBoxUSB.kext
/Library/Application Support/VirtualBox/VBoxUSB.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).
Error: Failed to load /Library/Application Support/VirtualBox/VBoxUSB.kext
Loading VBoxNetFlt.kext
/Library/Application Support/VirtualBox/VBoxNetFlt.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).
Error: Failed to load /Library/Application Support/VirtualBox/VBoxNetFlt.kext
Loading VBoxNetAdp.kext
/Library/Application Support/VirtualBox/VBoxNetAdp.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).
Error: Failed to load /Library/Application Support/VirtualBox/VBoxNetAdp.kext
(kernel) Kext org.virtualbox.kext.VBoxNetAdp not found for unload request.
Failed to unload org.virtualbox.kext.VBoxNetAdp - (libkern/kext) not found.
(kernel) Kext org.virtualbox.kext.VBoxNetFlt not found for unload request.
Failed to unload org.virtualbox.kext.VBoxNetFlt - (libkern/kext) not found.
(kernel) Kext org.virtualbox.kext.VBoxUSB not found for unload request.
Failed to unload org.virtualbox.kext.VBoxUSB - (libkern/kext) not found.
(kernel) Kext org.virtualbox.kext.VBoxDrv not found for unload request.
Failed to unload org.virtualbox.kext.VBoxDrv - (libkern/kext) not found.
Fatal error: VirtualBox
...to no avail.
Here's the stack trace when I ran vagrant up after reinstalling VirtualBox:
failed MSpanList_Insert 0x1e3000 0x215290116bd5 0x0
fatal error: MSpanList_Insert
runtime stack:
runtime.throw(0x19816b)
/Users/mitchellh/code/3rdparty/go/src/runtime/panic.go:491 +0xad fp=0x7fff5fbff7d0 sp=0x7fff5fbff7a0
runtime.MSpanList_Insert(0x1b3988, 0x1e3000)
/Users/mitchellh/code/3rdparty/go/src/runtime/mheap.c:692 +0x8f fp=0x7fff5fbff7f8 sp=0x7fff5fbff7d0
MHeap_FreeSpanLocked(0x1b0580, 0x1e3000, 0x100)
/Users/mitchellh/code/3rdparty/go/src/runtime/mheap.c:583 +0x163 fp=0x7fff5fbff838 sp=0x7fff5fbff7f8
MHeap_Grow(0x1b0580, 0x8, 0x0)
/Users/mitchellh/code/3rdparty/go/src/runtime/mheap.c:420 +0x1a8 fp=0x7fff5fbff878 sp=0x7fff5fbff838
MHeap_AllocSpanLocked(0x1b0580, 0x1, 0x0)
/Users/mitchellh/code/3rdparty/go/src/runtime/mheap.c:298 +0x365 fp=0x7fff5fbff8b8 sp=0x7fff5fbff878
mheap_alloc(0x1b0580, 0x1, 0x12, 0x0)
/Users/mitchellh/code/3rdparty/go/src/runtime/mheap.c:190 +0x121 fp=0x7fff5fbff8e0 sp=0x7fff5fbff8b8
runtime.MHeap_Alloc(0x1b0580, 0x1, 0x10000000012, 0x10d39)
/Users/mitchellh/code/3rdparty/go/src/runtime/mheap.c:240 +0x66 fp=0x7fff5fbff918 sp=0x7fff5fbff8e0
MCentral_Grow(0x1b82f8, 0x0)
/Users/mitchellh/code/3rdparty/go/src/runtime/mcentral.c:197 +0x8b fp=0x7fff5fbff980 sp=0x7fff5fbff918
runtime.MCentral_CacheSpan(0x1b82f8, 0x0)
/Users/mitchellh/code/3rdparty/go/src/runtime/mcentral.c:85 +0x167 fp=0x7fff5fbff9b8 sp=0x7fff5fbff980
runtime.MCache_Refill(0x1df000, 0x12, 0x0)
/Users/mitchellh/code/3rdparty/go/src/runtime/mcache.c:90 +0xa0 fp=0x7fff5fbff9e0 sp=0x7fff5fbff9b8
runtime.mcacheRefill_m()
/Users/mitchellh/code/3rdparty/go/src/runtime/malloc.c:368 +0x57 fp=0x7fff5fbffa00 sp=0x7fff5fbff9e0
runtime.onM(0x13d650)
/Users/mitchellh/code/3rdparty/go/src/runtime/asm_amd64.s:273 +0x9a fp=0x7fff5fbffa08 sp=0x7fff5fbffa00
runtime.mallocgc(0x120, 0xff4a0, 0x0, 0x0)
/Users/mitchellh/code/3rdparty/go/src/runtime/malloc.go:178 +0x849 fp=0x7fff5fbffab8 sp=0x7fff5fbffa08
runtime.newobject(0xff4a0, 0x1df000)
/Users/mitchellh/code/3rdparty/go/src/runtime/malloc.go:353 +0x49 fp=0x7fff5fbffae0 sp=0x7fff5fbffab8
runtime.newG(0x2520a)
/Users/mitchellh/code/3rdparty/go/src/runtime/proc.go:233 +0x2a fp=0x7fff5fbffaf8 sp=0x7fff5fbffae0
allocg(0x1a33e0)
/Users/mitchellh/code/3rdparty/go/src/runtime/proc.c:925 +0x1f fp=0x7fff5fbffb08 sp=0x7fff5fbffaf8
runtime.malg(0x8000, 0x1a3480)
/Users/mitchellh/code/3rdparty/go/src/runtime/proc.c:2106 +0x1f fp=0x7fff5fbffb38 sp=0x7fff5fbffb08
runtime.mpreinit(0x1a3840)
/Users/mitchellh/code/3rdparty/go/src/runtime/os_darwin.c:137 +0x27 fp=0x7fff5fbffb50 sp=0x7fff5fbffb38
mcommoninit(0x1a3840)
/Users/mitchellh/code/3rdparty/go/src/runtime/proc.c:201 +0xc9 fp=0x7fff5fbffb78 sp=0x7fff5fbffb50
runtime.schedinit()
/Users/mitchellh/code/3rdparty/go/src/runtime/proc.c:138 +0x55 fp=0x7fff5fbffba0 sp=0x7fff5fbffb78
runtime.rt0_go(0x7fff5fbffbd8, 0x2, 0x7fff5fbffbd8, 0x0, 0x0, 0x2, 0x7fff5fbffcd0, 0x7fff5fbffcd8, 0x0, 0x7fff5fbffcdb, ...)
/Users/mitchellh/code/3rdparty/go/src/runtime/asm_amd64.s:95 +0x116 fp=0x7fff5fbffba8 sp=0x7fff5fbffba0
I've looked around but didn't find a similar issue reported elsewhere.

Upgrading Vagrant and VirtualBox fixed the issue for me. For those wondering, no you don't end up losing your existing VMs if you upgrade.
Vagrant: https://www.vagrantup.com/downloads.html
VirtualBox: https://www.virtualbox.org/wiki/Downloads

some reported issues after update to macos Sierra. re-installing Virtualbox solves the issue

This issue affects anyone installing VirtualBox for the first time on a fresh macOS High Sierra 10.13.
This effectively breaks our fully automated installation process on macOS, since the user now has to perform a manual approval and then restart the installation (reboot and rerun the installation in some cases)
First, try to restart the Virtualbox with below command.
sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
If you are still facing this issue then given assign the below permission as per the screenshot.
Note: If the Allow button does not show up, run sudo kextcache -system-caches
Source: https://github.com/docksal/docksal/issues/417

Solved. VirtualBox would always fail installation no matter how many times I tried. What worked for me was to reboot and try again, it worked! (Earlier, before trying to install, I had already upgraded fuse, vagrant, and checked to 'allow' Oracle to load its extensions from the System Preferences/Security panel. The key thing was the computer reboot before trying to install VB on High Sierra.

Run the following command in your terminal:
for bin in VirtualBox VirtualBoxVM VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT VBoxHeadless; do
sudo chmod u+s "/Applications/VirtualBox.app/Contents/MacOS/${bin}"
done
It worked for me without upgrading anything.
NOTE: This will allow any user on your system to run any of these commands as root. Please be sure you understand what these commands mean before you run them.

Related

Problem installing microk8s on Windows 11 - VBoxManage trying to unregister a locked unexistent machine

there! I tried to install microk8s version 2.3.1, having VirtualBox 7.0.6 already installed.
Making a long story short, I’m facing the following problem:
C:\Users\lucas>microk8s status --wait-ready
MicroK8s is not installed. Please run `microk8s install`.
C:\Users\lucas>microk8s install
[2023-02-10T16:05:20.013] [error] [microk8s-vm] Could not unregister VM: VBoxManage.exe: error: Cannot unregister the machine 'microk8s-vm' while it is locked
VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "Unregister(fDeleteAll ? CleanupMode_DetachAllReturnHardDisksAndVMRemovable :CleanupMode_DetachAllReturnHardDisksOnly, ComSafeArrayAsOutParam(aMedia))" at line 236 of file VBoxManageMisc.cpp
launch failed: Could not start VM: VBoxManage.exe: error: UUID {9aa00452-a0c7-46fd-934d-039c9ddaac76} of the medium 'C:\ProgramData\Multipass\data\virtualbox\vault\instances\microk8s-vm\ubuntu-18.04-server-cloudimg-amd64.vdi' does not match the value {d1773776-824f-4773-8173-a89394a8a2a6} stored in the media registry ('C:\windows\system32\config\systemprofile\.VirtualBox\VirtualBox.xml')
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MediumWrap, interface IMedium
Waiting for VM "microk8s-vm" to power on...
And then this message repeats every ~5 seconds.
The list of virtual machines on VirtualBox is empty.
I’m pretty stuck on it. Anybody has an idea on how to solve it?
Thanks!

Vagrant up fails with VERR_ACCESS_DENIED error

I'm trying to learn Vagrant but facing an issue at the beginning of my way.. I was googling for a while but didn't find useful answer.
Setup details: Windows 10 Vagrant 2.1.5 VirtualBox 5.2.18 r124319
Problem description:
While running "vagrant up" command I get following error:
PS C:\Users\Michał\Desktop\desktop\vagrant_test> vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==>
default: Importing base box 'geerlingguy/centos7'... There was an
error while executing VBoxManage, a CLI used by Vagrant for
controlling VirtualBox. The command and stderr is shown below.
Command: ["import", "\?\C:\HashiCorp;\boxes\geerlingguy-VAGRANTSLASH-centos7\1.2.10\virtualbox
\box.ovf", "--vsys", "0", "--vmname",
"packer-centos-7-x86_64_1539008587672_41094", "--vsys", "0", "--
unit", "8", "--disk", "C:\Users\Micha\u2502\VirtualBox
VMs\packer-centos-7-x86_64_1539008587672_41094
\packer-centos-7-x86_64-disk001.vmdk"]
Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting
\?\C:\HashiCorp;\boxes\geerlingguy-VAGRANTSLASH-centos7\1.2.10\virtualbox\box.ovf...
OK. 0%... Progress state: VBOX_E_IPRT_ERROR VBoxManage.exe: error:
Appliance import failed VBoxManage.exe: error: Could not create the
directory 'C:\Users\MichaÔöé\VirtualBox
VMs\packer-centos->7-x86_64_1539008587672_41094' (VERR_ACCESS_DENIED)
VBoxManage.exe: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005),
component ApplianceWrap, interface IAppliance VBoxManage.exe: error:
Context: "enum RTEXITCODE __cdecl handleImportAppliance(struct
HandlerArg *)" at line 886 of file VBoxManageAppliance.cpp
For some reason VBoxManage.exe tool is not able to access the directory where my VirtualBox VMs are stored.
VBoxManage.exe: error: Could not create the directory
'C:\Users\MichaÔöé\VirtualBox
VMs\packer-centos-7-x86_64_1539008587672_41094' (VERR_ACCESS_DENIED)
Username contains one Polish letter "ł" that's why we see in the path:
C:\Users\MichaÔöé\VirtualBox VMs
But I don't think it is a problem.
This is default installation so I would expect it to be running.
BR
I found the answer, running PowerShell console as administrator resolved the issue.

Vagrant box error message

try to download Vagrant box on my mac system and this is the message I get.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'bahmni-team/bahmni' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'bahmni-team/bahmni'
default: URL: https://atlas.hashicorp.com/bahmni-team/bahmni
==> default: Adding box 'bahmni-team/bahmni' (v0.80) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/bahmni-team/boxes/bahmni/versions/0.80/providers/virtualbox.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
transfer closed with 963850334 bytes remaining to read
how do I resolve this?
After Successful Installing Vagrant box, Got this error
default: Importing base box 'bahmni-team/bahmni'...
Progress: 10%There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["import", "/Users/Paul/.vagrant.d/boxes/bahmni-team-VAGRANTSLASH-bahmni/0.80/virtualbox/box.ovf", "--vsys", "0", "--vmname", "packer-virtualbox-iso-1459089960_1463772163009_23494", "--vsys", "0", "--unit", "7", "--disk", "/Users/Paul/VirtualBox VMs/packer-virtualbox-iso-1459089960_1463772163009_23494/packer-virtualbox-iso-1459089960-disk1.vmdk"]
Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /Users/Paul/.vagrant.d/boxes/bahmni-team-VAGRANTSLASH-bahmni/0.80/virtualbox/box.ovf...
OK.
0%...10%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Appliance import failed
VBoxManage: error: Could not create the imported medium '/Users/Paul/VirtualBox VMs/packer-virtualbox-iso-1459089960_1463772163009_23494/packer-virtualbox-iso-1459089960-disk1.vmdk'.
VBoxManage: error: VMDK: cannot write allocated data block in '/Users/Paul/VirtualBox VMs/packer-virtualbox-iso-1459089960_1463772163009_23494/packer-virtualbox-iso-1459089960-disk1.vmdk' (VERR_DISK_FULL)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component ApplianceWrap, interface IAppliance
VBoxManage: error: Context: "RTEXITCODE handleImportAppliance(HandlerArg*)" at line 877 of file VBoxManageAppliance.cpp
I think the error "VERR_DISK_FULL" is the error you should focus at. Your disk might have been full. So, solution would be to free some space on the disk and try the command again.
Vagrant is internally using curl and there are issues with curl.
You can try wget on the URL as it usually works better than curl
wget https://atlas.hashicorp.com/bahmni-team/boxes/bahmni/versions/0.80/providers/virtualbox.box
once you have the box file you still need to add to vagrant (vagrant box add bahmni-team/bahmni <path to box file>)

"VBOX_E_FILE_ERROR" while running "vagrant up" command

I am getting the below error when i try to run "vagrant up" command.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'precise32'...
Progress: 30%There was an error while executing VBoxManage, a CLI used by Vagr
ant
for controlling VirtualBox. The command and stderr is shown below.
Command:
["import", "C:/Users/username/.vagrant.d/boxes/precise32/0/virtualbox/b
ox.ovf", "--vsys", "0", "--vmname", "precise32_1417450998781_63238", "--vsys", "
0", "--unit", "9", "--disk", "X:\\VirtualBox VMs\\precise32_1417450998781_63238\
\box-disk1.vmdk"]
Stderr:
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting C:\Users\username\.vagrant.d\boxes\precise32\0\virtualbox\box.ovf..
.
OK.
0%...10%...20%...30%...
Progress state:
VBOX_E_FILE_ERROR
VBoxManage.exe: error: Appliance import failed
VBoxManage.exe: error: Could not create the imported medium 'X:\VirtualBox VMs\p
recise32_1417450998781_63238\box-disk1.vmdk'.
VBoxManage.exe: error: VMDK: cannot write allocated data block in 'X:\VirtualBox
VMs\precise32_1417450998781_63238/box-disk1.vmdk' (VERR_DISK_FULL)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component A
ppliance, interface IAppliance
VBoxManage.exe: error: Context: "int __cdecl handleImportAppliance(struct Handle
rArg *)" at line 779 of file VBoxManageAppliance.cpp
I am not using an 'X' drive and I have already set the "VAGRANT_HOME" variable to the home directory in the environment variables, i.e, VAGRANT_HOME and its value C:\Users\username.vagrant.d
I already have the ".vagrant" directory and other dirs inside it.
Can anyone please tell me why I am still getting the above error when i run "vagrant up" command and any solution for it.
Thanks
The error VERR_DISK_FULL seems to tell that your disk is full.
VBoxManage.exe: error: VMDK: cannot write allocated data block in 'X:\VirtualBox
VMs\precise32_1417450998781_63238/box-disk1.vmdk' (VERR_DISK_FULL)
Try freeing some space on your C:/ drive. I don't know the minimum but I think you have to have more then 1 gb free.
I had the same error and I found that the .vmdk file was missing inside of the box directory within .vagrant.d
Simply copying the file there solved it
It's laravel/Homestead box in a debian machine by the way.

How to set a different disk when using vagrant up?

I am using Vagrant on Windows 7.
After I run vagrant up,I showed me:
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Appliance import failed
VBoxManage.exe: error: Could not create the clone medium 'L:\VirtualBox VMs\ubun
tu-cloudimg-trusty-vagrant-amd64\box-disk1.vmdk'.
VBoxManage.exe: error: VMDK: could not create new grain directory in 'L:\Virtual
Box VMs\ubuntu-cloudimg-trusty-vagrant-amd64/box-disk1.vmdk' (VERR_DISK_FULL).
VBoxManage.exe: error: VMDK: error writing descriptor in 'L:\VirtualBox VMs\ubun
tu-cloudimg-trusty-vagrant-amd64\box-disk1.vmdk' (VERR_DISK_FULL)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component A
ppliance, interface IAppliance
VBoxManage.exe: error: Context: "int __cdecl handleImportAppliance(struct Handle
rArg *)" at line 779 of file VBoxManageAppliance.cpp
Maybe the reason is that my L disk is full.So how can I set a different disk?
It certainly looks like some drive issue, maybe disk space, maybe user permissions.
In your case the error comes from VBoxManage, so the error happens when Vagrant is importing its box into VirtualBox.
In order to change the location of VirtualBox's VMs you need to set it in VirtualBox properties ('Default Machine Folder').
For more info check the docs
You need set VAGRANT_HOME. The property "machinefolder" in VirtualBox has to be set through "VBoxManage setproperty machinefolder "

Resources