Create a basic directory:
mkdir centos
cd centos
After this command a Vagrantfile will be created in the centos directory:
vagrant init generic/centos8
Adjust the Vagrantfile to match these lines:
Vagrant.configure("2") do |config|
config.vm.box = "generic/centos8"
config.vm.hostname = "foohost"
config.vm.synced_folder "/mnt/ntfs/vagrant", "/vagrant_data"
config.vm.provider "libvirt" do |vb|
vb.memory = "2048"
vb.cpus = 2
end
config.vm.define "Centos8-demo" do |t|
end
config.vm.provision "shell", inline: <<-SHELL
yum -y update
yum -y upgrade
SHELL
end
Launch the virtual machine:
vagrant up --provider=libvirt
SSH to it with:
vagrant ssh
Stop it:
vagrant halt
Destroy (delete all files):
vagrant destroy