在win10上使用`vagrant up`的时候报错

发布于 2022-09-05 23:43:43 字数 2699 浏览 11 评论 0

在win10 x64上安装好vagrant 2.0.0,VirtualBox 5.1.28,
下载好vagrant box : centos7 v1708.01(https://app.vagrantup.com/cen...

Vagrantfile是这样的:

# -*- mode: ruby -*-
# vi: set ft=ruby :


Vagrant.configure("2") do |config|

  config.vm.box = "base"
  config.vm.network "forwarded_port", guest: 80, host: 8080
  config.vm.synced_folder "www", "/var/www"

end

已经安装vagrant-vbguest插件:

$ vagrant plugin install vagrant-vbguest

运行vagrant up,报错:

dell@DESKTOP-OKFHT30 MINGW64 /d/vagrant_env
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> 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: 80 (guest) => 8080 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> 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: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
[default] GuestAdditions 5.1.28 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Rsyncing folder: /d/vagrant_env/ => /vagrant
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /d/vagrant_env/
Guest path: /vagrant
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 LogLevel=FATAL   -o IdentitiesOnly=yes -o StrictHostKeyCheck                                                                       ing=no -o UserKnownHostsFile=/dev/null -i 'D:/vagrant_env/.vagrant/machines/default/virtualbox/private_key'" "--exclud                                                                       e" ".vagrant/" "/d/vagrant_env/" "vagrant@127.0.0.1:/vagrant"
Error: This rsync lacks old-style --compress due to its external zlib.  Try -zz.
Continuing without compression.

rsync: change_dir "/d/vagrant_env" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]

好像是rsync的什么问题,应该怎么做呢?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦亿 2022-09-12 23:43:43

您好,我也遇到了,怎么解决的呢

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文