Skip to content

Instantly share code, notes, and snippets.

@alexlovelltroy
Last active April 17, 2024 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexlovelltroy/1aa6d07119ef59fd966417c97baa2ff5 to your computer and use it in GitHub Desktop.
Save alexlovelltroy/1aa6d07119ef59fd966417c97baa2ff5 to your computer and use it in GitHub Desktop.
OpenCHAMI development vagrantfile
$script = <<SCRIPT
# Refresh the packages and install the necessary ones
dnf config-manager --set-enabled crb
dnf install -y epel-release && dnf update --refresh -y
dnf install -y dkms kernel-devel kernel-headers gcc make bzip2 perl elfutils-libelf-devel vim-enhanced git clang jq telnet
dnf groupinstall -y 'Development Tools'
# Install a modern version of the go programming language
curl -LO https://go.dev/dl/go1.21.9.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.21.9.linux-amd64.tar.gz
# Install Docker
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf install -y docker-ce docker-ce-cli containerd.io
systemctl enable docker
usermod -a -G docker vagrant
# Install the guest additions
curl -LO http://download.virtualbox.org/virtualbox/7.0.14/VBoxGuestAdditions_7.0.14.iso
mkdir /mnt/vboxguestiso
mount -o loop VBoxGuestAdditions_7.0.14.iso /mnt/vboxguestiso
cd /mnt/vboxguestiso
./VBoxLinuxAdditions.run
SCRIPT
Vagrant.configure("2") do |config|
config.vm.define "rocky9-dev" do |d|
d.vm.box = "generic/rocky9"
d.vm.provision "shell", inline: $script
d.vm.synced_folder ".", "/vagrant"
d.vm.network "forwarded_port", guest: 8080, host: 8888
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment