微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Vagrant错误“暂停或重新加载后,无法在Linux guest虚拟机中装入文件夹”

我试图从别人那里使用一个stream浪者箱子,并且在我第一次启动它的时候工作的很好,但是当我停止并且重新启动后,无论是vagrant halt , vagrant up ,还是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: /sbin/mount.vBoxsf: mounting Failed with the error: No such device

现在,search这个错误消息,很多人都遇到了虚拟盒子4.3.10的问题,但这不是我遇到的问题。

stream浪汉店的日志在哪里?

Windows从睡眠中返回后发生InstanceOwnerException

stream浪汉提供npm的问题

如何在负载平衡的情况下按需stream式传输video

Windows Workflow Foundation在哪里使用?

事实证明,升级Linux内核将导致Virtual Box Guest Additions停止工作,直到通过在VM中运行以下命令重建

sudo /etc/init.d/vBoxadd setup

当我运行yum update (类似于apt-get upgrade )来更新其他软件时,我没有考虑升级内核。

或者,如果按照此处所述安装dkms软件包,则应在内核更新时自动更新内核模块。

解决这个问题,必须安装虚拟盒子。 例如,我使用Centos 7.首先下载centos 7 minimal,然后安装guest添加,请参阅下面的所有步骤

下载centos 7

游民初级/ 7

流浪了

流浪ssh

为虚拟框添加Guest添加

百胜更新

重启

流浪ssh

yum更新内核

重启

流浪ssh

yum groupinstall“开发工具”

yum安装kernel-devel

yum install wget

wget http://download.virtualBox.org/virtualBox/5.0.2/VBoxGuestAdditions_5.0.2.iso

sudo mkdir / media / VBoxGuestAdditions

sudo mount -o loop,ro VBoxGuestAdditions_5.0.2.iso / media / VBoxGuestAdditions

sudo sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run rm VBoxGuestAdditions_5.0.2.iso

sudo umount / media / VBoxGuestAdditions

sudo rmdir / media / VBoxGuestAdditions

sudo /etc/init.d/vBoxadd设置

sudo chkconfig –add vBoxadd

在sudo chkconfig vBoxadd上

出口

包装新箱子

流浪包 – 基础我的虚拟机

碰到同样的问题,但有一个不同的修复:我已经安装了dkms(Debian Jessie下的virtualBox-guest-dkms)。

事情是,模块«vBoxsf»没有自动加载,并且运行mount shared_directory不起作用( No such file or directory错误)。

但运行modprobe vBoxsf ,安装很好。

所以我编辑了/etc/modules和附加的vBoxsf在一个新行上:问题解决了!

注意:如果运行modprobe vBoxsf结束了错误,您没有安装vBoxsf模块,所以您应该首先安装DKMS模块。

当我得到同样的错误后,我做到了这一点:

$ vagrant ssh $ sudo apt-get update $ exit

然后安装vagrant-vbguest

$ vagrant plugin install vagrant-vbguest

然后

$ vagrant halt $ vagrant up

它的工作!

看看日志,似乎vagrant-vbguest在guest虚拟机(虚拟机)上添加了vbguest。

[default] GuestAdditions versions on your host (4.3.38) and guest (4.3.10) do not match. * Stopping VirtualBox Additions ...done. rmmod: ERROR: modulee vBoxsf is not currently loaded rmmod: ERROR: modulee vBoxguest is not currently loaded Reading package lists... Building dependency tree... Reading state information... The following packages will be REMOVED: virtualBox-guest-dkms* virtualBox-guest-utils* virtualBox-guest-x11* 0 upgraded,0 newly installed,3 to remove and 12 not upgraded. After this operation,12.1 MB disk space will be freed. (Reading database ... 113238 files and directories currently installed.) Removing virtualBox-guest-dkms (4.3.10-dfsg-1ubuntu5) ... Error! Could not locate dkms.conf file. File: does not exist. Removing virtualBox-guest-x11 (4.3.10-dfsg-1ubuntu5) ... Purging configuration files for virtualBox-guest-x11 (4.3.10-dfsg-1ubuntu5) ... Removing virtualBox-guest-utils (4.3.10-dfsg-1ubuntu5) ... Purging configuration files for virtualBox-guest-utils (4.3.10-dfsg-1ubuntu5) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Processing triggers for libc-bin (2.19-0ubuntu6.9) ... Reading package lists... Building dependency tree... Reading state information... dkms is already the newest version. linux-headers-3.13.0-91-generic is already the newest version. 0 upgraded,0 to remove and 12 not upgraded. copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the Box /tmp/VBoxGuestAdditions.iso mount: block device /tmp/VBoxGuestAdditions.iso is write-protected,mounting read-only Installing VirtualBox Guest Additions 4.3.38 - guest version is 4.3.10 Verifying archive integrity... All good. Uncompressing VirtualBox 4.3.38 Guest Additions for Linux............ VirtualBox Guest Additions installer copying additional installer modules ... Installing additional modules ... Removing existing VirtualBox DKMS kernel modules ...done. Removing existing VirtualBox non-DKMS kernel modules ...done. Building the VirtualBox Guest Additions kernel modules ...done. Doing non-kernel setup of the Guest Additions ...done. Starting the VirtualBox Guest Additions ...done.

PS我在OS X上使用以下软件版本:

$ vagrant plugin list solve (0.8.2) - Version Constraint: 0.8.2 vagrant-berkshelf (4.1.0) vagrant-hostmanager (1.5.0) - Version Constraint: 1.5.0 vagrant-hostsupdater (1.0.2) vagrant-omnibus (1.3.1) - Version Constraint: 1.3.1 vagrant-proxyconf (1.2.0) - Version Constraint: 1.2.0 vagrant-share (1.1.5,system) vagrant-vbguest (0.12.0) $ VBoxManage --version 4.3.38r106717 $ vagrant --version Vagrant 1.8.4

希望这可以帮助。

我曾经使用过Vagrant 1.8.1,VirtualBox 5.0.18,Chef 12.10.10主机MacOSX El Capitan和guest CentOS7。 我试图在guest虚拟机中安装kernel-devel,安装最新的GuestAdittions和更新yum,但是没有一个为我工作,所以我在自定义同步文件夹和厨师临时文件夹中更改了“nfs”的挂载类型, !

在Vagrantfile中,我的同步文件夹:

config.vm.synced_folder ".","/vagrant",type: "nfs"

和我的chef_solo配置:

chef.cookbooks_path = ["chef/cookbooks/"] chef.synced_folder_type = "nfs"

只需安装Vagrant插件vagrant-vbguest ,它可以保持您的VirtualBox Guest Additions是最新的。

vagrant plugin install vagrant-vbguest

VirtualBox 5.18修复了这个问题。 它存在于5.16中,不能用任何通常的方法修复。 最新版本5.18完美地工作。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐