-
Notifications
You must be signed in to change notification settings - Fork 218
CentOS 8 - installing Guest additions fails #367
Comments
I've also encountered this issue. It seems to be related to the recent release of CentOS 8.1. The Vagrant box installed from centos/8 is still CentOS 8.0 (version 1905.1), which seems to cause the install of the packages required for this plugin to fail. I've found that removing the existing CentOS 8.0 box and configuring a Vagrantfile explicitly with the url to the CentOS 8.1 Vagrant box seems to work around this issue. ie
and then in my Vagrantfile:
Unlike with CentOS 7 releases, the CentOS-Vault.repo file seems to be empty in CentOS 8.1, hence there are no matching repos for
Using the CentOS 8.1 .box file sidesteps this issue since has_kernel_devel_info will be |
Any news about this issue? @dotless-de @fnordfish 👍 |
Where is the repo where the vagrant images of CentOS is generated? Because today the latest vagrant image available is 8.0 ( https://app.vagrantup.com/centos/boxes/8 ). Is it possible to provide centos 8.1 vagrant image? Is there any repo that I can create a issue for this? Thank you so much! 👍 🥇 |
I created an issue in the repo: CentOS/sig-cloud-instance-build#168 |
Same issue. |
Using the CentOS 8.1 image doesn't work here anymore either. It looks like older kernel-devel versions cannot be installed. I've managed to monkey patch it in my Vagrantfile:
So the idea is:
This puts the fresh CentOS 8 vm in a state where the guest additions can be succesfully built. |
This solution worked for me. Should the official vagrant box not be updated to 8.1 as suggested by @pedrofurtado? |
Just another datapoint: Specifying the box url did not work for me:
Some output traces below:
|
Using the new box is a work-around which will work temporarily at best. The goal of that work-around is to have up-to-date kernel and kernel-devel packages, which prevents any attempts to install kernel-devel packages. In the end, the real issue is that the Additionally, it seems that kernel-devel packages for the specific kernel version are not always available in the repos if the kernel version in the box is outdated. So imho the real fix should be to:
In the resulting state, the guest additions will be able to compile. |
Everyone, I've created a PR with the suggestion proposed by @choonge 🤝 Happy to see this merged as soon as possible 🎉 |
The final workaround, until the PR be merged and released, is to write the vagrantfile with code like that: # https://github.com/dotless-de/vagrant-vbguest/issues/367
# https://github.com/dotless-de/vagrant-vbguest/pull/373
if defined?(VagrantVbguest)
class MyWorkaroundInstallerUntilPR373IsMerged < VagrantVbguest::Installers::CentOS
protected
def has_rel_repo?
unless instance_variable_defined?(:@has_rel_repo)
rel = release_version
@has_rel_repo = communicate.test(centos_8? ? 'yum repolist' : "yum repolist --enablerepo=C#{rel}-base --enablerepo=C#{rel}-updates")
end
@has_rel_repo
end
def centos_8?
release_version && release_version.to_s.start_with?('8')
end
def install_kernel_devel(opts=nil, &block)
if centos_8?
communicate.sudo('yum update -y kernel', opts, &block)
communicate.sudo('yum install -y kernel-devel', opts, &block)
communicate.sudo('shutdown -r now', opts, &block)
begin
sleep 10
end until @vm.communicate.ready?
else
rel = has_rel_repo? ? release_version : '*'
cmd = "yum install -y kernel-devel-`uname -r` --enablerepo=C#{rel}-base --enablerepo=C#{rel}-updates"
communicate.sudo(cmd, opts, &block)
end
end
end
end
Vagrant.configure('2') do |config|
config.vagrant.plugins = ['vagrant-vbguest']
config.vbguest.auto_update = true
config.vm.box = 'centos/8'
config.vm.box_url = 'https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-Vagrant-8.1.1911-20200113.3.x86_64.vagrant-virtualbox.box'
if defined?(MyWorkaroundInstallerUntilPR373IsMerged)
config.vbguest.installer = MyWorkaroundInstallerUntilPR373IsMerged
end
end |
Many thanks for this careful analysis and workaround. I am pleased to report that it seems to have worked for me. |
Guys, any help (with tests in your applications, code review, and so on ...) in that PR will be appreciated🎉 : #373 |
@pedrofurtado When is has_rel_repo? invoked? When I run it, I dont see it. Also, it looks like the box_url does not need to be specified any longer. |
Neither of these commits are in master or 0.24 tag now. |
works for me |
Plugin version:
vagrant-vbguest (0.23.0, global)
Vagrant version:
Installed Version: 2.2.7
VirtualBox version:
6.1.2r135662
VagrantFile
Output:
Also since this is CentOS 8, isn't the preferred OS package manager suppose to be
dnf
?The text was updated successfully, but these errors were encountered: