Я пытался использовать коробку debian/stretch64 от Vagrant, но его синхронизация в реальном времени не работает.

Вот код моего Vagrantfile:

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

HOSTNAME = "DebianStretch64"
VB_NAME = "DebianStretch64"

Vagrant.configure("2") do |config|
  config.vm.hostname = HOSTNAME
  config.vm.box = "debian/stretch64"
  config.vm.define VB_NAME

    config.vm.provider "virtualbox" do |vb|
        vb.name = VB_NAME
    end

end

Когда я запускаю vagrant на моей Windows 10, я получаю:

PS C:\Users\Home\code\vagrantfiles\debian_stretch64> vagrant up
Bringing machine 'DebianStretch64' up with 'virtualbox' provider...
==> DebianStretch64: Importing base box 'debian/stretch64'...
==> DebianStretch64: Matching MAC address for NAT networking...
==> DebianStretch64: Checking if box 'debian/stretch64' is up to date...
==> DebianStretch64: Setting the name of the VM: DebianStretch64
==> DebianStretch64: Fixed port collision for 22 => 2222. Now on port 2200.
==> DebianStretch64: Clearing any previously set network interfaces...
==> DebianStretch64: Preparing network interfaces based on configuration...
    DebianStretch64: Adapter 1: nat
==> DebianStretch64: Forwarding ports...
    DebianStretch64: 22 (guest) => 2200 (host) (adapter 1)
==> DebianStretch64: Running 'pre-boot' VM customizations...
==> DebianStretch64: Booting VM...
==> DebianStretch64: Waiting for machine to boot. This may take a few minutes...
    DebianStretch64: SSH address: 127.0.0.1:2200
    DebianStretch64: SSH username: vagrant
    DebianStretch64: SSH auth method: private key
    DebianStretch64:
    DebianStretch64: Vagrant insecure key detected. Vagrant will automatically replace
    DebianStretch64: this with a newly generated keypair for better security.
    DebianStretch64:
    DebianStretch64: Inserting generated public key within guest...
    DebianStretch64: Removing insecure key from the guest if it's present...
    DebianStretch64: Key inserted! Disconnecting and reconnecting using new SSH key...
==> DebianStretch64: Machine booted and ready!
==> DebianStretch64: Checking for guest additions in VM...
    DebianStretch64: No guest additions were detected on the base box for this VM! Guest
    DebianStretch64: additions are required for forwarded ports, shared folders, host only
    DebianStretch64: networking, and more. If SSH fails on this machine, please install
    DebianStretch64: the guest additions and repackage the box to continue.
    DebianStretch64:
    DebianStretch64: This is not an error message; everything may continue to work properly,
    DebianStretch64: in which case you may ignore this message.
==> DebianStretch64: Setting hostname...
==> DebianStretch64: Installing rsync to the VM...
==> DebianStretch64: Rsyncing folder: /cygdrive/c/Users/Home/code/vagrantfiles/debian_stretch64/ => /vagrant

==> DebianStretch64: Machine 'DebianStretch64' has a post `vagrant up` message. This is a message
==> DebianStretch64: from the creator of the Vagrantfile, and not from Vagrant itself:
==> DebianStretch64:
==> DebianStretch64: Vanilla Debian box. See https://app.vagrantup.com/debian for help and bug reports

Внутри этого бродяги я создаю новый файл test.txt в папке /vagrant vagrant:

PS C:\Users\Home\code\vagrantfiles\debian_stretch64> vagrant ssh
Linux DebianStretch64 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
vagrant@DebianStretch64:~$ cd /vagrant/
vagrant@DebianStretch64:/vagrant$ touch test.txt
vagrant@DebianStretch64:/vagrant$ ls
playbook.yaml  test.txt  Vagrantfile

Однако я не могу найти файл test.txt в папке, содержащей Vagrantfile . Когда я использую Ubuntu/Xenial64 , я не испытываю этой проблемы. У кого-нибудь есть идеи, как это решить?

С Уважением,

1 ответ1

0

Если вам нужна функциональность общих папок Virtualbox для коробок Debian, вам необходимо использовать блоки debian/contrib-stretch64

Общая папка Virtualbox отключена в debian/stretch64, поскольку для добавления определенных битов virtualbox требуется не пакет с открытым исходным кодом.

Это задокументировано здесь:https://app.vagrantup.com/debian

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .