How to find the Vagrant IP?

前端 未结 12 1294
余生分开走
余生分开走 2021-01-30 08:17

I have been developing an automated deployment using Capistrano and using Vagrant as my test virtual server.

The thing is, I need the IP of Vagrant to \"ssh

12条回答
  •  长情又很酷
    2021-01-30 09:05

    Because I haven't seen it here yet... When you vagrant ssh into the box, I realized it actually tells you the ip addresses of the interfaces. You can get it there. For example.

     {~/Documents/jupyterhub-ansible} (features *%)$  vagrant ssh
    Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-50-generic x86_64)
    
     * Documentation:  https://help.ubuntu.com
     * Management:     https://landscape.canonical.com
     * Support:        https://ubuntu.com/advantage
    
      System information as of Wed May 22 12:00:34 UTC 2019
    
      System load:  0.12              Processes:             101
      Usage of /:   56.5% of 9.63GB   Users logged in:       0
      Memory usage: 19%               IP address for enp0s3: 10.0.2.15
      Swap usage:   0%                IP address for enp0s8: 192.168.33.10
    
    
    10 packages can be updated.
    1 update is a security update.
    
    
    Last login: Wed May 22 12:00:04 2019 from 192.168.33.1
    vagrant@ubuntu-bionic:~$ 
    

    In my vagrant file I assigned the address like this:

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

    and as you can see, IP address for enp0s8: 192.168.33.10

提交回复
热议问题