Add libvirt helpers

This commit is contained in:
Neill Cox 2023-09-20 12:02:40 +10:00
parent f4e9b627f8
commit 6a5b1e8451
4 changed files with 108 additions and 0 deletions

46
virt-install/cmd.sh Normal file
View file

@ -0,0 +1,46 @@
# sudo dnf install -y guestfs-tools
# sudo dnf install virt-viewer ??
qemu-img create -f qcow2 -o preallocation=metadata test.qcow2 100G
virt-resize --expand /dev/sda3 /home/ncox/Downloads/rhel-guest-image-8.4-1269.x86_64.qcow2 ./test.qcow2
# Run under sudo - won't work as a user mode install
sudo virt-install \
--os-variant rhel8.4 \
--name test \
--memory 2048 \
--disk ./test.qcow2 \
--import \
--graphics spice,listen=0.0.0.0 \
--video virtio \
--channel spicevmc \
--wait 0 \
--cloud-init meta-data=./meta-data,user-data=./user-data \
--network \
--network
--network br0 \
--extra-args "ip=192.168.1.2::192.168.1.1:255.255.255.0:test.example.com:eth0:none"
[root@rhel-8 ~]# virt-install
--name centos8-2 --memory 10240 --vcpus=2
--cdrom=/tmp/rhel-server-7.6-x86_64-dvd.iso
--disk path=/disks/centos8-2.qcow2,size=20,format=qcow2
--network bridge=nm-bridge --graphics=vnc -v
Starting install...