tags: - KVM - lxc categories: - informational comments: true

date: 2022-07-24 00:00:00

DESCRIPTION

ERRORS

VERIFICATION

COMMANDS

install kvm - debian11 (bullseye) on baremetal (Ubuntu 20:04LTS)

apt install qemu-kvm libvirt-clients libvirt-daemon-system
apt install bridge-utils libguestfs-tools genisoimage virtinst libosinfo-bin

virsh destroy l2
virsh undefine l2
rm -f l2.qcow2

console 1

create KVM

cd /opt/iso
wget "https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-11.4.0-amd64-DVD-1.iso"
export http_proxy="http://127.0.0.1:8888/"
export https_proxy="http://127.0.0.1:8888/"
ISO="/opt/iso/debian-11.4.0-amd64-DVD-1.iso"

virt-install \
 --name "l2" \
 --ram 512 \
 --disk path="l2.qcow2",format=qcow2,bus=virtio,size=20 \
 --vcpus 1 \
 --os-variant debian10 \
 --network bridge=br1 \
 --graphics none \
 --console pty,target_type=serial \
 --location "${ISO}" \
 --extra-args 'console=ttyS0,115200n8 serial' \
 --force --debug
EOF

once ready, ssh into VM

virsh list --all
ssh test1@192.168.1.xx
cat >/etc/apt/sources.list<<EOF
deb http://security.debian.org/debian-security bullseye-security main contrib
deb-src http://security.debian.org/debian-security bullseye-security main contrib
deb http://deb.debian.org/debian/ bullseye-updates main contrib
deb-src http://deb.debian.org/debian/ bullseye-updates main contrib

deb http://deb.debian.org/debian/ bullseye main contrib
deb-src http://deb.debian.org/debian/ bullseye main contrib
EOF

ssh root@192.168.1.xx

install the software required for containers

apt install –no-install-recommends debian-keyring debian-archive-keyring netcat vim-nox rsync apt install –no-install-recommends debootstrap lxc lxc-templates

for c in db1 db2 db3 db4 dsn1 dsn2 dsn3 dsn4 app1 app2 app3 app4 tt1 tt2 tt3 tt4 ints1 ints2 clt1 clt2; do lxc-start -n “${c}” done