Vagrant shared access between team

Asked

Viewed 551 times

1

Setting:

  • Two machines (A and B), both on the same local network and with Vagrant and virtualbox installed. One is Windows and the other is mac
  • On machine A I have a box Homestead (Laravel/Homestead) with all my ambisnte.

Problem

I need machine B to access the box folders and URL of machine A. Here’s what I’ve tried to do that won’t answer me:

  • Vagrant share --ssh. Does not answer me because it drops after an hour
  • Vagrant package and publish the environment.
    • It doesn’t suit me because I don’t want other developers to have to climb up a box on their own machines
  • Copy vagrantfile or environment to other machines and Vagrant up.
    • Do not answer me for the reason mentioned above

Below follows in detail what I have already done .

Solution - SHARE --SSH

Running these 3 commands as documentation I managed to achieve the goal:

  • Share
  • connect
  • ssh

Juice:

Machine A:

vagrant login
vagrant share --ssh

Machine B:

vagrant connect --ssh 

Everything worked out. But this solution does not answer me because the connection drops after an hour as documentation: security share

Solution - Package or copy Vagrantfile environment

Solutions through box publishing on hashicorp

vagrant package

or by copying the environment (vagrantfile) to then give a

vagrant up # na máquina B

They don’t answer me either.

Suggestions

Does anyone have any suggestions to help me?

I would like to leave the machine A always on so that the developers' machine B, C or D access it through an IP or something like that.

I wonder if I can do this through Private_network or Public_network vagrantfile?

Someone who knows these resources and has already done something similar can help me, please.

Thanks a lot.

1 answer

0

Then, just use a private network ("private_network") and a public key for access via SSH. For this, you would write in Vagrantfile:

config.vm.network :private_network, ip: "58.147.128.0"

On the machine that will be accessed, it is necessary to add the public key of the machines that will access it in the ~/. ssh/authorized_keys file. This is a form of authentication, you could also use a user and password, but I find the use of the public key safer by not exposing credentials. Some ways to set up remote access to a linux server are in this article.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.