0
votes

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!

2

2 Answers

0
votes

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.

0
votes

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:

  1. 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.

  1. when it is done installing, run vagrant up to boot the VM. It will update the Guest Additions