gpt4 book ai didi

windows - 在运行 CoreOS VM 的 vagrant 上使用 rsync

转载 作者:可可西里 更新时间:2023-11-01 13:28:08 26 4
gpt4 key购买 nike

我正在使用运行 vagrant 和 cygwin 的 rsync 的 Windows 8.1 Pro 电脑。

我是这样配置的:

config.vm.synced_folder "../sharedFolder", "/vagrant_data", type: "rsync"

当我执行 vagrant up 时,出现以下错误:

C:\dev\vagrantBoxes\coreOS>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'yungsang/coreos' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: core
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Rsyncing folder: /c/dev/vagrantBoxes/sharedFolder/ => /vagrant_data
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /c/dev/vagrantBoxes/sharedFolder/
Guest path: /vagrant_data
Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/d
ev/null -i 'C:/Users/aaron.axisa/.vagrant.d/insecure_private_key' --exclude .vagrant/ /c/dev/vagrantBoxes/sharedFolder/ core@127.0.0.1:/vagrant_data
Error: Warning: Permanently added '[127.0.0.1]:2222' (RSA) to the list of known hosts.
rsync: change_dir "/c/dev/vagrantBoxes/sharedFolder" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at /usr/src/ports/rsync/rsync-3.0.9-1/src/rsync-3.0.9/main.c(1052) [sender=3.0.9]

我认为它是如何将目录路径更改为/c/dev 而不是 C:\dev 的问题

最佳答案

就像我在 github-issue 中评论的那样,你的 Vagrantfile 中的以下行肯定会解决你的问题

ENV["VAGRANT_DETECTED_OS"] = ENV["VAGRANT_DETECTED_OS"].to_s + "cygwin"

因为这是在你的 Vagrantfile 中的本地文件,源文件可以保持不变

关于windows - 在运行 CoreOS VM 的 vagrant 上使用 rsync,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25687808/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com