Closed cedricroijakkers closed 9 months ago
Hi @cedricroijakkers,
I'm running CentOS Linux release 7.9.2009 (Core)
and got the same problem with the same guest additions version (6.1.18).
I'm trying to figure out why vagrant-vbguest
is trying to reinstall every time guest additions, but I guess the problem is with the script /opt/VBoxGuestAdditions-6.1.18/init/vboxadd
. After I several times booting and reinstalling, I decided to manually try to setup and the issue remained.
This shell script is responsible for loading the kernel modules, in special vboxsf
, which is not being loaded anyway. I used modprobe vboxsf
manually, all worked fine. Reboot the VM, the module is not loaded.
I then disabled vagrant-vbguest
in the Vagrantfile:
Vagrant.configure('2') do |config|
config.vbguest.auto_update = false if Vagrant.has_plugin?('vagrant-vbguest')
And start seeing this message during VM boot:
==> default: Checking for guest additions in VM...
==> default: Rsyncing folder: /home/alceu/Projetos/vagrant-centos-vbguest/playbooks/ => /vagrant
Which means (I guess) the module is not being loaded and Vagrant is falling back to rsync.
After hacking the shell script, I enabled again the plugin and got this:
==> default: Machine booted and ready!
[default] GuestAdditions 6.1.18 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Rsyncing folder: /home/alceu/Projetos/vagrant-centos-vbguest/playbooks/ => /vagrant
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
alceu@yggdrasil:~/Projetos/vagrant-centos-vbguest$ vagrant ssh
Last login: Sun Feb 7 02:22:17 2021 from 10.0.2.2
[vagrant@localhost ~]$ lsmod | grep vbox
vboxsf 81005 0
vboxvideo 35867 0
ttm 96673 2 vmwgfx,vboxvideo
drm_kms_helper 186531 2 vmwgfx,vboxvideo
drm 456166 5 ttm,drm_kms_helper,vmwgfx,vboxvideo
vboxguest 349038 2 vboxsf
[vagrant@localhost ~]$
I changed the start()
function on the shell script like this:
[root@localhost ~]# diff -c /tmp/vboxadd /opt/VBoxGuestAdditions-6.1.18/init/vboxadd
*** /tmp/vboxadd 2021-02-07 02:36:27.407963028 +0000
--- /opt/VBoxGuestAdditions-6.1.18/init/vboxadd 2021-02-07 02:19:01.375108736 +0000
***************
*** 497,504 ****
rm -f $userdev || {
fail "Cannot remove $userdev"
}
- $MODPROBE vboxsf > /dev/null 2>&1 ||
- info "modprobe vboxsf failed"
$MODPROBE vboxguest >/dev/null 2>&1 ||
fail "modprobe vboxguest failed"
case "$no_udev" in 1)
--- 497,502 ----
***************
*** 506,511 ****
--- 504,510 ----
esac
}
+ $MODPROBE vboxsf > /dev/null 2>&1 || info "modprobe vboxsf failed"
case "$no_udev" in 1)
do_vboxguest_non_udev;;
I don't get this previous logic, using modprobe vboxsf
should happen independently of running_vboxguest
setting $?
as 0 or not. Maybe this hack will break something else, but so far it seems to work. I was able to setup shared folders and mount then automatically (and manually) and all worked.
FWIW my vboxadd script was a little different for the same version as @glasswalk3r, which is rather odd, but this one works for me:
--- /opt/VBoxGuestAdditions-6.1.18/init/vboxadd 2021-03-16 04:06:15.928284593 +0000
+++ /opt/VBoxGuestAdditions-6.1.18/init/vboxadd 2021-03-16 04:07:36.249727179 +0000
@@ -499,9 +499,10 @@
case "$no_udev" in 1)
sleep .5;;
esac
- $MODPROBE vboxsf > /dev/null 2>&1 ||
- info "modprobe vboxsf failed"
}
+ # HACK
+ $MODPROBE vboxsf > /dev/null 2>&1 ||
+ info "modprobe vboxsf failed"
case "$no_udev" in 1)
do_vboxguest_non_udev;;
esac
Putting in the # HACK
makes the patched file easily grep-able for programmatic use; patch
exits non-zero if it's already been applied.
patch -s -N -u /opt/VBoxGuestAdditions-6.1.18/init/vboxadd -i /tmp/vbox-add-6.1.18.patch
@lisawoodruff I've been having the same issue. I had a machine working just fine a few weeks ago, and then one day it was unable to map a shared drive. Here's my stack of versions:
Mac OS: Big Sur 11.2.3 Vagrant: 2.2.16 Vagrant VBGuest Plugin: 0.29.0 VirtualBox: 6.1.22 Virtualbox Extension Pack: 6.1.22 Vagrant Ubuntu/Xenial64: 20210429.0.0
When running vagrant up I get:
==> default: Machine booted and ready!
[default] GuestAdditions seems to be installed (6.1.22) correctly, but not running.
update-initramfs: Generating /boot/initrd.img-4.4.0-210-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel
modules. This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 4.4.0-210-generic.
VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what
went wrong
I can enter the machine and in /var/log/vboxadd-setup.log
I see Could not find the X.Org or XFree86
.
I've tried destroying the machine and re-provisioning.
I've tried installing guest additions by inserting the .iso and manually mounting and installing.
I've tried re-installing the guest kernel headers with sudo apt-get install kernel-headers
.
One thing that does appear to work is if I uninstall or disable the vagrant-vbguest
plugin. At that point the ubuntu/xenial
box uses the default guest additions that came packaged in the ubuntu/xenial
image.
It looks like a problem with Virtualbox Guest Additions, or at least, the integration between it and CentOS, I just have the same issue to build this version here. I had to disable the vagrant-vbguest plugin in the Vagrantfile
with config.vbguest.auto_update = false
and configure everything manually. :-(
@pingram3030 , do you think it would be possible to apply this patch with installer_hooks[:before_install]
? Although I'm not sure the best way to provide the patch file (I can only think about downloading with wget
or something else).
Install guest additions manually.
vagrant-vbguest
entries from Vagranfile
.vagrant destroy -f
vagrant plugin uninstall vagrant-vbguest
vagrant up # May stop with an error. It doesn't matter now.
vagrant ssh
sudo apt-get update
sudo apt-get install build-essential linux-headers-$(uname -r)
sudo apt-get install virtualbox-guest-dkms
exit
vagrant halt
vagrant up
It's okay now.
Mac OS: Catalina 10.15.7 Vagrant: 2.2.16 VBGuest plugin: 0.29.0 VirtualBox: 6.1.22 Vagrant box: bento/ubuntu-16.04 (virtualbox, 202104.19.0)
The 5.x VirtualBox Guest Additions from virtualbox-guest-dkms
work without issue?
The 5.x VirtualBox Guest Additions from
virtualbox-guest-dkms
work without issue?
My builds are fine. The folders are mounted.
Perhaps there may be problems in some cases. There is no guarantee. I have not tested all cases.
Any other method can be used for manual installation. It is not necessary to use dkms
package.
I recently updated ubuntu from 16 to 18 and guest additions didn't seem to have a problem updating (to 6.1.22) after that. It's been booting reliably since the update so far.
I recently updated ubuntu from 16 to 18 and guest additions didn't seem to have a problem updating (to 6.1.22) after that. It's been booting reliably since the update so far.
I also recently updated some VMs to Ubuntu 18.04. If you use box bento/ubuntu-18.04, then vbguest plugin is not needed, because guest additions are already preinstalled in this box.
I also recently updated some VMs to Ubuntu 18.04. If you use box bento/ubuntu-18.04, then vbguest plugin is not needed, because guest additions are already preinstalled in this box.
AFAIK, that only happens with CentOS. I tested my self against the boxes generic/centos8
and centos/7
.
Experiencing the same issue here with Red Hat 8. Issue here: https://github.com/dotless-de/vagrant-vbguest/issues/414
I've been struggling with this issue for a month or so. Got rid of it by simply removing vagrant-bguest
plugin.
I guess it's not needed for 'bento/ubuntu-20.04' box.
Configuration: Mac OS: Big Sur 11.4 Vagrant: 2.2.17 VirtualBox: 6.1.22 Vagrant box: bento/ubuntu-20.04 (virtualbox, 202107.07.0)
On CentOS 8 (specifically centos/8
) I was able to workaround this issue by just adding vboxsf
to the systemd module-load service configuration. It accomplishes the same end result without having to patch the vbox script.
This should be considered a temporary fix until virtualbox fixes the script, at which point we'll just need to delete /etc/modules-load.d/vboxsf.conf
I used the :before_install
hook as follows
Vagrant.configure("2") do |config|
# Ensure virtualbox guest plugins are installed and latest
config.vagrant.plugins = ["vagrant-vbguest"]
# Box
config.vm.box = "centos/8"
# VM Properties
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.cpus = "2"
end
# Install Mock
config.vm.provision "shell", inline: <<-SHELL
sudo dnf update -y
SHELL
# Force Virtualbox sync
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
# VBox Guest options
config.vbguest.auto_update = true
config.vbguest.installer_options = { allow_kernel_upgrade: true }
config.vbguest.installer_hooks[:before_start] = [
"echo 'vboxsf' > /etc/modules-load.d/vboxsf.conf",
"systemctl restart systemd-modules-load.service",
"echo '=== Verifying vboxsf module is loaded'",
"cat /proc/modules | grep vbox"
]
end
Hi All
Same issue for me as well.
[user@centos rhcsa8env]$ vagrant vbguest --status [server2] GuestAdditions seems to be installed (6.1.26) correctly, but not running. [repo] GuestAdditions seems to be installed (6.1.26) correctly, but not running. [workstation] GuestAdditions seems to be installed (6.1.26) correctly, but not running. [server1] GuestAdditions seems to be installed (6.1.26) correctly, but not running. [user@centos rhcsa8env]$
However, All the boxes are up and running with guest addition services
[root@server2 ~]# systemctl list-units |grep vboxadd vboxadd-service.service loaded active running vboxadd-service.service vboxadd.service loaded active exited vboxadd.service [root@server2 ~]#
following modules are loaded, However I can't see "vboxsf" and "vboxadd" module as loaded [root@server2 ~]# lsmod |grep vbox vboxvideo 49152 1 drm_kms_helper 200704 1 vboxvideo ttm 131072 1 vboxvideo drm 520192 4 drm_kms_helper,vboxvideo,ttm vboxguest 393216 1 [root@server2 ~]#
and the service startup script "/opt/VBoxGuestAdditions-6.1.26/init/vboxadd" always build the module for kernel. Could be the modules are not loaded correctly ? Why vagrant thinks thinks guest additions are installed but not running ?
[user@centos ~]$ vboxmanage --version 6.1.26r145957 [user@centos ~]$ vagrant --version Vagrant 2.2.18 [user@centos ~]$ vagrant plugin list vagrant-guest_ansible (0.0.4, global)
Version Constraint: > 0 vagrant-vbguest (0.30.0, global) [user@centos ~]$
@eldho-varghese did you try the workaround above?
Hello, I had the same issue; after switching to nfs for synced folders.
It seems de vboxsf module is not loaded in that case.
This can be seen with the command cat /proc/modules |grep 'vboxsf'
in the client.
As a last resort I read the readme file more carefully. It states the following for Linux type installers:
Linux
This option is available on all Linux type installers.
- :running_kernel_modules (default: ["vboxguest", "vboxsf"]) The list used to check for the "running" state. Each of these modules need to appear at the beginning of a line in /proc/modules.
So the solution was to add the following line to the plugin configuration:
config.vbguest.installer_options = { running_kernel_modules: ["vboxguest"] }
my vbguest configuration:
if Vagrant.has_plugin?("vagrant-vbguest") config.vbguest.installer_options = { running_kernel_modules: ["vboxguest"] } config.vbguest.auto_update = true end
This solved it for me.
On CentOS 8 (specifically
centos/8
) I was able to workaround this issue by just addingvboxsf
to the systemd module-load service configuration. It accomplishes the same end result without having to patch the vbox script.This should be considered a temporary fix until virtualbox fixes the script, at which point we'll just need to delete
/etc/modules-load.d/vboxsf.conf
I used the
:before_install
hook as followsVagrant.configure("2") do |config| # Ensure virtualbox guest plugins are installed and latest config.vagrant.plugins = ["vagrant-vbguest"] # Box config.vm.box = "centos/8" # VM Properties config.vm.provider "virtualbox" do |vb| vb.memory = "4096" vb.cpus = "2" end # Install Mock config.vm.provision "shell", inline: <<-SHELL sudo dnf update -y SHELL # Force Virtualbox sync config.vm.synced_folder ".", "/vagrant", type: "virtualbox" # VBox Guest options config.vbguest.auto_update = true config.vbguest.installer_options = { allow_kernel_upgrade: true } config.vbguest.installer_hooks[:before_start] = [ "echo 'vboxsf' > /etc/modules-load.d/vboxsf.conf", "systemctl restart systemd-modules-load.service", "echo '=== Verifying vboxsf module is loaded'", "cat /proc/modules | grep vbox" ] end
Thank you very much, The workaround provided worked for me ;-) The only issue I had was that centos/8 box image is now outdated and I've you're trying it now, it will give you the internal mirrorlist error while booting up:
==> default: Machine booted and ready!
[default] No Virtualbox Guest Additions installation found.
CentOS Linux 8 - AppStream 105 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
Unmounting Virtualbox Guest Additions ISO from: /mnt
umount: /mnt: not mounted.
Reason is, that CentOS 8 has reached its end-of-life and all official package mirrors have been removed by CentOS Team by the end of January 31, 2022.
Solution is to use another CentOS Stream version with the official https://vault.centos.org/ mirrors. In your vagrant file you can use
# Box
config.vm.box = "centos/stream8"
and virtualbox guest extensions will be installed properly:
Copy iso file /usr/share/virtualbox/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Mounting Virtualbox Guest Additions ISO to: /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
Installing Virtualbox Guest Additions 6.1.32 - guest version is unknown
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.32 Guest Additions for Linux........
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel
modules. This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel
4.18.0-365.el8.x86_64.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
GuestAdditions 7.0.4 gives the same error message as the 6.1.18 version did. I am running it on Ubuntu 20.04.1.
The Apr 30 message says stale. yet the issue has not been fixed. I also says it added the wontfix label to this issue. Is there a discussion as to why it won't be fixed? Just curious. I am relatively new to using vagrant and I am just trying to figure out how this all works.
I have Guest Additions 6.1.40 installed for an Ubuntu 18.04 guest and removing the vagrant-vbguest
plugin solved the issue for me.
For me, installing sudo apt install virtualbox-guest-utils
on the guest (Ubuntu 20.04) solved the issue.
Software versions:
VirtualBox: 6.1.18 Vagrant: 2.2.14 Plugin vagrant-vbguest: 0.29.0
When booting my box for the first time, when provisioning, I get the following message:
After the reboot, the guest additions are no longer checked (or at least, not a message is printed) and the provisioning continues as normal.
However, I'm sure the guest additions are running in the box:
I've also disabled the
vagrant-vbguest
plugin in Vagrant, destroyed en provisioned the box again, and things likevboxsf
are working file, so the guest additions are running just fine.Te reproduce, you can init Vagrant with the following box:
mrvantage/centos7-minikube
and version1.2.0-20210126
.Note: After later reboots (
vagrant reload
) the guest additions are detected correctly: