Files
Syed Ahsan ebff530fa4 Vagrant Libvirt Instructions update (#189)
* Vagrant Libvirt Instructions update

This patch adds the users to the default group so we dont
have to use sudo to start the vagrant, as using sudo is not
the most optimal route for gems to be properly configured.

Signed-off: Syed Ahsan<ahsanmohsin04@yahoo.com>
2019-10-08 11:10:50 -07:00

2.2 KiB

Detailed Vagrant installation steps for different distros

Install vagrant on Ubuntu

On Ubuntu Bionic, run these commands Install dependencies and prepare system

sudo apt-get update
sudo apt-get install gcc make
sudo apt-get install qemu qemu-kvm libvirt-bin ebtables dnsmasq-base virt-top  libguestfs-tools virtinst bridge-utils
sudo apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev
sudo modprobe vhost_net
sudo lsmod | grep vhost
echo "vhost_net" | sudo tee -a /etc/modules

Download the latest Debian package from https://www.vagrantup.com/downloads.html and install it followed by vagrant-libvirt

sudo dpkg -i vagrant_${VER}_x86_64.deb
vagrant plugin install vagrant-libvirt

Make sure to add the user to the default group

usermod --append --groups libvirt `whoami`

Run vagrant

vagrant up --provider=libvirt

Note, in order to spin up vagrant to use different CPUS and MEMORY for individual VM's:

CPUS=4 MEMORY=8096 vagrant up clr-01 --provider=libvirt

Note, vagrant installation steps were derived from:

Install vagrant on Clear Linux

On Clear Linux, run these commands

sudo swupd update

Make sure all the prerequisite packages are installed

sudo swupd bundle-add unzip rsync wget kvm-host

Now, run the following scripts

wget https://raw.githubusercontent.com/AntonioMeireles/ClearLinux-packer/master/extras/clearlinux/setup/libvirtd.sh
chmod +x libvirtd.sh
./libvirtd.sh
wget https://raw.githubusercontent.com/AntonioMeireles/ClearLinux-packer/master/extras/clearlinux/setup/vagrant.sh
chmod +x vagrant.sh
./vagrant.sh

Check if vagrant is installed successfully

vagrant --version

Run vagrant

vagrant up --provider=libvirt

You can check the vagrant status using the following command

vagrant status