Skip to content

Instantly share code, notes, and snippets.

@manero6
Created March 29, 2021 17:25
Show Gist options
  • Save manero6/cad09e5378451a4087f177c2e0c37b68 to your computer and use it in GitHub Desktop.
Save manero6/cad09e5378451a4087f177c2e0c37b68 to your computer and use it in GitHub Desktop.
Vagrant Fedora all Spins (LibVirt and VirtualBox)
# -*- mode: ruby -*-
# vi: set ft=ruby :
VM_BOX = ENV["VM_BOX"] || "fedora/33-cloud-base"
VM_RAM = ENV["VM_RAM"] || "1536"
VM_CPU = ENV["VM_CPU"] || "2"
### Fedora Spins -> https://spins.fedoraproject.org
spins = %w(
gnome
kde
xfce
lxqt
lxde
mate
cinnamon
)
Vagrant.configure("2") do |config|
config.vm.box = VM_BOX
config.vm.provider "libvirt" do |lv|
lv.memory = VM_RAM
lv.cpus = VM_CPU
lv.graphics_type = "spice"
lv.video_type = "qxl"
lv.channel type: "spicevmc", target_name: "com.redhat.spice.0", target_type: "virtio"
lv.channel type: "unix", target_name: "org.qemu.guest_agent.0", target_type: "virtio"
end
config.vm.provider "virtualbox" do |vb|
vb.memory = VM_RAM
vb.cpus = VM_CPU
end
spins.each do |i|
config.vm.define "fedora-#{i}" do |vm|
vm.vm.hostname = "fedora-#{i}"
vm.vm.provision i, type: "shell", inline: "dnf -y group install #{i}"
vm.vm.provision "vdagent", type: "shell", inline: "dnf -y install spice-vdagent"
vm.vm.provision "graphical", type: "shell", inline: "systemctl set-default graphical.target"
vm.vm.provision "reboot", type: "shell", inline: "reboot"
end
end
end
@manero6
Copy link
Author

manero6 commented Mar 29, 2021

example:

vagrant up fedora-cinnamon

check status:

vagrant status

Current machine states:

fedora-gnome              not created (libvirt)
fedora-kde                not created (libvirt)
fedora-xfce               not created (libvirt)
fedora-lxqt               not created (libvirt)
fedora-lxde               not created (libvirt)
fedora-mate               not created (libvirt)
fedora-cinnamon           not created (libvirt)

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment