Vagrant for Libvirt
Install Vagrant
https://www.vagrantup.com/downloads.html
# rpm -Uvh vagrant_1.8.7_x86_64.rpmInstall vagrant-libvirt plugin
# yum install -y \
libxslt-devel \
libxml2-devel \
ruby-devel \
libguestfs-tools-c \
gcc \
qemu\
qemu-kvm
libvirt \
libvirt-develhttps://github.com/vagrant-libvirt/vagrant-libvirt/releases
# usermod -aG libvirt rootlogout and login
# vagrant plugin install vagrant-libvirtSpin up VM
# vagrant init centos/7
# vagrant up --provider libvirtSign into VM
Change root password
# vagrant ssh
(localhost) $ sudo su -
(localhost) # passwdVagrantfile
Adding ssh keys
https://stackoverflow.com/questions/30075461/how-do-i-add-my-own-public-key-to-vagrant-vm
Join virtual network
config.vm.network :private_network,
:libvirt__network_name => "isolab"Change interface in the management subnet (192.168.122.0/24) at /etc/sysconfig/network-scripts/ifcfg-eth<X> from BOOTPROTO="dhcp" to BOOTPROTO="none". And restart networking with systemctl restart network.
define another box by name
config.vm.define "foobar" do |foobar|
end