linux – Vagrant – 如何挂载virtualbox共享文件夹? (“vboxsf”不可用)

linux – Vagrant – 如何挂载virtualbox共享文件夹? (“vboxsf”不可用),第1张

概述我有以下错误: 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 an 我有以下错误:

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 attempted
was:

ID -u vagrant

The error output from the command was:

ID: ‘vagrant’: no such user

所以我试着寻找解决方案.我看过很多人说需要一个特殊的vbguest vagrant插件然后运行vagrant并且在ssh中应该修改另外的vbguest.

所以我做了以下步骤:

$vagrant plugin install vagrant-vbguest
然后添加了插件:

Installing the ‘vagrant-vbguest’ plugin. This can take a few
minutes… Installed the plugin ‘vagrant-vbguest (0.13.0)’!

$vagrant up

$vagrant ssh

$sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib / VBoxGuestAdditions
这不打印任何消息,所以我认为这是正确的.
然后我重新加载了流浪汉.

$vagrant reload

不幸的是,我又错了.

$vagrant reload==> Project-Yii: Attempting graceful shutdown of VM...==> Project-Yii: Clearing any prevIoUsly set forwarded ports...==> Project-Yii: Clearing any prevIoUsly set network interfaces...==> Project-Yii: Preparing network interfaces based on configuration...    Project-Yii: Adapter 1: nat    Project-Yii: Adapter 2: hostonly==> Project-Yii: Forwarding ports...    Project-Yii: 22 (guest) => 2222 (host) (adapter 1)==> Project-Yii: Running 'pre-boot' VM customizations...==> Project-Yii: Booting VM...==> Project-Yii: Waiting for machine to boot. This may take a few minutes...    Project-Yii: SSH address: 127.0.0.1:2222    Project-Yii: SSH user@R_502_6889@: ubuntu    Project-Yii: SSH auth method: password    Project-Yii: Warning: Remote connection disconnect. retrying...==> Project-Yii: Machine booted and ready![Project-Yii] GuestAdditions 5.1.14 running --- OK.==> Project-Yii: Checking for guest additions in VM...==> Project-Yii: Setting host@R_502_6889@...==> Project-Yii: Configuring and enabling network interfaces...==> Project-Yii: Mounting shared folders...    Project-Yii: /app => /home/xxx/Projects/project-shopVagrant was unable to mount VirtualBox shared folders. This is usuallybecause the filesystem "vBoxsf" is not available. This filesystem ismade available via the VirtualBox Guest Additions and kernel module.Please verify that these guest additions are properly installed in theguest. This is not a BUG in Vagrant and is usually caused by a faultyVagrant Box. For context,the command attempted was:ID -u vagrantThe error output from the command was:ID: 'vagrant': no such user

当然,当我删除流浪者并再次运行流浪汉并从草图重新加载时,我尝试了这种情况,但同样的问题.
是的,我也尝试过vagrant-hostmanager插件(这是在yii文档中,但同样的问题)

这是我的流浪文件,也许它对你有用.

require 'yaml'require 'fileutils'domains = {  frontend: 'frontend-yii.com',backend:  'backend-yii.com'}config = {  local: './vagrant/config/vagrant-local.yml',example: './vagrant/config/vagrant-local.example.yml'}# copy config from example if local config not existsfileUtils.cp config[:example],config[:local] unless file.exist?(config[:local])# read configoptions = YAML.load_file config[:local]# check github tokenif options['github_token'].nil? || options['github_token'].to_s.length != 40  puts "You must place REAL GitHub token into configuration:\n/project-yii/vagrant/config/vagrant-local.yml"  exitend# vagrant configurateVagrant.configure(2) do |config|  # select the Box  config.vm.Box = 'ubuntu/xenial64'  # should we ask about Box updates?  config.vm.Box_check_update = options['Box_check_update']  config.vm.provIDer 'virtualBox' do |vb|    # machine cpus count    vb.cpus = options['cpus']    # machine memory size    vb.memory = options['memory']    # machine @R_502_6889@ (for VirtualBox UI)    vb.@R_502_6889@ = options['machine_@R_502_6889@']  end  # machine @R_502_6889@ (for vagrant console)  config.vm.define options['machine_@R_502_6889@']  # machine @R_502_6889@ (for guest machine console)  config.vm.host@R_502_6889@ = options['machine_@R_502_6889@']  # network settings  config.vm.network 'private_network',ip: options['ip']  # sync: folder 'yii2-app-advanced' (host machine) -> folder '/app' (guest machine)  config.vm.synced_folder './','/app',owner: 'vagrant',group: 'vagrant'  # disable folder '/vagrant' (guest machine)  config.vm.synced_folder '.','/vagrant',Disabled: true  # hosts settings (host machine)  config.vm.provision :hostmanager  config.hostmanager.enabled            = true  config.hostmanager.manage_host        = true  config.hostmanager.ignore_private_ip  = false  config.hostmanager.include_offline    = true  config.hostmanager.aliases            = domains.values  # provisioners  config.vm.provision 'shell',path: './vagrant/provision/once-as-root.sh',args: [options['timezone']]  config.vm.provision 'shell',path: './vagrant/provision/once-as-vagrant.sh',args: [options['github_token']],privileged: false  config.vm.provision 'shell',path: './vagrant/provision/always-as-root.sh',run: 'always'  # post-install message (vagrant console)  config.vm.post_up_message = "Frontend URL: http://#{domains[:frontend]}\nBackend URL: http://#{domains[:backend]}"end

我的流浪汉版本是1.9.1,我的VirtualBox版本是5.1.14 r112924(最新的)

somebady有同样的问题吗?我应该采取哪些其他步骤来解决这个问题?

解决方法 它对我来说是5.1.18.

https://www.virtualbox.org/wiki/Changelog 5.1.18修正了以下看似相关的问题:

>共享文件夹:固定不区分大小写的文件名访问(5.1.16
回归;仅限windows用户; BUG#16549)
>共享文件夹:已修复
访问长路径(5.1.16回归;仅限windows客户;错误

14651,#16564)

总结

以上是内存溢出为你收集整理的linux – Vagrant – 如何挂载virtualbox共享文件夹? (“vboxsf”不可用)全部内容,希望文章能够帮你解决linux – Vagrant – 如何挂载virtualbox共享文件夹? (“vboxsf”不可用)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1019436.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存