简体   繁体   English

`无业游民停止后出错; 流浪了`

[英]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.我正在使用 Vagrant 1.7.4 和 VBox 5.0.0 在 Win7 上设置 Ubuntu 15.04 VM。

On the first vagrant up I can ssh into the machine using vagrant putty and everything is setup correctly and works.在第一次vagrant up我可以使用vagrant putty ssh 进入机器,一切都设置正确并且可以正常工作。 When I run vagrant halt , the VM shuts down gracefully without error messages.当我运行vagrant halt ,VM 正常关闭,没有错误消息。

However, when I try to restart the VM using vagrant up; vagrant putty但是,当我尝试使用vagrant up; vagrant putty重新启动 VM vagrant up; vagrant putty vagrant up; vagrant putty , the machine is in a strange state. vagrant up; vagrant putty ,机器处于奇怪的状态。 For example, the default synced folder /vagrant is empty, even though the second vagrant up call prints this message:例如,默认的同步文件夹/vagrant是空的,即使第二个vagrant up调用打印以下消息:

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

Also, this vagrant up call prints the following message in PowerShell:此外,这个vagrant up调用会在 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.一些指向正确方向的指针将不胜感激。

Open VirtualBox GUI and turn off machine manually, then run again the vagrant up command.打开VirtualBox GUI并手动关闭machine ,然后再次运行vagrant up命令。

That solved the problem in my case :)这解决了我的问题:)

/vagrant is empty /vagrant 是空的

/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT= /sbin/initctl 发射 --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.从这两行我怀疑 MOONTPOINT 应该是 /vagrant 但由于 /vagrant 为空,SSH 现在正在工作。

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).由于 Virtualbox 5,我看到了类似的问题。尝试将 Virtualbox 降级到 4.3.x,并确保您拥有最新的 Vagrant (1.7.4)。

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

Initctl is part of the Upstart init daemon. Initctl 是 Upstart init 守护进程的一部分。 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.据我所知,Ubuntu 15.04 是第一个放弃 Upstart 而支持 SystemD 的 Ubuntu 版本,因此 /sbin/initctl 预计不会存在于您的操作系统中。 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. "/sbin/initctl emit ..." 的意义在于通知其他 Upstart 单元 vagrant 共享文件夹已经挂载并且可以进行读/写操作。 Since upstart is no longer in use it may be safe to assume that there is no need for this call.由于不再使用 upstart,因此可以安全地假设不需要此调用。 It's a rather crude hack, but you could make an empty script at /sbin/initctl.这是一个相当粗糙的 hack,但是您可以在 /sbin/initctl 中创建一个空脚本。 This should allow the vagrant startup process to continue properly and provision your box.这应该允许 vagrant 启动过程正常继续并配置您的盒子。

In my case it seems as Marc Young suggested that by opening Virtualbox GUI, the virtual machine itself seems to be hung.就我而言,似乎 Marc Young 建议通过打开 Virtualbox GUI,虚拟机本身似乎已挂起。 I saw these error messages on the virtual box console:我在虚拟盒子控制台上看到了这些错误信息: 在此处输入图片说明

Thus it seems to not to be Vagrant related problem, but the virtual machine (Linux Kernel) itself seems to be hung.因此似乎不是 Vagrant 相关的问题,而是虚拟机(Linux Kernel)本身似乎挂了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM