Skip to content

Instantly share code, notes, and snippets.

@jeff1evesque
Created January 15, 2019 03:41
Show Gist options
  • Save jeff1evesque/af4e104eaf6dd1a91fe0b7f4c46377f4 to your computer and use it in GitHub Desktop.
Save jeff1evesque/af4e104eaf6dd1a91fe0b7f4c46377f4 to your computer and use it in GitHub Desktop.
Centos7x: guest additions workaround
# -*- mode: ruby -*-
# vi: set ft=ruby :
##
## variables
##
## Note: multiple vagrant plugins follow the following syntax:
##
## required_plugins = %w(plugin1 plugin2 plugin3)
##
required_plugins = %w(vagrant-vbguest)
plugin_installed = false
project_root = '/vagrant'
## create vbox machines
Vagrant.configure(2) do |config|
## shared files + folders
config.vm.define 'gnome-test' do |node|
## virtualbox configurations
node.vm.box = 'centos/7'
node.vm.hostname = 'gnome-test'
##
## utility executable: install docker + rancher-cli
##
## Note: reinstall guest additions per vbox:
##
## - https://forums.virtualbox.org/viewtopic.php?f=3&t=89084#p438514
##
node.vm.provision 'shell', inline: <<-SHELL
## install kernel
yum install -y https://people.centos.org/toracat/kernel/7/plus/bug15570new/kernel-3.10.0-957.1.3.bug15570.plus.el7.x86_64.rpm
## uninstall guest additions
cd /media
cd VBOXADDITIONS_*
sudo sh VBoxLinuxAdditions.run uninstall
## install guest additions
yum update -y
yum groupinstall -y 'Development Tools'
yum install -y kernel-devel epel-release dkms
mkdir -p /mnt/VBoxLinuxAdditions
mount /dev/cdrom /mnt/VBoxLinuxAdditions
sh /mnt/VBoxLinuxAdditions/VBoxLinuxAdditions.run
## install gnome desktop
yum -y groupinstall 'GNOME Desktop'
systemctl set-default graphical.target
systemctl start graphical.target
SHELL
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment