Private IPs no longer working?

I set up a multi-machine setup with private IP addresses, and it doesn’t seem to be working anymore. I am using Virtualbox.

Vagrant.configure("2") do |config|
    # Puppet Master node
    config.vm.define "puppetserver01" do |puppetserver|
      puppetserver.vm.box = "generic/ubuntu2204"
      puppetserver.vm.hostname = "puppetserver01.local"
      puppetserver.vm.network "private_network", ip: "192.168.50.4"   
    end
  
    # Node 1
    config.vm.define "node01" do |node01|
      node01.vm.box = "generic/ubuntu2204"
      node01.vm.hostname = "node01.local"
      node01.vm.network "private_network", ip: "192.168.50.5"
    end
  
    # Node 2
    config.vm.define "node02" do |node02|
      node02.vm.box = "generic/ubuntu2204"
      node02.vm.hostname = "node02.local"
      node02.vm.network "private_network", ip: "192.168.50.6"
    end
  end

Before on other systems on GCE or EC2, the hostname -i returned back the IP address, but Vagrant configures 127.0.2.1, which I guess is sort of a localhost for this?

$ hostname -i
127.0.2.1
$ tail -1 /etc/hosts
127.0.2.1 puppetserver01.local puppetserver01