====== Criando uma box ======
===== Instalando a vm =====
$ sudo virt-install \
--name debian11 \
--description="Debian 11 - bullseye" \
--ram 2048 \
--vcpus 2 \
--disk size=32,format=qcow2 \
--cdrom /datastore/imagens/isos/debian-11.3.0-amd64-netinst.iso \
--virt-type kvm \
--os-type=Linux \
--os-variant=debian10 \
--graphics vnc,listen=0.0.0.0 \
--noautoconsole
===== Configurando a vm =====
$ ssh vagrant@192.168.122.167
$ su -
# visudo -f /etc/sudoers.d/vagrant
vagrant ALL=(ALL) NOPASSWD:ALL
# vi /etc/ssh/sshd_config
[...]
UseDNS no
[...]
# exit
$ exit
==== Na VM hospedeira ====
$ wget https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant
$ wget https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub
$ ssh-copy-id -i vagrant.pub vagrant@192.168.122.167
$ chmod 0600 vagrant
$ ssh -i vagrant vagrant@192.168.122.167
$ wget https://raw.githubusercontent.com/vagrant-libvirt/vagrant-libvirt/master/tools/create_box.sh
$ sudo virsh shutdown debian11
$ sudo bash create_box.sh /datastore/imagens/debian11.qcow2
==== Testando a box local ====
$ vagrant box add debian11.box --name debian11
$ vagrant init debian11
$ vagrant up
===== Publicando uma box =====
$ vagrant cloud publish g3anmart1ns/Debian11 1.0 libvirt debian11.box \
--description "Debian 11 Minimal" \
--version-description "Debian 11 instalação mínima" \
--release --no-private