View Issue Details

IDProjectCategoryView StatusLast Update
0014811CentOS-7-OTHERpublic2018-05-18 08:16
Reportermar4eli 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0014811: centos/7 Vagrant box v1803.01. VirtualBox Guest Additions && Kernel-devel problem
DescriptionGood day, i'm not sure is it ticket belongs here... i assume someone here create vagrant box for centOs and today i have encountered a problem.

CentOs published new kernel-devel package and latest CentOs/7 Vagrant Box failed to cooperate with VirtualBox Guest Additions. Vagrant unable to install vboxadd on guest machine (see logs in additional info) and so unable to sync folders

### Vagrant version
Vagrant 2.0.2

### VirtualBox version
5.2.12

### Host operating system
Windows 10 1709

### Guest operating system
centos/7 Vagrant box v1803.01

### Vagrantfile
```ruby
Vagrant.configure("2") do |config|
  #box
  config.vm.box = "centos/7"
  
  #ip
  IP = "192.168.120.9"
  
  #machine settings
  config.vm.provider "virtualbox" do |v|
    v.memory = 1024
    v.cpus = 2
  end
  
  #network
  config.vm.network "private_network", ip: IP
  
  #forwarded ports
    
  #apps
  config.vm.provision "shell", inline: "sudo su"
  config.vm.provision "shell", inline: "yum update -y"
  config.vm.provision "shell", inline: "yum install -y epel-release"
  config.vm.provision "shell", inline: "yum update -y"
  config.vm.provision "shell", inline: "yum install -y mc htop expect ansible nano net-tools telnet"
  
  #selinuxoff
  config.vm.provision "shell", inline: "sed -i 's/.*SELINUX=enforcing.*/SELINUX=disabled/' /etc/selinux/config"
  
  #run ansible project
  config.vm.provision "shell", inline: "rm -rf /etc/ansible/*"
  config.vm.synced_folder "../../Ansible","/home/ansible"
end
```

### Expected behavior
Vagrant up command should normally exited and on guest system must be synced folder

### Actual behavior
1. On the very beginning recieve warning:
```Public key for kernel-headers-3.10.0-862.2.3.el7.x86_64.rpm is not installed```
2. VirtualBox Guest Additions failed to build kernel modules:
```
Copy iso file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Mounting Virtualbox Guest Additions ISO to: /mnt
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 5.2.12 - guest version is unknown
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.2.12 Guest Additions for Linux........
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-3.10.0-693.21.1.el7.x86_64
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-3.10.0-693.21.1.el7.x86_64
An error occurred during installation of VirtualBox Guest Additions 5.2.12. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
Redirecting to /bin/systemctl start vboxadd.service
Job for vboxadd.service failed because the control process exited with error code. See "systemctl status vboxadd.service" and "journalctl -xe" for details.
Unmounting Virtualbox Guest Additions ISO from: /mnt
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default:
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces...
    default: SSH address: 127.0.0.1:2201
    default: SSH username: vagrant
    default: SSH auth method: private key
```
3. This lead to the exception during folder sync:
```
==> default: Rsyncing folder: /cygdrive/c/repo/Tele2/Tele2Pay/Infrastructure/Vagrant/Ansible(192.168.120.9)/ => /vagrant
==> default: Mounting shared folders...
    default: /home/ansible => C:/repo/Tele2/Tele2Pay/Infrastructure/Ansible
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=1000,gid=1000 home_ansible /home/ansible

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device
```



Steps To Reproduce### Steps to reproduce
1. Install vagrant 2.0.2
2. Install virtualbox 5.2.12
3. Use latest centos/7 vagrant box
4. copy vagrantfile from issue.
5. use vagrant up.
Additional Information### Steps to workaround
1. Add line to vagrant file:
```config.vm.provision "shell", inline: "yum install -y kernel-devel"```
2. Vagrant up. Encounter error.
3. Vagrant up once again to continue.
4. Vagrant reload.
5. Vagrant ssh to the machine.
6. Check vboxadd.service status:
```systemctl status vboxadd.service```
7. If everything works fine, mount folder manually:
```sudo mount -t vboxsf -o uid=1000,gid=1000 home_ansible /home/ansible```
Tagsvagrant
abrt_hash
URL

Activities

ripienaar

ripienaar

2018-05-18 08:16

reporter   ~0031869

Same problem here, the problem is the vagrant machine runs this kernel:

   Linux example.net 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

This is because the yum repos are setup to track 7, and since there's a new release of centos it's now finding only updates for the latest release not the release these boxes were built with.

Issue History

Date Modified Username Field Change
2018-05-15 15:43 mar4eli New Issue
2018-05-15 15:43 mar4eli Tag Attached: vagrant
2018-05-18 08:16 ripienaar Note Added: 0031869