Tag: Vagrant

  • Vagrant  private_network can’t ping

    Vagrant private_network can’t ping

    When I create Vagrant virtual machine with private networking, I can’t ping to IP address of the VM. The only way to connect the VM is by using the “vagrant ssh” command.

    In my Vagrantfile, I had

    Vagrant.configure("2") do |config|
      config.vm.box = "bento/ubuntu-20.04"
      config.vm.network "private_network", ip: "192.168.56.4"
    end
    

    To fix the problem, first verify you have vboxnet0 network interface with the command

    ip link
    

    If the state of the vboxnet0 network interface is DOWN, make it UP with the command

    sudo ip link set vboxnet0 up
    

    Go to VirtualBox > File > Host Network Manager or press CTRL + H

    VirtualBox Host Network manager

    Verify vboxnet0 is set properly. You can delete it and create it again using “Host Network Manager”, which will fix any problem with the network.

    Make sure the IP you specify in Vagrantfile is in the same range set for the vboxnet0 interface in VirtualBox Host Network manager.

  • Install Vagrant on CentOS

    To install Vagrant on CentOS, go to

    https://www.vagrantup.com/downloads

    Get link to latest version, then run “rpm -ivh URL_TO_RPM_FILE”.

    At time of writing this post, latest Vagrant version is 2.2.9, to install Vagrant 2.2.9, run

    rpm -ivh https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.rpm
    

    install vagrant on centos

    To check Vagrant version

    vagrant --version
    

    See Vagrant

  • Vagrant

    Vagrant allows you to quickly create virtual machines.

    You can download vagrant boxes from

    https://app.vagrantup.com/boxes/search
    Vagrant private_network can’t ping

    Install Vagrant

    Install vagrant in Debian/Ubuntu

    apt install vagrant -y
    

    You may also need to install virtualbox

    apt install virtualbox
    

    Using Vagrant

    To update vagrant boxes, run

    vagrant box update
    

    To list all available vagrant boxes

    vagrant box list
    

    Snapshot

    To create a snapshot

    vagrant snapshot save first-snapshot
    

    To list available snapshots

    vagrant snapshot list