Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid

brctl: network bridges

# create bridge
brctl addbr br0
ifconfig eth0 0.0.0.0

brctl delif lxcbr0 eth0
brctl addif br0 eth0
dhclient br0

# move VM to other bridge
for IF in $(brctl show | grep veth | sed 's/^[ \t]*//'); do
    brctl delif lxcbr0 ${IF}
    brctl addif br0 ${IF}
done


# connect two bridges?
ip link add veth0 type veth peer name veth1
ifconfig veth0 up
ifconfig veth1 up

brctl delif br0 veth0
brctl delif lxcbr0 veth1


# renew ip in VM
lxc-attach -n vm1 -- dhclient


# /etc/network/interfaces
auto eth0
iface eth0 inet manual

auto br0
iface br0 inet dhcp
    bridge_ports eth0

VirtualBox

Installation
http://www.panticz.de/Install-VirtualBox

List VMs

VBoxManage list vms
VBoxManage startvm livecd-creator

Links
https://www.virtualbox.org/manual/ch08.html#vboxmanage-startvm

Update LXC container templates filesystem

[embed_url: https://raw.githubusercontent.com/panticz/lxc/master/scripts/lxc-update-templates.sh]

# fix dns
echo "nameserver 8.8.8.8" > /var/cache/lxc/debian/rootfs-wheezy-amd64/etc/resolv.conf

Cronjob

echo "0 13 * * *    root    /usr/bin/wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/lxc/master/scripts/lxc-update-templates.sh -O - | bash -" > /etc/cron.d/lxc_update_template
service cron restart
# fix squeeze repository
sed -i 's|cdn.debian.net|ftp.debian.org|g' /var/cache/lxc/debian/rootfs-squeeze-amd64/etc/apt/sources.list

Docker

Install Docker
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

# Install the latest Docker version
udo apt-get install -y docker-ce #docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

docker info

Deploy Docker CE with Ansible

- name: Install Docker
  become: true
  block:
    - name: Download Docker repository key
      get_url:
        url: https://download.docker.com/linux/ubuntu/gpg
        dest: /etc/apt/keyrings/docker.asc
        mode: '0644'

    - name: Add Docker repository
      ansible.builtin.apt_repository:
        repo: "deb [signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable"
        update_cache: yes

    - name: Install docker-ce
      apt:
        name: docker-ce

Deprected

wget -qO- https://raw.githubusercontent.com/panticz/installit/master/install.docker.sh | sudo bash

[embed_url: https://raw.githubusercontent.com/panticz/installit/master/install.docker.sh]

Enable Remote API
https://docs.docker.com/config/daemon/systemd/

Install LXC (Linux Containers) under Ubuntu

Installation

apt install -y bridge-utils debootstrap lxc-templates lxc

http://www.panticz.de/install_lxc

Create container

export LANG=en_US.UTF-8
export CONTAINER=wheezy

sudo sudo lxc-destroy -n ${CONTAINER}
sudo lxc-create -t debian -n ${CONTAINER}
sudo lxc-start -d -n ${CONTAINER}

echo 'Acquire::http::Proxy "http://apt-cacher:3142/";' | sudo tee /var/lib/lxc/${CONTAINER}/rootfs/etc/apt/apt.conf

sudo lxc-attach -n ${CONTAINER} -- apt-get clean
sudo lxc-attach -n ${CONTAINER} -- apt-get update
sudo lxc-attach -n ${CONTAINER} -- apt-get dist-upgrade -y
sudo lxc-attach -n ${CONTAINER} -- apt-get install -y wget vim

# start container in forderground
lxc-start -n vm1  -F

# optional
echo "lxc.start.auto = 1" | tee -a /var/lib/lxc/${CONTAINER}/config

# connect to container
ssh root@$(sudo lxc-info -i -H -n ${CONTAINER})

Install LXC from testing on Debian

echo "deb http://ftp.debian.org/debian testing main" >> /etc/apt/sources.list.d/testing.list
apt-get update
apt-get -t testing install -y lxc
sed -i 's|lxc.network.type = empty|lxc.network.type = veth|' /etc/lxc/default.conf
echo "lxc.network.link = lxcbr0" >> /etc/lxc/default.conf

Update LXC container templates

wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/lxc/master/scripts/lxc-update-templates.sh -O - | sudo bash -

# required for fedora container
sudo apt-get install -y yum  curl

OPTIONAL: install wget and vim by default under debian

sed -i '/iproute/a wget,\\\nvim,\\' /usr/share/lxc/templates/lxc-debian

OPTIONAL: enable apt-cache

Virtualization

# detect virtualization
dmesg | egrep -i 'xen|front'

XEN

Links
http://wiki.univention.de/index.php?title=Installing-signed-GPLPV-drivers - Installing-signed-GPLPV-drivers
http://www.pug.org/index.php/Xen-Installation - Xen installation manual on PUG [German]
http://man.cx/xen-create-image - Manpage for xen-create-image
http://wiki.xensource.com/xenwiki/ - http://wiki.xensource.com/xenwiki/
http://wiki.debian.org/Xen
http://www.neobiker.de/wiki/index.php?title=Debian_XEN_Installation
http://xen-tools.org/software/xen-tools/
http://wiki.xensource.com/xenwiki/XenNetworking
http://www.xen-support.com/
http://packages.ubuntu.com/hardy/linux-image-2.6.24-23-xen - Ubuntu dom0 kernel
http://www.xenserver5.com/videos/Getting_Started_with_XenServer/Getting_Started_with_XenServer.htm - Citrix XenServer HowTo video
http://code.google.com/p/ganeti/ - ???
http://www.virtuatopia.com/index.php/Creating_and_Booting_a_Xen_Guest_domainU_using_an_NFS_Mounted_Root_Filesystem
http://www.xen.org/products/cloudxen.html - Windows driver
http://code.google.com/p/gentoo-xen-kernel/downloads/list - Xen dom0 kernel ebuilds using rebased Opensuse xen-patches
http://bderzhavets.wordpress.com/ - Xen Virtualization on Linux and Solaris Blog
http://code.google.com/p/spice4xen/ - SPICE support for Xen

Check CPU support for full virtualizon

egrep -c 'vmx|svm' /proc/cpuinfo

If the output are bigger then 0 your CPU supports full virtualizon so you can run Windows or other unmodified OS under XEN or KVM.

direct device access

disk=['phy:/dev/sdb2,hda,w','phy:/dev/cdrom,hdc:cdrom,r']

List memory usage by VM

for HOST in $(xm list  | cut -d" " -f1 | grep -v Name | grep -v Domain-0); do
    echo ${HOST}
    ssh ${HOST} LANG=en free -m | head -2
    echo
done

ntpdate

Pagination

  • Previous page
  • 2
virtualization
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung