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
99 changes: 99 additions & 0 deletions ct/gns3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/usr/bin/env bash
_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main"
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: Yumgi
# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE
# Source: https://github.com/GNS3/gns3-server

APP="GNS3"
var_tags="${var_tags:-network;emulation;lab}"
var_cpu="${var_cpu:-4}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-20}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-0}"
var_tun="${var_tun:-yes}"

export var_gns3_password="${var_gns3_password:-}"

header_info "$APP"
variables
color
catch_errors

function update_script() {
header_info
check_container_storage
check_container_resources

if [[ ! -d /opt/gns3-server ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi

if check_for_gh_release "ubridge" "GNS3/ubridge"; then
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ubridge" "GNS3/ubridge" "tarball"

msg_info "Building uBridge"
cd /opt/ubridge
$STD make
$STD make install
msg_ok "Built uBridge"
fi

if check_for_gh_release "dynamips" "GNS3/dynamips"; then
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "dynamips" "GNS3/dynamips" "tarball"

msg_info "Building Dynamips"
cd /opt/dynamips
$STD cmake -B build -DDYNAMIPS_CODE=stable
$STD cmake --build build
$STD cmake --install build
msg_ok "Built Dynamips"
fi

if check_for_gh_release "vpcs" "GNS3/vpcs"; then
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "vpcs" "GNS3/vpcs" "tarball"

msg_info "Building VPCS"
cd /opt/vpcs
$STD make
$STD make install
msg_ok "Built VPCS"
fi

if check_for_gh_release "gns3-server" "GNS3/gns3-server"; then
msg_info "Stopping GNS3 Server"
systemctl stop gns3-server
msg_ok "Stopped GNS3 Server"

PYTHON_VERSION="3.13" setup_uv

msg_info "Updating GNS3 Server"
$STD uv pip install --upgrade --python /opt/gns3-server/.venv/bin/python "gns3-server==${CHECK_UPDATE_RELEASE#v}"
cat <<EOF >~/.gns3-server
${CHECK_UPDATE_RELEASE#v}
EOF
msg_ok "Updated GNS3 Server"

msg_info "Starting GNS3 Server"
systemctl start gns3-server
msg_ok "Started GNS3 Server"
msg_ok "Updated successfully!"
fi
exit
}

start
build_container
description

msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}:3080${CL}"
echo -e "${INFO}${YW}Credentials: /etc/gns3/gns3_server.conf${CL}"
109 changes: 109 additions & 0 deletions install/gns3-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#!/usr/bin/env bash

# Copyright (c) 2021-2026 community-scripts ORG
# Author: Yumgi
# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE
# Source: https://github.com/GNS3/gns3-server

source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os

msg_info "Installing Dependencies"
$STD apt install -y \
build-essential \
cmake \
libpcap-dev \
libelf-dev \
libcap2-bin \
qemu-system-x86 \
qemu-utils
msg_ok "Installed Dependencies"

fetch_and_deploy_gh_release "ubridge" "GNS3/ubridge" "tarball"

msg_info "Building uBridge"
cd /opt/ubridge
$STD make
$STD make install
msg_ok "Built uBridge"

fetch_and_deploy_gh_release "dynamips" "GNS3/dynamips" "tarball"

msg_info "Building Dynamips"
cd /opt/dynamips
$STD cmake -B build -DDYNAMIPS_CODE=stable
$STD cmake --build build
$STD cmake --install build
msg_ok "Built Dynamips"

fetch_and_deploy_gh_release "vpcs" "GNS3/vpcs" "tarball"

msg_info "Building VPCS"
cd /opt/vpcs
$STD make
$STD make install
msg_ok "Built VPCS"

PYTHON_VERSION="3.13" setup_uv

GNS3_VERSION=$(get_latest_github_release "GNS3/gns3-server")
msg_info "Installing GNS3 Server ${GNS3_VERSION#v}"
$STD uv venv --python 3.13 /opt/gns3-server/.venv
$STD uv pip install --python /opt/gns3-server/.venv/bin/python "gns3-server==${GNS3_VERSION#v}"
cat <<EOF >~/.gns3-server
${GNS3_VERSION#v}
EOF
msg_ok "Installed GNS3 Server ${GNS3_VERSION#v}"

msg_info "Configuring GNS3 Server"
mkdir -p /etc/gns3 /opt/gns3/{images,projects,appliances,symbols,configs}
cat <<EOF >/etc/gns3/gns3_server.conf
[Server]
host = 0.0.0.0
port = 3080
images_path = /opt/gns3/images
projects_path = /opt/gns3/projects
appliances_path = /opt/gns3/appliances
symbols_path = /opt/gns3/symbols
configs_path = /opt/gns3/configs
report_errors = False
auth = True
user = admin
password = ${var_gns3_password:-$(random_password)}

[Qemu]
enable_hardware_acceleration = True
require_hardware_acceleration = False
EOF
chmod 600 /etc/gns3/gns3_server.conf
msg_ok "Configured GNS3 Server"

msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/gns3-server.service
[Unit]
Description=GNS3 Server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=root
ExecStart=/opt/gns3-server/.venv/bin/gns3server --config /etc/gns3/gns3_server.conf
Restart=on-failure
RestartSec=5
LimitNOFILE=16384

[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now gns3-server
msg_ok "Created Service"

motd_ssh
customize
cleanup_lxc
56 changes: 56 additions & 0 deletions json/gns3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "GNS3",
"slug": "gns3",
"categories": [
4
],
"date_created": "2026-12-03",
"type": "ct",
"updateable": true,
"privileged": true,
"interface_port": 3080,
"documentation": "https://docs.gns3.com/",
"website": "https://www.gns3.com/",
"repository": "https://github.com/GNS3/gns3-server",
"architectures": ["amd64", "arm64"],
"platforms": ["pve", "incus"],
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/gns3.webp",
"description": "GNS3 is a network emulator for building, testing and troubleshooting virtual and real network topologies. It runs Cisco IOS (Dynamips), QEMU appliances and VPCS hosts, and is driven from the GNS3 desktop client or its built-in web UI.",
"install_methods": [
{
"type": "default",
"script": "ct/gns3.sh",
"config_path": "/etc/gns3/gns3_server.conf",
"resources": {
"cpu": 4,
"ram": 4096,
"hdd": 20,
"os": "Debian",
"version": "13"
}
}
],
"default_credentials": {
"username": "admin",
"password": null
},
"notes": [
{
"text": "Sign in as admin with the password from /etc/gns3/gns3_server.conf. The desktop client must run the same 2.2.x version as the server.",
"type": "info"
},
{
"text": "QEMU appliances need KVM: on the host add 'lxc.cgroup2.devices.allow: c 10:232 rwm' and 'lxc.mount.entry: /dev/kvm dev/kvm none bind,optional,create=file' to the container config, then restart it.",
"type": "warning"
}
],
"app_vars": [
{
"name": "var_gns3_password",
"label": "Admin Password",
"type": "password",
"secret": true,
"help": "Password for the GNS3 server API and web UI. Generated when left empty"
}
]
}