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)
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.
Related
For many months I had been successfully using VirtualBox 5.xx.xx along with Vagrant 2.xx (don't remember the rest of the version numbers) on a Windows 10 host with Ubuntu 16 guest. At some point in the past six weeks, on vagrant up Guest Additions started being reported as different versions on the host and guest, and changes I would make to my synced files from the Windows side would not always be realized on Ubuntu. To try to fix this problem, I upgraded Vagrant to the latest version, and then tried upgrading and downgrading VirtualBox from as low as 5.0.18 (generates an error on vagrant up) to as high as the latest (6.0.4). Trying 5.2.24 and 5.2.26 yielded messages upon Vagrant startup stating that Guest Additions on the host were reported as 5.0.18 but on the guest were reported as 5.2.24 (or .26). Then a final startup message stated that the Virtualbox version was at 5.2 and the Guest Additions version was 5.1.30 - so at times I've gotten a total of three different versions of Guest Additions reported. I have the vagrant-vbguest plugin installed. I downloaded the matching Guest Additions ISO version for the VBox versions, and loaded the Guest Additions ISO into the virtual optical drive in VirtualBox (as well as specified config.vbguest.iso_path = "VBoxGuestAdditions_5.x.x.iso" in my Vagrantfile.
My Vagrant/VirtualBox setup had been working fine for probably at last a year, and I never wanted to "upgrade" because I've been through this mess before when "upgrading" to newer versions. From too-long searching online, I'm pretty sure this problem has been caused from doing dist-upgrade to Ubuntu (which I do regularly) because I've changed nothing in the Vagrant/VBox setup for a long time. I was hoping that the upgrade to the latest VirtualBox (6) would solve the problem but, sadly, this version is even worse - Ubuntu cranks SLOWLY through the boot process, and it's been taking so long that I haven't even let it finish after trying several times.
It would be great to see if this latest VirtualBox 6 would solve the problem, so maybe someone has an idea about why that would be so slow (I have an 8 core 16Gb machine, and I've assigned 4 cores and plenty of RAM to VBox - and it starts up fine under 5.2.xx).
The vagrant up output:
SSH username: vagrant
SSH auth method: private key
Warning: Connection reset. Retrying...
default: Machine booted and ready! Got different reports about
installed GuestAdditions version: Virtualbox on your host claims:
5.0.18 VBoxService inside the vm claims: 5.2.26 Going on, assuming VBoxService is correct...
GuestAdditions seems to be installed (5.2.26) correctly, but not
running. Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 5.0.18 VBoxService inside the vm
claims: 5.2.26
Going on, assuming VBoxService is correct...
Job for vboxadd-service.service failed because the control process
exited with error code. See "systemctl status vboxadd-service.service"
and "journalctl -xe" for details.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 5.0.18 VBoxService inside the vm
claims: 5.2.26 Going on, assuming VBoxService is correct... bash: line
4: setup: command not found
Checking for guest additions in VM...
The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
prevent things such as shared folders from working properly. If you
see shared folder errors, please make sure the guest additions within
the virtual machine match the version of VirtualBox you have installed
on your host and reload your VM.
Guest Additions Version: 5.1.30
VirtualBox Version: 5.2 The following SSH command responded with a
non-zero exit status. Vagrant assumes that this means the command
failed!
After many hours of searching and trying different suggestions, the following is what solved the problem:
downloaded the latest unofficial release build of VirtualBox (in my case 5.2.27) and installed it
Placed the following in my Vagrantfile: config.vbguest.iso_path = "https://www.virtualbox.org/download/testcase/VBoxGuestAdditions_5.2.27-129578.iso"
Ran vagrant up
Ubuntu booted OK, but on the host side Vagrant was displaying an error message something like this:
Failed to mount folders in Linux guest. This is usually because the
"vboxsf" file system is not available.
So next, on the booted Ubuntu guest:
sudo apt autoremove to clean up the Linux headers
And then:
Run vagrant vbguest from the host
vbguest then went through a process of uninstalling the existing Guest Additions and installing VBoxGuestAdditions_5.2.27 from the config.vbguest.iso_path.
To verify that Guest Additions are installed properly, run vagrant vbguest --status (or just vagrant vbguest again). Both commands returned:
[default] GuestAdditions 5.2.27 running --- OK.
The above operations resulted in a folder named VBoxGuestAdditions-5.2.27 being placed within the /opt folder. This VBoxGuestAdditions-5.2.27 folder has seven subfolders, two files (uninstall.sh and routines.sh) and a LICENSE file. I can find no documentation about vagrant-vbguest placing the installed items into the /opt folder, but I did find a small mention here.
I suspect that this process would have worked for any of the 5.2.xx versions (available here), but I had already installed 5.2.27 so went ahead with that.
I had he same issue after updating laravel/homestead box to v7.2.1 . This blog post helped me solve it.
in summary, this is what you have to do:
navigate to the directory that contains your Vagrantfile and run vagrant plugin install vagrant-vbguest
The first time I executed the command, it disabled my WiFi adapter and the installation failed. If this happens, re-activate it back and rerun the command.
when it is done installing, run vagrant up to boot the VM. It will update the Guest Additions
I've recently installed VirtualBox, Vagrant and Chef DK and when I run kitchen converge my VM comes up properly provisioned with my cookbook using vagrant and the Virtualbox provider however I am unable to view or manage the vm from the VirtualBox Manager
I can however view see the vm running via kitchen list or vagrant global-status
Upon reviewing where the .vbox is being loaded I can see that its going in the ~/my_cookbook/.kitchen/nameofvm/ folder
When I review the default Machine location set in Virtual box i can see it's located in the /Users//VirtualBox VMs/ folder however it does not appear to be following this attribute
So far i've reinstalled vagrant, VirtualBox and Chef DK
I'm running MacOS Sierra 10.12.6 and only have started having this issue since upgrading to MacOS Sierra.
Anyone have any recommendations or some extra steps that I could take to potentially resolve this issue?
Chef Development Kit Version: 2.1.11
chef-client version: 13.2.20
delivery version: master (73ebb72a6c42b3d2ff5370c476be800fee7e5427)
berks version: 6.3.0
kitchen version: 1.17.0
inspec version: 1.33.1
vboxmanage -v
5.1.26r117224
Vagrant 1.9.8
This was an inadvertent mis-feature of a change in kitchen-vagrant, which has since been reverted. ChefDK 2.2 includes this fixed version of kitchen-vagrant and should be released either later today or tomorrow morning. You can also roll back to ChefDK 2.0. Sorry for the trouble.
I'm getting started Vagrant and want to use it with KVM/qemu (and the Virtual Machine Manager GUI), instead of installing VirtualBox. So I first installed Vagrant:
$ vagrant --version
Vagrant 1.9.1
$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some
As per these posts, I require vagrant-libvirt for it to work with KVM, so I installed that next:
$ vagrant plugin list
vagrant-libvirt (0.0.37)
vagrant-share (1.1.6, system)
Next, I to add a CentOS(7) box using vagrant box add "centos/7" and selected libvirt, when prompted. After which, I ran vagrant init and didn't encounter any errors:
$ vagrant init centos/7
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
However, vagrant up seems to be erroring out, like so:
$ vagrant up
No usable default provider could be found for your system.
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
Here's the provider section in the Vagrantfile
config.vm.provider :libvirt do |domain|
domain.driver = "qemu"
domain.memory = 512
domain.cpus = 1
end
I tried modifying it to:
config.vm.provider :libvirt do |domain|
domain.driver = "kvm"
domain.host = 'localhost'
domain.uri = 'qemu:///system'
domain.memory = 512
domain.cpus = 1
end
I also tried vagrant up --provider=kvm, vagrant up --provider=qemu, and vagrant up --provider=libvirt too, to no avail.
Is there any step that I've missed? Or another package/dependency that needs to be installed?
Edit: After the adding centos/7 using vagrant, it shows up when running vagrant box list.
$ vagrant box list
centos/7 (libvirt, 1611.01)
Start vagrant box with command
vagrant up --provider=kvm
Although it has been said in https://seven.centos.org/2017/08/updated-centos-vagrant-images-available-v1707-01/ that
The vagrant-libvirt plugin is only compatible with Vagrant 1.5 to 1.8
You can use either the command line option --provider=kvm or you can set the VAGRANT_DEFAULT_PROVIDER environment variable:
export VAGRANT_DEFAULT_PROVIDER=kvm # <-- may be in ~/.profile, /etc/profile, or elsewhere
vagrant up
vagrant-libvirt(0.0.40) is compatible with Vagrant 2.0.2 if you are running Ruby 2.3, at least on Linux Mint 18.3 (Ubuntu 16.04). I used vagrant from the Debian download on the vagrantUp website and installed the plugin using it without any problem.
I am running vagrant up command on Windows 7 box (Vagrantfile exists in work dir) and getting the message:
Provider 'virtualbox' not found. We'll automatically install it now...
Virtual box has been installed and vbox_install_path env variable is correctly set.
Working in intranet, there is no way to automatically install VB from the internet.
Vagrant 1.8.4 and older are not compatible with the VirtualBox 5.1.x.
Vagrant 1.8.5 has been released already and it supports the VirtualBox 5.1.x.
Sorted out. Vagrant 1.8.4 does not work with VirtualBox 5.1.0 (on Win7 at least). Fixed after VB version was changed to 5.0.20
Is it possible to use test-kitchen with Vagrant and Parallels?
I have a working kitchen using Virtualbox, but I wanted to try with Parallels. I've installed the Vagrant Parallels plugin and confirmed that is working. But when I run kitchen converge, it is still using Virtualbox. My .kitchen.yml has:
driver:
name: vagrant
This documentation seems to imply that Parallels is not supported by kitchen-vagrant?
"The kitchen-vagrant driver for Kitchen generates a single Vagrantfile for each instance of Kitchen in a sandboxed directory. The kitchen-vagrant driver supports VirtualBox and VMware Fusion, requires Vagrant 1.1.0 (or higher), and is the default driver for Kitchen."
https://docs.chef.io/config_yml_kitchen.html
I was able to create a VM on Parallels with these options in .kitchen.yml:
platforms:
- name: debian8
driver:
box: parallels/debian-8.3
provider: parallels