Arne Wolframm
Arne Wolframm

Reputation: 366

Error after `vagrant halt; vagrant up`

I am setting up a Ubuntu 15.04 VM on Win7 using Vagrant 1.7.4 and VBox 5.0.0.

On the first vagrant up I can ssh into the machine using vagrant putty and everything is setup correctly and works. When I run vagrant halt, the VM shuts down gracefully without error messages.

However, when I try to restart the VM using vagrant up; vagrant putty, the machine is in a strange state. For example, the default synced folder /vagrant is empty, even though the second vagrant up call prints this message:

default: /vagrant => C:/Users/ArneUser/numecs/dev_env

Also, this vagrant up call prints the following message in PowerShell:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=

Stdout from the command:

Stderr from the command:

stdin: is not a tty
bash: line 2: /sbin/initctl: No such file or directory

I am running a really basic setup just to test for this error, so I don't think the mistake is in my provisioning script. Some pointers in the right direction would be appreciated.

Upvotes: 0

Views: 2425

Answers (4)

PHZ.fi-Pharazon
PHZ.fi-Pharazon

Reputation: 2113

In my case it seems as Marc Young suggested that by opening Virtualbox GUI, the virtual machine itself seems to be hung. I saw these error messages on the virtual box console: enter image description here

Thus it seems to not to be Vagrant related problem, but the virtual machine (Linux Kernel) itself seems to be hung.

Upvotes: 0

Andrei Todorut
Andrei Todorut

Reputation: 4536

Open VirtualBox GUI and turn off machine manually, then run again the vagrant up command.

That solved the problem in my case :)

Upvotes: 1

smokes2345
smokes2345

Reputation: 190

Initctl is part of the Upstart init daemon. As far as I'm aware Ubuntu 15.04 is the first version of Ubuntu to abandon Upstart in favor of SystemD, so /sbin/initctl isn't expected to exist in your operating system. I believe this would need to be something that is fixed in the box you're using.

The point of "/sbin/initctl emit ..." is to notify other Upstart units that the vagrant shared folder has been mounted and is available for read/write operations. Since upstart is no longer in use it may be safe to assume that there is no need for this call. It's a rather crude hack, but you could make an empty script at /sbin/initctl. This should allow the vagrant startup process to continue properly and provision your box.

Upvotes: 0

Marc Young
Marc Young

Reputation: 4012

/vagrant is empty

/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=

From these two lines I suspect that MOUNTPOINT should be /vagrant but its due to /vagrant being empty that SSH is now working.

I've seen similar issues because of Virtualbox 5. Try to downgrade Virtualbox to 4.3.x and ensure you have the latest Vagrant (1.7.4).

https://github.com/mitchellh/vagrant/issues/5572

Upvotes: 0

Related Questions