How to deal with the nuances of work in Vagrant?

I'm a web developer, recently met with Vagrant, some issues have withdrawn, but some still remained.

1. If I have several projects, it is assumed that each should have its own virtual machine? If Yes, then what about the space on HDD, because I have one VM is around 2GB.

If you can use a single VM for multiple projects and distribute them there as vhosts, I do not understand why do it if the idea is to use Vagrant. Even the same PHPStorm provides a separate VM under every project.

2. I was faced with a not very pleasant situation when the VM suddenly refused to work and revive me
it was not possible. In the log console I observed the following:
==> 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: Warning: Connection timeout. Retrying...
 default: Warning: Remote connection disconnect. Retrying...
 default: Warning: Remote connection disconnect. Retrying...
 default: Warning: Remote connection disconnect. Retrying...


now I also see the line:
default: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...

but only once, and then everything goes as it should, and so on. All would be nothing, because of this the initialization of the VM is very much slower. It is possible it somehow to get rid of? And what is the cause of these warnings?

3. Is there a way to remove the default forwarding directory to /vagrant?

4. As for the work of xdebug, it does not work if the settings do not specify the x flagto debug.remote_connect_back. It's not very good, as far as I understand, and therefore, the question arises how to make xdebug work fine in conjunction with vagrant?
September 26th 19 at 11:47
1 answer
September 26th 19 at 11:50
On the first question: is it in 2014 is a challenge to allocate to the working tool 2 gigabytes?

Second: try to turn off dev via vagrant halt. It seems, after an unsuccessful shutdown the virtual reality and you could put it on the screen and grub'.

3: it can be done like this:
config.vm.synced_folder "./", "/vagrant", disabled: true

but I don't understand why.

4: try to use the option:
xdebug.remote_host = 10.0.2.2
is it possible to share vagrant-dev in a local network? - beryl.Hartmann commented on September 26th 19 at 11:53
: try this variant: https://docs.vagrantup.com/v2/networking/public_ne... - salma_Casp commented on September 26th 19 at 11:56

Find more questions by tags PHPUbuntu ServerVirtual machine