Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrantfile sample has old comment for VirtualBox provider. Provisioner can run inline script now. #2574

KEINOS opened this Issue Apr 6, 2019 · 0 comments


None yet
1 participant
Copy link

commented Apr 6, 2019

Issue Report

TL; DR: The comment in Vagrantfile at "coreos-vagrant" repo seems to be old. Since it works on the latest VirtualBox now.

Bug Document fix

Container Linux Version

core@core-01 ~ $ cat /etc/os-release
NAME="Container Linux by CoreOS"
PRETTY_NAME="Container Linux by CoreOS 2023.5.0 (Rhyolite)"


admin@hostOS ~ $ date -R && echo "VirtualBox: $(vboxmanage -v)" && vagrant -v && echo "BaseBox: $(vagrant box list -i | grep coreos-)" && sw_vers && system_profiler -detailLevel mini SPHardwareDataType
Sat, 06 Apr 2019 10:52:51 +0900
VirtualBox: 6.0.4r128413
Vagrant 2.2.4
BaseBox: coreos-stable  (virtualbox, 2023.5.0)
ProductName:	Mac OS X
ProductVersion:	10.14.4
BuildVersion:	18E226

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro12,1
      Processor Name: Intel Core i5
      Processor Speed: 2.7 GHz
      Number of Processors: 1
      Total Number of Cores: 2
      L2 Cache (per Core): 256 KB
      L3 Cache: 3 MB
      Memory: 8 GB
      Boot ROM Version:
      SMC Version (system): 2.28f7

Expected Behavior

  • The inline shell script defined in Vagrantfile won't run on VirtualBox while provisioning.

Actual Behavior

  • The inline shell script defined in Vagrantfile does run on VirtualBox while provisioning.

Reproduction Steps

  1. Fork the repo and clone it to local
  2. Edit files
  3. vagrant up

Other Information

As of the latest commit (id 0857274) in the Vagrantfile, the comment says that the inline shell script while provisioning will not work (take effect) on VirtualBox.

# This shouldn't be used for the virtualbox provider (it doesn't have any effect if it is though)
if File.exist?(CLOUD_CONFIG_PATH)
  config.vm.provision :file, :source => "#{CLOUD_CONFIG_PATH}", :destination => "/tmp/vagrantfile-user-data"
  config.vm.provision :shell, inline: "mkdir -p /var/lib/coreos-vagrant", :privileged => true
  config.vm.provision :shell, :inline => "mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", :privileged => true

But the current VirtualBox(v6.0.4) seems to execute them while provisioning(vagrant up). See the log below "Running provisioner: ..." part:

$ vagrant up
Bringing machine 'core-01' up with 'virtualbox' provider...
==> core-01: Importing base box 'coreos-stable'...
==> core-01: Configuring Ignition Config Drive
==> core-01: Matching MAC address for NAT networking...
==> core-01: Checking if box 'coreos-stable' version '2023.5.0' is up to date...
==> core-01: Setting the name of the VM: Fork_coreos-vagrant_core-01_1554514356699_25625
==> core-01: Clearing any previously set network interfaces...
==> core-01: Preparing network interfaces based on configuration...
    core-01: Adapter 1: nat
    core-01: Adapter 2: hostonly
==> core-01: Forwarding ports...
    core-01: 22 (guest) => 2222 (host) (adapter 1)
==> core-01: Running 'pre-boot' VM customizations...
==> core-01: Booting VM...
==> core-01: Waiting for machine to boot. This may take a few minutes...
    core-01: SSH address:
    core-01: SSH username: core
    core-01: SSH auth method: private key
==> core-01: Machine booted and ready!
==> core-01: Setting hostname...
==> core-01: Configuring and enabling network interfaces...
==> core-01: Running provisioner: file...
    core-01: /Volumes/Macintosh_HD/Data_Git/GitHub/Fork_coreos-vagrant/user-data => /tmp/vagrantfile-user-data
==> core-01: Running provisioner: shell...
    core-01: Running: inline script
==> core-01: Running provisioner: shell...
    core-01: Running: inline script
$ vagrant ssh
Last login: Sat Apr  6 01:33:01 UTC 2019 from on ssh
Container Linux by CoreOS stable (2023.5.0)
core@core-01 ~ $ ls /var/lib/coreos-vagrant
core@core-01 ~ $ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.