【问题标题】:Vagrant and docker Protocol error mounting directory windows 7Vagrant和docker协议错误挂载目录windows 7
【发布时间】:2016-08-25 01:30:19
【问题描述】:

我有一个自定义 boot2docker,此配置附加到 .iso

config.vm.provider "virtualbox" do |v|
 v.customize ['storageattach', :id,  '--storagectl', 'SATA', '--port', 0, '--device', 0, '--type', 'dvddrive', '--medium', File.expand_path("../boot2docker.iso", __FILE__)]
 v.customize ['modifyvm', :id, '--nictype1', 'virtio']
end

  config.vm.network "private_network", ip: "192.168.10.10", id: "default-network", nic_type: "virtio"

我在目录中的文件

mycompany/
  dockerhost/
    Vagrantfile
  Vagrantfile

替换上面的docker-host的vagrantfile。

## This is required with the plugin winnfsd
 config.vm.network "private_network", type: "dhcp"
 config.vm.synced_folder "../", "/vagrant", type: "nfs"

当我使用 vagrant up 启动 dockerhost 时,它运行良好并且 NFS 设置正确,但是当我启动服务容器时 vagrant up myservice

显示错误

==> myservice: Docker host is required. One will be created if necessary...
myservice: Docker host VM is already ready.
==> myservice: Syncing folders to the host VM...
dockerhost: Mounting shared folders...
dockerhost: /var/lib/docker/docker_1472079332_51007 => C:/Users/myuser/Desktop/mycompany
Vagrant was unable to mount VirtualBox shared folders. This is usually because the filesystem "vboxsf" is not available. This filesystem is made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attemped was:

set -e
mount -t vboxsf -o uid=`id -u docker`,gid=`getent group docker | cut -d: -f3` b5973a5087 /var/lib/docker/docker_1472079332_51007 mount -t vboxsf -o uid=`id -u docker`,gid=`id -g docker` b5973a5087 /var/lib/docker/docker_1472079332_51007 
The error output from the command was:

mount: mounting b5973a5087 on /var/lib/docker/docker_1472079332_51007 failed: Protocol error

看起来 Vagrant 在启动容器时会挂载另一个卷。

关于如何解决它的任何想法? 或者为什么 vagrant 会为我安装另一个?

Tks

【问题讨论】:

  • 您是否验证了消息中给出的建议?
  • 安装 github.com/dotless-de/vagrant-vbguest 插件并让它代表您管理访客添加
  • @techraf 是的,我没有找到如何修复它或在 boot2docker 中安装 vboxfs 的链接。
  • @FrédéricHenri,我安装了它,它说GuestAdditions 5.0.18 running --- OK 看起来 vboxsf 在主机中不可用。 (来自 boot2docker)

标签: docker vagrant boot2docker


【解决方案1】:

Vagrant 和 VirtualBox 版本不兼容问题

这解决了我的问题:

Vagrant 1.8.5 应该与最新的 VirtualBox 5.1.2 版本兼容,但是我们目前拥有的 VirtualBox Guest Additions 版本是 5.0.20,而最新的 boot2docker 版本是 5.0.24。 VirtualBox 5.1.2 很可能都存在问题。

所以现在避免使用 VirtualBox 5.1.x 并坚持使用:

流浪者 1.7.4 - 1.8.4 VirtualBox 5.0.x

参考: https://github.com/blinkreaction/boot2docker-vagrant/issues/83

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-10-08
    • 2019-05-18
    • 2018-03-06
    • 1970-01-01
    • 2016-01-16
    • 1970-01-01
    • 2023-03-03
    • 1970-01-01
    相关资源
    最近更新 更多