hashicorp / packer-plugin-vagrant

Packer plugin for Vagrant
https://packer.io
Mozilla Public License 2.0
13 stars 24 forks source link

/etc/default/grub is overwritten during post-processor #40

Closed midoriiro closed 2 years ago

midoriiro commented 2 years ago

Overview of the Issue

file located at /etd/default/grub is overwritten when vagrant post-processor is executed If a run my VM manually (I specified to do not remove my VM) my grub settings are correct. If a run my box into vagrant, my grub settings are not set.

I don't know if that is caused by this plugin or vagrant itself. But for now I open an issue here.

Reproduction Steps

Create an VM with VMWare Workstation Pro 16.2.1 build 18811642 (debian net install 11.1.0 in my case)

VMWare specific configuration:

vmx_data          = {
  "firmware"   = "efi"
  "vhv.enable" = "TRUE"
}

VMWare Workstation is configured with default hardware compatibility set to: Workstation 16.2.x

Part of my shell script that edit /etc/default/grub

echo "  * Disable wait in grub menu"
sudo sed -i 's/^GRUB_TIMEOUT=5/GRUB_TIMEOUT=0/' /etc/default/grub > /dev/null
sudo echo "GRUB_HIDDEN_TIMEOUT=0" | sudo tee -a /etc/default/grub > /dev/null
sudo echo "GRUB_HIDDEN_TIMEOUT_QUIET=true" | sudo tee -a /etc/default/grub > /dev/null
sudo update-grub

Use vagrant post-processor this way

post-processor "vagrant" {
    keep_input_artifact = true
    output  = "path/to/boxname.box"
}

Plugin and Packer version

Packer v1.7.8 Vagrant v2.2.19

packer {
  required_plugins {
    vmware = {
      version = ">= 1.0.0"
      source  = "github.com/hashicorp/vmware"
    }
    vagrant = {
      version = ">= 1.0.0"
      source  = "github.com/hashicorp/vagrant"
    }
  }
}

Operating system and Environment details

WIndows 10 Version 21H1 Build 19043.1348 (x64) Packer and Vagrant are executed trough powershell 5.1.19041.1320

Build Log

gist

midoriiro commented 2 years ago

I had an idea, when I add my box to vagrant the box is uncompressed to %USERPROFILE§/.vagrant.d/boxes/... I run manually my VM and my grub configuration is correct. This plugin is not involved.

I'll open an issue in Vagrant repository