User Tools

Site Tools


create_box

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

create_box [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadmcreate_box [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== Criando uma box ====== 
  
-===== Instalando a vm ===== 
-<file bash> 
-$ 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 
-</file> 
- 
-===== Configurando a vm ===== 
-<file bash> 
-$ ssh vagrant@192.168.122.167 
-$ su - 
-</file> 
- 
-<file bash> 
-# visudo -f /etc/sudoers.d/vagrant 
-vagrant ALL=(ALL) NOPASSWD:ALL 
-</file> 
- 
-<file bash> 
-# vi /etc/ssh/sshd_config 
-[...] 
-UseDNS no 
-[...] 
-</file> 
- 
-<file bash> 
-# exit 
-$ exit 
-</file> 
- 
-==== Na VM hospedeira ==== 
- 
-<file bash> 
-$ wget https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant 
-$ wget https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub 
-</file> 
- 
-<file bash> 
-$ ssh-copy-id -i vagrant.pub vagrant@192.168.122.167 
-</file> 
- 
-<file bash> 
-$ chmod 0600 vagrant 
-$ ssh -i vagrant vagrant@192.168.122.167 
-</file> 
- 
-<file bash> 
-$ wget https://raw.githubusercontent.com/vagrant-libvirt/vagrant-libvirt/master/tools/create_box.sh 
-</file> 
- 
-<file bash> 
-$ sudo virsh shutdown debian11 
-</file> 
- 
-<file bash> 
-$ sudo bash create_box.sh /datastore/imagens/debian11.qcow2 
-</file> 
- 
-==== Testando a box local ==== 
-<file bash> 
-$ vagrant box add debian11.box --name debian11 
-</file> 
- 
-<file bash> 
-$ vagrant init debian11 
-$ vagrant up 
-</file> 
- 
- 
-===== Publicando uma box ===== 
-<file bash> 
-$ 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 
-</file> 
create_box.1753560543.txt.gz · Last modified: by wikiadm