El /var/www del invitado vagabundo se congela al hacer config.vm.synced

El /var/www del invitado vagabundo se congela al hacer config.vm.synced

Revisé toda la configuración de carpetas sincronizadas en el sitio web de Vagrant...

SO anfitrión: Windows 7 SO invitado: Ubuntu

esta es mi configuración de Vagrantfile:

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

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|  
    config.vm.box = "base"
    config.vm.hostname = "daison.vagrant.me"
    config.vm.network :forwarded_port, guest: 80, host: 8080
    config.vm.network :private_network, ip: "192.168.33.10"
    config.vm.synced_folder ".", "/vagrant", disabled: true
    #config.vm.synced_folder "C:\\Users\\daison\\vagrant\\src\\www", "/var/www"
end

yo también hagoC:\Users\daison\vagrant\> vagrant reload

Puedo acceder a mi Apache de Ubuntu ejecutando 127.0.0.1:8080 or 192.168.33.10 or daison.vagrant.me:8080--EN MI ANFITRIÓN

así que quitando el commented synced_foldery recargando nuevamente el vagabundo. Los resultados de todas las DIRECCIONES IP Y MI VIRTUALHOST SONINACCESIBLE--EN MI ANFITRIÓN

Intenté accedervagrant ssh

vagrant@daison: cd /var/www
vagrant@daison: /var/www$ ls

y no aparece nada...

También intenté crear un foldersolo para ver si la carpeta sincronizada realmente funciona incluso si congela la carpeta de invitados.

vagrant@daison: /var/www$ mkdir thisFolderWillAlsoShareToHost

Luego una carpeta en mi C:\Users\daison\vagrant\src\wwwcreadoEN MI ANFITRIÓN.


También intenté cambiar las carpetas sincronizadas para "/vagrant/sample"probar si /vagrant/samplese congelará lo mismo /var/www, después de recargar el vagabundo.

El resultado es; Puedo acceder al servidor web, por supuesto, no forma parte /var/www, pero el uso lsinterno /vagrant/sampletambién se congela.

¿Quizás alguien podría ayudar? ¡Gracias!

Respuesta1

Por la forma en que describe su problema, parece que creó algunos sitios web en su invitado, configuró una carpeta sincronizada y esperaba que vagabundo realizara una sincronización bidireccional entre el anfitrión y el invitado. Así no es cómo funciona. Lo que hace la habilitación de una carpeta sincronizada es montar una carpeta desde su host en su invitado. El contenido del anfitrión enmascara cualquier contenido existente en el invitado. Esto es lo que quiero decir:

Sin una carpeta sincronizada

> dir C:\Users\daison\vagrant\src\www
a_file_on_the host

$ ls /var/www
a_file_on_the_guest

Con esas carpetas sincronizadas.

> dir C:\Users\daison\vagrant\src\www
a_file_on_the host

$ ls /var/www
a_file_on_the host

Si creó un nuevo archivo desde el invitado mientras las carpetas estaban sincronizadas

> dir C:\Users\daison\vagrant\src\www
a_file_on_the host
file_created_while_synced

$ ls /var/www
a_file_on_the host
file_created_while_synced

Deshabilite la carpeta sincronizada y ahora verá

> dir C:\Users\daison\vagrant\src\www
a_file_on_the host
file_created_while_synced

$ ls /var/www
a_file_on_the_guest

Entonces, si sus sitios web se crearon como invitado, ya no estarán disponibles mientras sincroniza/var/www. Por eso el servidor web se "congela".

información relacionada