Pet*_*tev 7 virtualbox virtual-machine vagrant docker
我在我的流浪汉中遇到了一个奇怪的错误.所以我使用VirtualBox创建了一个新的ubuntu/trusty64虚拟机(如果有人关心的话,在OS X上).
一切都很好......
wget -qO- https://get.docker.com/ | sh
Run Code Online (Sandbox Code Playgroud)
这也很好.
然后我去重新启动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
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?
don*_*tor 13
我遇到了类似的问题.安装时看起来像Docker(以及可能的其他工具)将更新Ubuntu/Trusty64
guest 虚拟机中的内核版本.由于预先安装的VBox GuestAdditions Ubuntu/Trusty64
是专门针对原始内核版本构建的,因此Guest Additions将在下一次停止工作,vagrant up
或者vagrant reload
当Docker安装的新内核启动时停止运行.此时,Vagrant不再能够自动运行-mount /vagrant
文件夹(或任何同步的文件夹)作为Guest Additions是针对不同的内核构建的.
为了让它们再次工作,您必须针对Docker安装的新内核版本重建GuestAdditions.
幸运的是,Vagrant中有一个插件,vagrant-vbguest
当插件检测到需要重建时,它会负责自动重建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
应该成功.
试试看.