Install/Update 挂载 smb 之前的 cifs-utils

Install/Update cifs-utils before mount smb

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

我遇到了配置失败的问题,我每次都需要解决方法。 CentOS7 映像是最小映像,不包含 cifs-utils,因此挂载将无法工作。所以,我需要在 mount.

之前安装 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)

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

有没有人知道更好的方法?

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

此致

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

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

正如我在上面的评论之一中提到的:

我设法重新打包并上传了更新版本。谢谢你的建议。它在 Atlas 中以 "KptnKMan/bluefhypervalphacentos7repack".

的形式提供

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