chef / bento

Packer templates for building minimal Vagrant baseboxes for multiple platforms

Home Page:http://chef.github.io/bento

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image [Bento/Ubuntu-22.04] - parallels provider ip address assignment

rderik opened this issue · comments

commented

There seems to be an configuration error on the bento/ubuntu-22.04 image:

https://app.vagrantup.com/bento/boxes/ubuntu-22.04

Every time I try to create a new VM using Vagrant with the Parallels provider.

Describe the problem

When I try to create a VM using vagrant with the bento/ubuntu-22.04 image, the VM gets the same IP, the DHCP lease is never renewed. I can go manually and release and get a new IP but every VM I create has the same issue.

Software Version

macOS 13.2.1

Replication Case

BOX_IMAGE = "bento/ubuntu-22.04"
NODE_COUNT = 2

Vagrant.configure("2") do |config|
  config.vm.define "master" do |subconfig|
    subconfig.vm.box = BOX_IMAGE
    subconfig.vm.hostname = "master"
    #subconfig.vm.network :private_network, ip: "10.211.55.40"
    #subconfig.vm.network :private_network, ip: "10.0.0.10"
    #subconfig.vm.network :private_network, type: "dhcp"
    #subconfig.vm.network :public_network
    subconfig.vm.provider "parallels" do |vb|
      vb.name = "master"
      vb.update_guest_tools = true
      vb.linked_clone = false
    end
  end
  
  (1..NODE_COUNT).each do |i|
    config.vm.define "node#{i}" do |subconfig|
      subconfig.vm.box = BOX_IMAGE
      subconfig.vm.hostname = "node#{i}"
      #subconfig.vm.network :private_network, ip: "10.0.0.#{i+10}"
      #subconfig.vm.network :private_network, ip: "10.211.55.#{i+40}"
      #subconfig.vm.network :private_network, type: "dhcp"
      #subconfig.vm.network :public_network
      subconfig.vm.provider "parallels" do |vb|
        vb.name = "node#{i}"
        vb.update_guest_tools = true
        vb.linked_clone = false
      end
    end
  end
end

I left commented out other attempts to get the network to work correctly.

All of those options work if we use the bento/ubuntu-20.04 image.

I checked the /etc/netplan directory and the 22.04 image has:

$ ls /etc/netplan/
00-installer-config.yaml  01-netcfg.yaml
$ cat /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
  ethernets:
    enp0s5:
      dhcp4: true
  version: 2
$ cat /etc/netplan/01-netcfg.yaml
network:
  version: 2
  ethernets:
    eth0:
      dhcp4: true

This is how it looks on 20.04:

$ ls /etc/netplan/
01-netcfg.yaml
$ cat /etc/netplan/01-netcfg.yaml
network:
  version: 2
  ethernets:
    eth0:
      dhcp4: true

Not sure it has something to do with netplan but I'm adding it here for reference.

Not related to Linked Clone, I tried both Linked Clone and full VM and the issue persists.

Stacktrace

Not much error message, but if I try to go directly to the VM not via the network, I check and all the VMs have the same IP assigned. So that causes issues with trying to login via SSH.

``` ```

Possible Solution

Maybe something with /etc/netplan

The root cause is /etc/machine-id is being shared between VMs. This is a factor in DHCP requests and can cause VMs to all have the same IP. This is fixed by #1471, but hasn't been released yet. Also see #1473 and #1421.

commented

Thanks @sford ! I'll keep an eye for the new release

Found the same issue in latest release of forked luminositylabsllc/bento-ubuntu-22.04. Is there any final workaround for it?