Windows和无所事事的Mac VM之间的同步文件夹

时间:2018-11-27 23:59:40

标签: vagrant vagrant-windows

有人用流浪汉在Windows 10(主机)和Mac OS X(vm)之间设置了同步文件夹吗?我正在使用AndrewDryga Mac VM,并且正在尝试使用smb *配置同步的文件夹。

我在Vagrantfile中添加了以下内容:

      config.vm.synced_folder "ws", "/vagrant", type: "smb"

安装同步文件夹(IP屏蔽)时出现以下错误:

    ==> default: Mounting SMB shared folders...
default: D:/vms/mac/ws => /vagrant
    The following SSH command responded with a non-zero exit status.
    Vagrant assumes that this means the command failed!
    mount -t smbfs '//lidia:*****@xx.xxx.xxx.xxx/vgt-f34837fcc925bd86a5640db86adf842e-6ad5fdbcbf2eaa93bd62f92333a2e6e5' /vagrant
    Stdout from the command:

    Stderr from the command:

    mount_smbfs: URL parsing failed, please correct the URL and try again: Invalid argument

如何解决以上问题?

由于vm启动正常,我尝试直接在vm上安装,并使用类似的命令正常工作,该命令从上面的错误消息复制而来,但在命令行上提供了密码:

    vagrant:~ vagrant$ mount -t smbfs '//lidia@xx.xxx.xxx.xxx/vgt-f34837fcc925bd86a5640db86adf842e-6ad5fdbcbf2eaa93bd62f92333a2e6e5' /vagrant
    Password for xx.xxx.xxx.xxx:
    vagrant:~ vagrant$ 

我还尝试在虚拟机上安装时以明文形式提供密码(只是为了对其进行测试),例如:'//lidia:@xx.xxx.xxx.xxx ...',并且效果很好太。为什么在无所事事的虚拟机启动期间失败?任何指针如何修复它都表示赞赏,但是,我不想在Vagrantfile中以明文形式输入密码。

*我正在使用smb,因为在此Mac虚拟机的常见问题中有以下说明:

    VirtualBox doesn't have Guest additions for Mac OS X, so you can't have shared folders. Instead you can use normal network shared folders (docs): 
    # Use NFS for the shared folder 
    config.vm.synced_folder ".", "/vagrant", id: "core", :nfs => true,
        :mount_options => ['nolock,vers=3,udp,noatime'] 

但是nfs在Windows上不起作用(在Windows上也没有rsync)。

0 个答案:

没有答案