This guide was developed and tested with Ubuntu Server 18.04 (LTS), however I personally use this on my production systems running Ubuntu Server 20.04 with no issues
Text in this document following the # symbol denotes comments or additional instruction
Text surrounded in [] denotes keys to press on your keyboard
Text in this format is generally commands that will need to be typed in (or copy/pasted), or the output of a command for comparison
Text within <> denotes a value that you must choose. Replace the entire portion to include <> with the correct value you determine.
This guide will NOT cover the installation method for Ubuntu Server, however there are a couple of things I recommend doing during the install:
Set a static IP Address during the install (write it down and/or make a note of it somewhere handy, you will need it later)
During the install it will ask if you want to install the openssh server, I highly recommend you do so. This will allow you to remotely manage the server later and during the GNS3 Server install process. If you did install it during the install of the operating system, you can simply SSH from another system to the server and execute this guide via SSH. If you did not install openssh server during the Ubuntu install, here is the command to do it after words:
sudo apt update && sudo apt install openssh-server
This guide will also NOT cover copying existing projects or appliances from an old server/VM over to the new one
REMEMBER: Linux is case sensitive!
CHANGELOG:
26 Dec 2022:
Added user/group to service file
Changed Docker install to reference official Docker engine instructions for Ubuntu instead of Ubuntu maintained docker.io
Added group permissions modification
# Following a fresh install of Ubuntu, it is highly recommended that you update the operating system and software
sudo apt update && sudo apt full-upgrade
# This updates the cache on the system with the Ubuntu repositories, then downloads and upgrades your system
# Once the update is complete, you should reboot the system in order to boot off the new kernel and various other software that may have been updated
sudo reboot
# First we need to install a small piece of software in order to check for virtualization support
sudo apt install cpu-checker
# Once it is installed we can run the below command
sudo kvm-ok
# This should result in the following output if virtualization is supported
INFO: /dev/kvm exists
KVM acceleration can be used
# First we need to add the repository (PPA) that hosts the GNS3 software
sudo add-apt-repository ppa:gns3/ppa
# Next we will update the repository caches again
sudo apt update
# Now we actually download and install the GNS3 Server software
sudo apt install gns3-server
# There will be two questions asked during the installation, answer YES to both
# If you want to be able to run Docker based appliances on your server, you will also need to install Docker Engine. Follow the instructions from Docker found HERE .
# Determine which user will be starting the GNS3 server, you will need this username in the next step as well as this one. We need to give this user the correct permissions to interact with KVM, libvirt, and Docker.
sudo usermod -aG kvm,libvirt,docker <user_name>
# I would recommend logging out, then logging back in at this point to ensure the permissions have been applied correctly (if it is the same user as what you are logging in as.
# To enable the server software to run as a service, we will need to create and edit a text file. The instructions below are for using vi, which is what I normally use for text editing in a Linux CLI. VIM is another option and is a bit more friendly to people not used to working on the command line.
# First we will open the file in vi so that we can edit it. The file does not exist yet, but will be written to the hard drive once we are done
sudo vi /etc/systemd/system/gns3server.service
# Now we will enter into "append mode" in vi in order to add the text we need
Press the [a] key on your keyboard
# If you are connected to the server via an SSH connection, you can simply copy and paste the following text in at this point. If not, and you are doing this locally on the server, you will need to type the following out. Replace <user_name> with the username you specified in the previous step
[Unit]
Description=GNS3 Server
[Service]
User=<user_name>
Group=<user_name>
ExecStart=/usr/share/gns3/gns3-server/bin/gns3server
[Install]
WantedBy=multi-user.target
# We now need to exit out of "append mode" and save the file, while also quitting vi
Press the [ESC] key on your keyboard twice (the second time is just to make sure)
Press the following keys in sequence: [:] [w] [q] [!] [ENTER]
# Now that we have created the file that has the configuration information for the service, we will now enable the service and start it for the first time
# The first command makes the file we created executable
# The second command creates a symbolic link to that file and enables it as a service
# The final command, actually starts the service
sudo chmod +x /etc/systemd/system/gns3server.service
sudo systemctl enable gns3
sudo systemctl start gns3
# Now that we have started the service, let's verify that the service is running, and also validate that it will start automatically after a reboot
# Check to see if the GNS3 server is running:
sudo systemctl status gns3
# You should see output similar to the below, we are looking for the BOLD portion specifically to see that the service is active and running
gns3server.service - GNS3 Server
Loaded: loaded (/etc/systemd/system/gns3.service; enabled; vendor preset: ena
Active: active (running) since Wed 2020-01-01 23:31:35 UTC; 3min 25s ago
Main PID: 1140 (gns3server)
Tasks: 1 (limit: 4915)
Memory: 71.0M
CGroup: /system.slice/gns3.service
└─1140 /usr/share/gns3/gns3-server/bin/python /usr/share/gns3/gns3-se # The rest of the output is omitted...
# Now let's go ahead and reboot the system to see if the service starts automatically at boot
sudo reboot
# Once the server has rebooted and is up and running, login via ssh or locally on the system and run
sudo systemctl status gns3
# You should see output similar to what we saw before when we checked the status. If you do, CONGRATULATIONS, you now have a working bare-metal GNS3 server!
Start your GNS3 client software, on a device other than the server, that has connectivity to the server
Edit->Preferences->Server
Uncheck the "Enable Local Server" checkbox
Under "Host" enter in the IP address of the bare-metal GNS3 Server
Uncheck "Auth"
Click "OK" button in the bottom right
It may be necessary to close the GNS3 client software and restart for the changes to fully be applied
At this point you should see the new server listed in the GNS3 GUI
At this point you are ready to start importing appliances and creating topologies
# If you want to be able to see the utilization of the servers CPU, install htop. you will be able to SSH to the server and run htop to see the CPU/Memory status
sudo apt install htop
# Optionally, you can use btop:
sudo apt install btop
# if you want to monitor CPU core temperatures, install lm-sensors
sudo apt-get install lm-sensors
# To get updates every second for the core temps, run the below from the command line on the server or over SSH:
watch -n 1 sensors