主机重启后,Vagrant无法正常启动,导致挂载错误

时间:2014-07-21 08:06:52

标签: ubuntu vagrant boot mount supervisord

摘要

我的Arch Linux主机上有一个Ubuntu 14.04的Vagrant盒子。当supervisord在guest虚拟机上运行时,它无法正常启动,主机会杀死虚拟机进程,如果不手动使用vagrant halt,则会在每次主机关闭时完成。

问题

创建计算机时,vagrant upvagrant halt && vagrant up正常工作。我挂载了一个共享文件夹,该文件夹由框中的某些服务使用。 以下是成功输出

==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /myproject => /home/myuser/myproject
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.

当我重新启动主机时,流浪者拒绝再装入该文件夹并给我以下错误:

==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /myproject => /home/myuser/myproject
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` myproject /myproject
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` myproject /myproject

以下是 Vagrantfile http://pastebin.com/DCMMrUym

详细输出

以下是dmesg成功启动的最后一行(vagrant upvagrant halt && vagrant up):

[    4.721766] vboxvideo: Unknown symbol drm_open (err 0)
[    4.721768] vboxvideo: Unknown symbol drm_poll (err 0)
[    4.721770] vboxvideo: Unknown symbol drm_pci_init (err 0)
[    4.721772] vboxvideo: Unknown symbol drm_ioctl (err 0)
[    4.721774] vboxvideo: Unknown symbol drm_vblank_init (err 0)
[    4.721775] vboxvideo: Unknown symbol drm_mmap (err 0)
[    4.721776] vboxvideo: Unknown symbol drm_pci_exit (err 0)
[    4.721778] vboxvideo: Unknown symbol drm_release (err 0)
[    4.986464] init: udev-fallback-graphics main process (889) terminated with status 1
[    5.051943] vboxsf: Successfully loaded version 4.3.10_Ubuntu (interface 0x00010004)
[    6.992684] init: plymouth-upstart-bridge main process (180) killed by TERM signal

完整输出: http://pastebin.com/cktKJBZT


然后我gret" virtualbox"并杀死那台机器的过程。或者我只是重新启动主机而不使用vagrant halt,这是主要的用例。

以下是dmesg的<{1}}输出:

vagrant up

完整输出: http://pastebin.com/mgECtZBH

正如您所看到的,最后两行缺失:

[    5.408971] vboxvideo: Unknown symbol drm_open (err 0)
[    5.408973] vboxvideo: Unknown symbol drm_poll (err 0)
[    5.408974] vboxvideo: Unknown symbol drm_pci_init (err 0)
[    5.408977] vboxvideo: Unknown symbol drm_ioctl (err 0)
[    5.408978] vboxvideo: Unknown symbol drm_vblank_init (err 0)
[    5.408980] vboxvideo: Unknown symbol drm_mmap (err 0)
[    5.408981] vboxvideo: Unknown symbol drm_pci_exit (err 0)
[    5.408983] vboxvideo: Unknown symbol drm_release (err 0)
[    5.694825] init: udev-fallback-graphics main process (889) terminated with status 1

当我通过 VirtualBox GUI 打开包装盒时,我会在第一次尝试时收到登录提示。在终止虚拟机进程(或重新启动主机)后,它会挂起以下行,而不会给我提示登录提示。以下是输出的最后几行:

vboxsf: Successfully loaded version 4.3.10_Ubuntu (interface 0x00010004)
init: plymouth-upstart-bridge main process (180) killed by TERM signal

然后它只是等待无限。

第一种方法

我认为可能主管导致了这一点,我删除了* Starting early crypto disks... ...done. * Starting AppArmor profiles Skipping profile inn /etc/apparmor.d/disable: usr.sbin.rsyslogd ...done. * modprobe vboxvideo failed. Please use 'dmesg' to find out why ...fail! * Setting up X socket directories... ...done. ssty: standard input: Input/output error * Not starting NFS kernel daemon: no exports 的初始启动。杀死进程(或重新启动主机)后,没有任何问题或错误,所有内容都启动并安装就好了。 无需启动主管,一切都按预期工作。

supervisord流程启动了几项服务:

  1. Redis的
  2. MongoDB的
  3. Nginx的
  4. Elasticsearch
  5. 的PostgreSQL
  6. 龙卷风
  7. 芹菜
  8. 这些进程在我的主机上使用上述共享文件夹。

    我还没有尝试过分离其中一项服务。

    如何解决这个谜题的任何见解或想法?

1 个答案:

答案 0 :(得分:1)

我尝试停用每个已使用的服务,并将其缩小为 nginx 。特别是我的自定义nginx.conf

关键是打开守护进程参数。只需将daemon off;替换为daemon on;