安装后 Vagrant 挂载错误 Docker
Vagrant mount error after installing Docker
我的 vagrant 虚拟机出现了一个奇怪的错误。所以我使用 VirtualBox 创建了一个新的 ubuntu/trusty64 虚拟机(如果有人关心的话,在 OS X 上)。
一切都很好...
然后我按照 instructions 安装了 Docker 基本上涉及 运行ning
wget -qO- https://get.docker.com/ | sh
这也很好用。
然后我重新启动 VM,退出 ssh shell,然后 运行 vagrant reload
收到此错误消息。
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` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
The error output from the last command was:
stdin: is not a tty
/sbin/mount.vboxsf: mounting failed with the error: No such device
有什么想法吗?
我遇到过类似的问题。看起来 Docker(可能还有其他工具)在安装后会更新 Ubuntu/Trusty64
来宾中的内核版本。由于 Ubuntu/Trusty64
中预装的 VBox GuestAdditions 是专门针对原始内核版本构建的,因此 Guest Additions 将在下一个 vagrant up
或 vagrant reload
停止工作,因为那是安装新内核的时候Docker 开始。此时,Vagrant 不再能够自动挂载 /vagrant
文件夹(或与此相关的任何同步文件夹),因为 Guest Additions 是针对不同的内核构建的。
要让它们再次工作,您必须针对 Docker 安装的新内核版本重建 GuestAdditions。
幸运的是,Vagrant 中有一个名为 vagrant-vbguest
的插件,当插件检测到需要重建 Guest Additions 时,它负责自动重建 Guest Additions(即当 guest 中的内核发生变化时,或者您升级了您在主机中的 VirtualBox 版本)
因此,就我而言,修复它的简单方法是:
- 在主机上:
$ vagrant plugin install vagrant-vbguest
- 上客:
$ sudo apt-get install linux-headers-$(uname -r)
- 在主机上:
$ vagrant reload
感谢 vagrant-vbguest
插件,新的 VBox GuestAdditions 将根据您的新版本内核自动重建(您将在上面的第二步中下载所需的头文件)。
一旦 GuestAdditions 恢复正常,同步文件夹应该会再次工作并且 /vagrant
的映射应该会成功。
试一试。
我的 vagrant 虚拟机出现了一个奇怪的错误。所以我使用 VirtualBox 创建了一个新的 ubuntu/trusty64 虚拟机(如果有人关心的话,在 OS X 上)。
一切都很好...
然后我按照 instructions 安装了 Docker 基本上涉及 运行ning
wget -qO- https://get.docker.com/ | sh
这也很好用。
然后我重新启动 VM,退出 ssh shell,然后 运行 vagrant reload
收到此错误消息。
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` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
The error output from the last command was:
stdin: is not a tty
/sbin/mount.vboxsf: mounting failed with the error: No such device
有什么想法吗?
我遇到过类似的问题。看起来 Docker(可能还有其他工具)在安装后会更新 Ubuntu/Trusty64
来宾中的内核版本。由于 Ubuntu/Trusty64
中预装的 VBox GuestAdditions 是专门针对原始内核版本构建的,因此 Guest Additions 将在下一个 vagrant up
或 vagrant reload
停止工作,因为那是安装新内核的时候Docker 开始。此时,Vagrant 不再能够自动挂载 /vagrant
文件夹(或与此相关的任何同步文件夹),因为 Guest Additions 是针对不同的内核构建的。
要让它们再次工作,您必须针对 Docker 安装的新内核版本重建 GuestAdditions。
幸运的是,Vagrant 中有一个名为 vagrant-vbguest
的插件,当插件检测到需要重建 Guest Additions 时,它负责自动重建 Guest Additions(即当 guest 中的内核发生变化时,或者您升级了您在主机中的 VirtualBox 版本)
因此,就我而言,修复它的简单方法是:
- 在主机上:
$ vagrant plugin install vagrant-vbguest
- 上客:
$ sudo apt-get install linux-headers-$(uname -r)
- 在主机上:
$ vagrant reload
感谢 vagrant-vbguest
插件,新的 VBox GuestAdditions 将根据您的新版本内核自动重建(您将在上面的第二步中下载所需的头文件)。
一旦 GuestAdditions 恢复正常,同步文件夹应该会再次工作并且 /vagrant
的映射应该会成功。
试一试。