如何使用vagrant创建并管理kvm虚拟机?

安装vagrant-libvirt

Archlinux,其他linux类似

#!/usr/bin/env bash
[[ -n $DEBUG ]] && set -x
set -eou pipefail

useage(){
  cat <<"EOF"
USAGE:
    install_vagrant_libvirt.sh
EOF
}

exit_err() {
   echo >&2 "${1}"
   exit 1
}

if [ $# -lt 0 ];then
    useage
    exit 1
fi

ln -s /usr/include/libxml2/libxml /usr/include/libxml
CONFIGURE_ARGS='with-ldflags=-L/opt/vagrant/embedded/lib with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib' GEM_HOME=~/.vagrant.d/gems GEM_PATH=$GEM_HOME:/opt/vagrant/embedded/gems PATH=/opt/vagrant/embedded/bin:$PATH proxychains vagrant plugin install vagrant-libvirt

posted @ 2019-12-06 16:48  futuretea  阅读(970)  评论(0编辑  收藏  举报