From c9997b3be3fc4796481feed034c60f62ebca0dd6 Mon Sep 17 00:00:00 2001 From: Ivan Pepelnjak Date: Mon, 18 May 2026 17:08:19 +0200 Subject: [PATCH 1/4] Fix libvirt.sh install script for Ubuntu 26.04 * Use available QEMU package * Pin vagrant to version 2.4.9-1 (otherwise the libvirt plugin does not compile) --- netsim/install/libvirt.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/netsim/install/libvirt.sh b/netsim/install/libvirt.sh index e713491910..3b944bb06a 100755 --- a/netsim/install/libvirt.sh +++ b/netsim/install/libvirt.sh @@ -12,7 +12,11 @@ $SUDO apt-get install -y $FLAG_APT ebtables dnsmasq-base sshpass tree jq bridge- echo ".. common libraries installed" echo echo "Install libvirt packages" -$SUDO apt-get install -y $FLAG_APT libvirt-dev qemu-kvm cpu-checker virtinst +QEMU_PACKAGE="qemu-kvm" +if apt-cache show qemu-system-x86 >/dev/null 2>&1; then + QEMU_PACKAGE="qemu-system-x86" +fi +$SUDO apt-get install -y $FLAG_APT libvirt-dev $QEMU_PACKAGE cpu-checker virtinst $SUDO apt-get install -y $FLAG_APT libvirt-daemon-system libvirt-clients echo ".. libvirt packages installed" echo @@ -37,11 +41,11 @@ cat < Date: Fri, 22 May 2026 17:27:20 +0200 Subject: [PATCH 2/4] Modified libvirt script to deal with -hwe qemu package --- netsim/install/libvirt.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/netsim/install/libvirt.sh b/netsim/install/libvirt.sh index 3b944bb06a..9c6676e0c0 100755 --- a/netsim/install/libvirt.sh +++ b/netsim/install/libvirt.sh @@ -12,12 +12,19 @@ $SUDO apt-get install -y $FLAG_APT ebtables dnsmasq-base sshpass tree jq bridge- echo ".. common libraries installed" echo echo "Install libvirt packages" +QEMU_SUFFIX="" QEMU_PACKAGE="qemu-kvm" -if apt-cache show qemu-system-x86 >/dev/null 2>&1; then +if dpkg -s qemu-system-x86-hwe >/dev/null 2>&1; then + echo "Detected existing qemu-system-x86-hwe package" + QEMU_PACKAGE="qemu-system-x86-hwe" + QEMU_SUFFIX="-hwe" +elif apt-cache show qemu-system-x86 >/dev/null 2>&1; then + echo "Using qemu-system-x86 instead of qemu-kvm" QEMU_PACKAGE="qemu-system-x86" fi -$SUDO apt-get install -y $FLAG_APT libvirt-dev $QEMU_PACKAGE cpu-checker virtinst -$SUDO apt-get install -y $FLAG_APT libvirt-daemon-system libvirt-clients +$SUDO apt-get install -y $FLAG_APT $QEMU_PACKAGE libvirt-dev${QEMU_SUFFIX} +$SUDO apt-get install -y $FLAG_APT libvirt-daemon-system${QEMU_SUFFIX} libvirt-clients${QEMU_SUFFIX} +$SUDO apt-get install -y cpu-checker virtinst echo ".. libvirt packages installed" echo echo "Install vagrant" From c6e87c1a480863b1d9b67a395d3318d8f7f3c3ba Mon Sep 17 00:00:00 2001 From: Ivan Pepelnjak Date: Sat, 23 May 2026 10:27:19 +0200 Subject: [PATCH 3/4] Fixing Debian 13 lack of GPG --- netsim/install/libvirt.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/netsim/install/libvirt.sh b/netsim/install/libvirt.sh index 9c6676e0c0..ab77410073 100755 --- a/netsim/install/libvirt.sh +++ b/netsim/install/libvirt.sh @@ -35,6 +35,14 @@ $SUDO rm /etc/apt/sources.list.d/vagrant.list 2>/dev/null set -e # add-apt-repository has been deprecated, doesn't work on Debian 11 and will be removed from Ubuntu 22 # changed to new method - ghostinthenet - 20220417 +# +# First, install GPG if it's missing +if ! command -v gpg >/dev/null; then + echo "Installing GPG" + $SUDO apt-get install -y gnupg2 +fi +# +# Next, add Vagrant repository curl -fsSL https://apt.releases.hashicorp.com/gpg | $SUDO gpg --dearmor -o /etc/apt/trusted.gpg.d/hashicorp-security.gpg $SUDO sh -c 'echo "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/vagrant.list' # From 56c9e857fedcf3c9738834a5c6cf6d0553ed54b6 Mon Sep 17 00:00:00 2001 From: Ivan Pepelnjak Date: Sat, 23 May 2026 10:31:23 +0200 Subject: [PATCH 4/4] Adding caveats and updated "tested on" information --- docs/netlab/install.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/netlab/install.md b/docs/netlab/install.md index 564ea066b3..c3e8e51746 100644 --- a/docs/netlab/install.md +++ b/docs/netlab/install.md @@ -28,21 +28,27 @@ Run "netlab install" with no arguments to get install script descriptions ``` ```{tip} -Running multiple installation scripts with **‌netlab install** or **netlab install --all** might fail on some Ubuntu distributions due to background processes locking the APT repository directory. If you experience that problem, execute multiple **‌netlab install** commands (one per installation script). +* The installation scripts are tested on a fresh copy of Ubuntu/Debian VM. Don't expect miracles if you run them on a system with numerous custom-installed packages. +* Running multiple installation scripts with **‌netlab install** or **netlab install --all** might fail on some Ubuntu distributions due to background processes locking the APT repository directory. If you experience that problem, execute multiple **‌netlab install** commands (one per installation script). ``` ## Installation Scripts * The *ubuntu* script installs Python3 development components that might be needed for Ansible installation, common tools like **git** and **sshpass**, and XML libraries. * The *libvirt* script installs *libvirt* and supporting libraries/packages, *vagrant*, *vagrant-libvirt* plugin, and creates the *vagrant-libvirt* virtual network. + +```{warning} +Ubuntu 26.04 introduced Hardware Enablement (`-hwe`) version of `qemu-system-x86`. The installation script will try to detect that package and install the corresponding *‌libvirt* packages if the `-hwe` package is present on your system. +``` + * The *containerlab* script installs Docker Engine and *containerlab*. * The *ansible* script uses **pip3** to install the latest version of Ansible, networking libraries (*netaddr, paramiko, netmiko*), text parsing libraries (*testfsm, ttp, ntc-templates*), and a few other utility libraries (*jmespath, yamllint, yq*) * The *graph* script installs GraphViz and D2 software needed to generate graphs from _netlab_ topologies * The *grpc* script installs gRPC Python libraries needed to configure Nokia SR Linux and Nokia SR OS. -[^UT]: Tested on Ubuntu 22.04 and 24.04 +[^UT]: Tested on Ubuntu 22.04, 24.04, and 26.04 -[^DT]: Tested on Debian 12 (bookworm) +[^DT]: Tested on Debian 12 (bookworm) and 13 (trixie) You can display an up-to-date list of installation scripts with **netlab install** command: