【问题标题】:Install/Update cifs-utils before mount smb在挂载 smb 之前安装/更新 cifs-utils
【发布时间】:2016-06-24 10:24:06
【问题描述】:

我目前正在尝试让 Vagrant 使用 Hyper-V 在 Windows10 上配置工作的 CentoOS7 映像。 Vagrant 1.8.4,当前最新。

我遇到了一个配置失败的问题,我每次都需要解决。 CentOS7 镜像是最小镜像并且不包括cifs-utils,因此挂载将无法工作。所以,我需要在挂载之前安装cifs-utils

错误:

==> default: Mounting SMB shared folders...
    default: C:/Programs/vagrant_stuff/centos7 => /vagrant
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 cifs -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3`,sec=ntlm,credentials=/etc/smb_creds_4d99b2
d500a1bcb656d5a1c481a47191 //192.168.137.1/4d99b2d500a1bcb656d5a1c481a47191 /vagrant
mount -t cifs -o uid=`id -u vagrant`,gid=`id -g vagrant`,sec=ntlm,credentials=/etc/smb_creds_4d99b2d500a1bcb656d5a1c481a
47191 //192.168.137.1/4d99b2d500a1bcb656d5a1c481a47191 /vagrant

The error output from the last command was:

mount: wrong fs type, bad option, bad superblock on //192.168.137.1/4d99b2d500a1bcb656d5a1c481a47191,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

就像现在一样,配置必须失败,我需要:

vagrant ssh (powershell)

(通过 putty/ssh 连接到实例)

sudo yum install cifs-utils -y (putty/ssh)

(等待安装...)

exit (putty/ssh)

vagrant reload --provision (powershell)

这显然很痛苦,我正在努力简化流程。

有人知道更好的方法吗?

【问题讨论】:

    标签: linux powershell ssh vagrant hyper-v


    【解决方案1】:

    您可以在您的盒子和repackage此盒子中安装缺少的软件包,这样您就可以分发包含缺失软件包的此盒子的新版本。

    【讨论】:

    • 我考虑过这种方法,因为我使用的是 Atlas 的盒子。我已经尝试了这两个盒子并看到了同样的问题:serveit/centos-7bluefedora/hyperv-alpha-centos7
    • 您可以做的是在安装缺少的软件包后重新打包盒子并在图集上发布为新盒子
    • 我设法重新打包并上传了更新版本。感谢您的建议。它在 Atlas 中以"KptnKMan/bluefhypervalphacentos7repack" 的形式提供。 :) @frédéric-henri
    • 好,如果有用请随时upvote
    【解决方案2】:

    为了提供 vagrant box,您需要从 iso 创建它。在准备盒子时,您可以为您安装所有需要的软件包。在您的情况下,它是 Hyper-v - https://www.vagrantup.com/docs/hyperv/boxes.html

    最好的问候

    【讨论】:

    • 目前我没有使用 ISO 创建自己的盒子,但我想很快我可能会在制作自己的盒子并将其上传到 Atlas 上有所突破。这对我来说似乎是一个恼人的错误,而且似乎只是缺少预先需要的二进制文件。
    【解决方案3】:

    显然,由于某种原因,我最初的问题被否决了。 #随便

    正如我在上面的其中一个 cmets 中提到的:

    我设法重新打包并上传了更新版本。感谢您的建议。它在 Atlas 中以"KptnKMan/bluefhypervalphacentos7repack" 的形式提供。

    特别感谢@frédéric-henri :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-22
      • 2022-01-23
      • 2011-04-15
      相关资源
      最近更新 更多