From 395ab7141e2e9f4ec2ad26523108154dc1401e45 Mon Sep 17 00:00:00 2001 From: Wong Hoi Sing Edison Date: Wed, 16 Dec 2020 20:45:07 +0800 Subject: [PATCH] Fix Broken `/etc/machine-id` by `vagrant package` due to virt-sysprep's `customize` operation (#1184) virt-sysprep by default enable the `customize` operation, which will regenerate the `/etc/machine-id` by the end of the operation. This cause all newly created VMs by `vagrant up` coming with idential `/etc/machine-id` and so receive conflicted IP from DHCP. This PR disable `customize` as per https://github.com/vagrant-libvirt/vagrant-libvirt/issues/851#issuecomment-520799720 recommendation. Fixes #851 --- lib/vagrant-libvirt/action/package_domain.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant-libvirt/action/package_domain.rb b/lib/vagrant-libvirt/action/package_domain.rb index e46d54e..b23bcff 100644 --- a/lib/vagrant-libvirt/action/package_domain.rb +++ b/lib/vagrant-libvirt/action/package_domain.rb @@ -50,7 +50,7 @@ module VagrantPlugins # remove hw association with interface # working for centos with lvs default disks options = ENV.fetch('VAGRANT_LIBVIRT_VIRT_SYSPREP_OPTIONS', '') - operations = ENV.fetch('VAGRANT_LIBVIRT_VIRT_SYSPREP_OPERATIONS', 'defaults,-ssh-userdir') + operations = ENV.fetch('VAGRANT_LIBVIRT_VIRT_SYSPREP_OPERATIONS', 'defaults,-ssh-userdir,-customize') `virt-sysprep --no-logfile --operations #{operations} -a #{@tmp_img} #{options}` # add any user provided file extra = ''