Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/netlab/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
27 changes: 23 additions & 4 deletions netsim/install/libvirt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +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"
$SUDO apt-get install -y $FLAG_APT libvirt-dev qemu-kvm cpu-checker virtinst
$SUDO apt-get install -y $FLAG_APT libvirt-daemon-system libvirt-clients
QEMU_SUFFIX=""
QEMU_PACKAGE="qemu-kvm"
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 $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"
Expand All @@ -24,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'
#
Expand All @@ -37,11 +56,11 @@ cat <<FILE | $SUDO tee /etc/apt/preferences.d/vagrant
# https://github.com/ipspace/netlab/issues/2436 for details
#
Package: vagrant
Pin: version 2.4.3-1
Pin: version 2.4.9-1
Pin-Priority: 1000
FILE
. apt-get-update.sh
$SUDO apt-get install -y --allow-downgrades $FLAG_APT ruby-dev ruby-libvirt vagrant=2.4.3-1
$SUDO apt-get install -y --allow-downgrades $FLAG_APT ruby-dev ruby-libvirt vagrant
vagrant plugin install vagrant-libvirt --plugin-version=0.12.2
echo ".. vagrant installed"
echo
Expand Down