Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant refusing to start (Remote connection disconnect)

Vagrant refuses to start after making some changes to networking, I was getting the following;

$ vagrant up
default: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...

I tried to fix this by restarting the service (which failed), which then resulted in this;

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> 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

Others recommended restarting VirtualBox service, but this also failed;

✗ sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
Unloading VBoxDrv.kext
(kernel) Can't remove kext org.virtualbox.kext.VBoxDrv; services failed to terminate - 0xe00002c7.
Failed to unload org.virtualbox.kext.VBoxDrv - (iokit/common) unsupported function.
Error: Failed to unload VBoxDrv.kext
Fatal error: VirtualBox
like image 685
sleepycal Avatar asked Jan 26 '15 11:01

sleepycal


2 Answers

After much digging, it appears the restart command was failing due to VirtualBox processes holding locks.

This was fixed by doing;

# kill all virtualbox related processes
$ ps aux | grep vbox -i | awk -F ' ' '{print $2}' | xargs

# restart virtualbox service
$ sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart

# try again
$ vagrant up
like image 132
sleepycal Avatar answered Nov 14 '22 23:11

sleepycal


This worked for me.. make sure you have enable adapter 2 on virtualbox

enter image description here

like image 42
Pantano Estudios Avatar answered Nov 14 '22 22:11

Pantano Estudios