I
I
Ivan Panteleev2014-07-25 11:37:29
PHP
Ivan Panteleev, 2014-07-25 11:37:29

How to deal with the nuances of working in Vagrant?

I am a web developer, I recently got acquainted with Vagrant, some issues have resolved themselves, but some still remain.

1. If I have several projects, does it mean that each of them should have its own virtual machine? If yes, then what about the space on the HDD, because one VM takes up about 2GB of space for me.

If it is possible to use one VM for several projects and distribute them there as vhosts, then it is not clear to me why this should be done if the very idea with which Vagrant should be used. Even the same PHPStorm assumes the presence of a separate VM for each project.

2. I encountered a not very pleasant situation when the working VM suddenly refused to work and revive me

ее не удалось. В логах консоли я наблюдал следующее:
==> 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 observe the lines:
default: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...

but only once, and then everything goes as it should, and so constantly. Everything would be fine, because of this, the initialization of the VM slows down very much. Is it possible to get rid of this somehow? And what is the reason for these warnings?

3. Is it possible to somehow remove the default directory forwarding in /vagrant ?

4. As for xdebug, it does not work if the x debug.remote_connect_back flag is not specified in the settings . This is not very good, as far as I understand, and therefore the question arises, how to make xdebug work fine in conjunction with vagrant?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurph, 2014-07-25
@shurph

On the first question: is it really a problem to allocate 2 gigabytes for a working tool in 2014?
On the second: try to turn off the virtual machine through vagrant halt. It seems that after an unsuccessful shutdown, the virtual machine hangs on the grub screen.
3: Probably, it can be done like this:
but I don't understand why?
4: try to use the option:
xdebug.remote_host = 10.0.2.2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question