gpt4 book ai didi

ubuntu - 主机重启后 Vagrant 无法正确启动盒子,导致挂载错误

转载 作者:行者123 更新时间:2023-12-04 18:47:33 25 4
gpt4 key购买 nike

概括
我的 Arch Linux 主机上有一个带有 Ubuntu 14.04 的 Vagrant 盒子。当 supervisord 在客户机上运行时无法正常启动,并且如果不手动使用 vagrant halt,主机会在每次主机关闭时终止 virtualbox 进程。 .
问题
当我创建机器时,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.
当我重新启动主机 vagrant 拒绝再挂载文件夹并给我以下错误:
==> 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
这里是 Vagrant 文件 : 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

然后我 grep 为“virtualbox”并杀死那台机器的进程。或者我只是重新启动我的主机而不使用 vagrant halt ,这是主要的用例。
这里是 dmesg下一个 vagrant up 的输出:
[    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
完整输出: http://pastebin.com/mgECtZBH
如您所见,缺少最后两行:
vboxsf: Successfully loaded version 4.3.10_Ubuntu (interface 0x00010004)
init: plymouth-upstart-bridge main process (180) killed by TERM signal

当我通过 打开盒子时VirtualBox GUI ,我在第一次尝试时收到登录提示。杀死 virtualbox 进程(或重新启动主机)后,它卡在以下行,而没有给我登录提示。这是输出的最后几行:
* 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 的初始开始.在终止进程(或重新启动主机)并且完全没有问题或错误之后,一切都启动并安装得很好。 在没有启动 supervisord 的情况下,一切都按预期工作。
supervisord 进程启动了几个服务:
  • 雷迪斯
  • MongoDB
  • Nginx
  • Elasticsearch
  • PostgreSQL
  • Tornado
  • celery

  • 这些进程使用我主机上的上述共享文件夹。
    我还没有尝试隔离其中一项服务。
    任何见解或想法如何解决这个谜语?

    最佳答案

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

    关键是打开 daemon 参数。只需更换 daemon off;daemon on; .

    关于ubuntu - 主机重启后 Vagrant 无法正确启动盒子,导致挂载错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24860319/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com