"

15 Installing GNS3 on Linux

Calvin Lindemann

under construction
Figure 00 –

If you are not using Arch as your base OS, checkout chapter 2: Setting Up a GNS3 Environment. This chapter covers getting GNS3 up and running on Arch Linux, caveats with running GNS3 on Arch, and some troubleshooting help. Most of the labs in the textbook can be completed fully on Arch with minimal issues or modifications.

Learning Objectives

  • Create a working GNS3 learning environment on a computer running Arch Linux

Prerequisites

  • Working Arch Linux install

Deliverables

  • None – This is for student needs

Resources

Contributors and Testers

Phase I – Install VirtualBox and GNS3

Newer versions of VirtualBox (7.1.X) can work with newer GNS3 versions, but for the reasons outlined in the FAQs, we recommend using older VirtualBox and GNS3 versions to avoid issues. The instructions in this section will walk you through downloading VirtualBox 7.0.X and corresponding GNS3 2.2.X
  1. Navigate to https://archive.archlinux.org/packages/v/virtualbox/ and download the zst file starting with “virtualbox-7.0.” in the name. Any of the 7.0.x versions should work; version 7.0.20-1 is what we used during testing
  2. Navigate to https://archive.archlinux.org/packages/v/virtualbox-host-dkms/ and download the zst file with the matching version of the file you downloaded in step 1
  3. Run the following command to install the virtualbox and virtualbox-host-dkms files, that were downloaded in step 1 and 2

    pacman -U [filename]

  4. Navigate to https://aur.archlinux.org/cgit/aur.git/log/?h=gns3-server and click on a 2.2.X version, then select the download link on the following web page. Version 2.2.52 was used during testing
    Screenshot showing location of the download link for a specific AUR version
    Figure 1 – Download link for a specific AUR commit
  5. Navigate to https://aur.archlinux.org/cgit/aur.git/log/?h=gns3-gui and download the version which matches with what you downloaded in step 4
  6. Extract the tarballs downloaded in steps 4 and 5 with your file manager, or using the command below

    tar -xf [filename]

    Flag Meaning
    -x Tells tar to extract the contents of an archive
    -f Specifies the target archive
  7. Run the following command to install dependencies required to build gns3-server

    yay -Syy python-aiohttp-cors python-async-timeout

    Flag Meaning
    -S Synchronizes local package lists with the upstream sources
    yy  Forces a redownload even if local package lists are up to date
  8. Run the following command in each of the extracted directories. The PKGBUILD file contains the instructions for how your system should build the program. After running, it is safe to delete the folder and the downloaded tarball

    makepkg -s -r -c -i .

    Flag Meaning
    -s Install missing dependencies
    -r Remove dependencies that are only required to build the program
    -c Cleanup temporary files and directories
    -i Installs the package after building
  9. Run the following command to install dependencies required by GNS3. yay is used over pacman because some of the packages are in the Arch user repository (AUR). When prompted to “cleanBuild” or show a diff, enter n for None. When prompted to proceed with installation, enter y for yes

    yay -Syy qemu docker vpcs dynamips libvirt ubridge inetutils linux-headers-meta

    NOTE: If asked to choose a provider for qemu, choose qemu-full

Phase II – Ignore Updates

Upgrading GNS3 and related packages can often cause an entire GNS3 setup to get messed up. This section configures the Arch package manager (pacman) to ignore new versions of GNS3 related packages.

  1. Open /etc/pacman.conf in your choice of editor and add the following text under the “[options]” section. If the config file already has IgnorePkg defined, append the packages listed below to the end of the previous list to avoid other problems

    IgnorePkg = virtualbox virtualbox-guest-iso virtualbox-host-dkms gns3-server gns3-gui qemu docker vpcs dynamips libvirt ubridge inetutils

Phase III – Setting Up GNS3

There are a few Linux specific setup steps. This section walks through said steps.
  1. Launch GNS3 via an application launcher or by using the gns3 command
  2. Select Run appliances in a virtual machine in the server dialogue
    Server screen in the setup wizard showing backend options
    Figure 2 – Server options for GNS3
  3. Leave the defaults on the local server configuration screen and press next

    Default local server settings
    Figure 3 – Default GNS3 local server settings
  4. On the local server status screen, press next if the connection was successful
    Local server status screen
    Figure 4 – Local server status screen showing a successful connection
  5. Press okay on the following warnings that pop up. GNS3 uses VMware by default, but we’re going to setup VBox instead. The second warning says that the GNS3 VM couldn’t be found
    Missing VMware vmrun tool warning
    Figure 5 – VMware warning message
    Warning showing missing GNS3 VM
    Figure 6 – Error showing missing GNS3 VM
  6. Select VirtualBox as the virtualization software, download the GNS3 VM using the link provided, and select it in the VM name list. For instructions on importing the VM see chapter 2: Setting Up a GNS3 Environment > Part II > Steps 3 and beyond
    GNS3 setup wizard screen
    Figure 6 – Virtualization settings showing the GNS3 VM with VBox
  7. Press finish on the summary screen
    Summary screen
    Figure 7 – Summary screen

NOTE: If you get an error stating that the vboxnet0 network adapter does not exist, open the VBox settings for the GNS3 VM > Network > Adapter 1 > click on the name and press okay and exit. YES do this even if the correct network adapter is already in the box.

Phase IV – Troubleshooting and Other Notes

Running GNS3 on Arch may have slightly different behavior compared to Windows. This covers caveats to running on Arch and some troubleshooting tips.
  • Various labs require configuring MikroTik routers to act as DHCP relays. Despite many hours troubleshooting, our testers were never able to get this behavior to work properly. All of these labs are still able to be completed by configuring each MikroTik router to be a DHCP server instead of setting up DHCP relaying.
  • The error “The VirtualBox kernel modules do not match this version of VirtualBox” can be solved by running  the following command and rebooting

    vboxreload

  • The error “VirtualBox can’t operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and reboot” can be solved by running the following command and relaunching GNS3 and virtualbox

    modprobe -r kvm_intel

  • The error “Out of memory condition when allocating memory with low physical backing. (VERR_NO_LOW_MEMORY)” can be solved by rebooting or running

    echo 3 | sudo tee /proc/sys/vm/drop_caches

  • The error “The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel ([kernel version]) or it failed to load. Please recompile the kernel module and install it by sudo /sbin/vboxconfig You will not be able to start VMs until this problem is fixed.” can be fixed by running the following. The vboxconfig executable doesn’t exist on Arch

    sudo /sbin/vboxreload

  • The error “VirtualBox: error while loading shared libraries: libxml2.so.2: cannot open shared object file: No such file or directory” is caused by a missing link between the installed libxml2 package and a file in /lib. Relevant stack overflow discussion. Steps to solve:
    1. Ensure the libxml2 package is installed
    2. Use ls to show the current files and links in /lib
    3. Create the missing link using the following command between the library mentioned in the error message and a binary of similar version type. In my case, versions libxml2.so.16.0.3 and libxml2b.so.2.0.0 were installed and I chose the former

ln -s [link target path] [new link name]

libxml2 links before
Figure 8 – /lib/libxml2 links before adding the missing link
libxml2 links after
Figure 9 – /lib/libxml2 links after adding the missing link

License

Icon for the Creative Commons Attribution-NonCommercial 4.0 International License

Mastering Enterprise Networks 2e Copyright © 2024 by Mathew J. Heath Van Horn is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License, except where otherwise noted.