KZiovas
KZiovas

Reputation: 4709

VirtualBox VM does not acquire defined IP address specified with Vagrant

So I have this Vagrant file:

# -*- mode: ruby -*-

# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  
  #Box settings
  config.vm.box = "ubuntu/bionic64"
  config.vm.hostname = "vagrant.demo"

  #Networks settings
  # config.vm.network "forwarded_port", guest: 22, host: 2222
  # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
  config.vm.network "private_network", ip: "192.168.56.4"
  # config.vm.network "public_network"
  
  #Provider settings
  config.vm.provider "virtualbox" do |vb|
    vb.memory = 2048
    vb.cpus = 2  
    vb.name = "vagrant.demo"

  end

after I execute my vagrant up command I ssh into the vm with vagrant ssh and check to see if the vm has the defined IP adress but I only see this :

Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-173-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Thu Mar 31 14:39:57 UTC 2022

  System load:  0.24              Processes:             106
  Usage of /:   2.8% of 38.71GB   Users logged in:       0
  Memory usage: 8%                IP address for enp0s3: 10.0.2.15
  Swap usage:   0%

The 192.168.56.4 ip address is not shown as expected. Any idea what is missing?

I use Vagrant 6.1.32 on Ubuntu 20.04.3.

Upvotes: 0

Views: 436

Answers (1)

KZiovas
KZiovas

Reputation: 4709

So the solution was to downgrade to VirtualBox 6.1.26. See the discussion here

Upvotes: 2

Related Questions