0

Problem: After packaging a base OS with some customizations into a .box file I add the box (vagrant box add ...). I then vagrant init mybox and vagrant up. When vagrant up runs, it undoes the customizations I made to the base Virtualbox VM. Specifically, it removes repositories that I've added and reinstalls VBoxGuestAdditions. How do I stop vagrant from removing the changes I've made in the source VM?

Additional Info

Host OS: Ubuntu 16.04
Guest OS: SLES 12
Vagrant Version: 1.8.7
VirtualBox Version: 5.1.14r112924
Plugins:
vagrant-hostmanager (1.8.5)
vagrant-proxyconf (1.5.2)
vagrant-share (1.1.6, system)
vagrant-vbguest (0.13.0)
vagrant-vbox-snapshot (0.0.10)
Chad
  • 714
  • 2
  • 9
  • 26
  • I haven't tried this myself, so I'll fish for some additional information in the hope that it helps. 1.) do you have any plugins installed that might be modifying the box? 2.) are any customizations sticking? 3.) did you load any earlier iterations of this box? – abathur Feb 09 '17 at 23:30
  • 1
    Vagrant does not remove any repositories from the guest OS. Please include a reproducible example (Vagrantfile and provisioning scripts you used) in your question. – techraf Feb 10 '17 at 05:29
  • when you create a box with vagrant and run after `vagrant up` against this box it just clone the VM so no changes can happen unless you specifically run some provisioning – Frederic Henri Feb 10 '17 at 08:06
  • @techraf That's the weird thing. I have nothing special. I built a SLES 12 VM by hand in Virtualbox following the Vagrant guidelines (vagrant user, vbox tools, etc). Then I packaged it (no Vagrantfile) and added the package.box. When I try to use it for a new project, it redoes all of the commands that I used to set it up like installing gcc, some devel tools, etc. I went back into the base VM, added some repos, then repackaged and readded. After doing another `vagrant init` in a separate project, it still did the original setup commands but it removed the repos I added. – Chad Feb 10 '17 at 17:13
  • @abathur #1: Added plugins to my question #2 They don't seem to. After v1 of my base VM, I added the repos (now v1.1). Anytime I start a new project with v1.1 it automatically removing the repos; I see the zypper output indicating that the repos are being removed. #3 I have loaded a few iterations, but I've repackaged and readded each time. – Chad Feb 10 '17 at 17:20
  • @chad Is the behavior the same if you disable all of the plugins and try again? The fact that you note you see the vboxguestadditions reinstallation makes me wonder if that plugin or another is to blame. – abathur Feb 10 '17 at 20:23

1 Answers1

0

Solution: Re-register the OS with the SLES update server. It turned out that the problem was the OS and not the plugins. Once I re-regsitered the server, the repos stopped getting removed.

Chad
  • 714
  • 2
  • 9
  • 26