Your Cart

Guide for vTestbed Setup in GNS3

Solution Brief By

Learn How to Set Up a vTestbed in GNS3

Run SONiC’s virtual switch, or VS, image in GNS3 to build the topologies used in the SONiC lab guides. Choose the branch for the lab before importing its appliance.

Humza Altaf’s original September 2023 guide used Ubuntu 22.04 and a SONiC 202305 image. The steps below use GNS3 2.2.61 and a 202605 image, and Step 2 explains what the older labs need.

Step 1. Prepare the GNS3 Server

Install GNS3 2.2.61, the newest 2.2 release (30 July 2026), and use that same version for the GUI, the server and any GNS3 VM. The GUI refuses to connect to a server whose major, minor or patch version differs. The SONiC appliance needs an x86-64 Linux server with KVM to run QEMU.

The GNS3 PPA offers 2.2.61 for Ubuntu 24.04 and 26.04 but only 2.2.55 for Ubuntu 22.04, so run a local Linux server on one of the two newer releases and check that the GUI and server both report 2.2.61. The pipx route on the GNS3 Linux page installs neither ubridge, which GNS3 needs to start QEMU nodes, nor vpcs, which runs the lab hosts. If you use that route, add both programs and pin the packages as gns3-gui==2.2.61 and gns3-server==2.2.61, including the server package injected into the GUI environment. An unpinned install currently gives 3.0.6. GNS3 3.0.6 is also a stable release, but its appliance wizard has no Qemu settings page, so the import steps below follow 2.2.61. On Windows or macOS, run QEMU in a GNS3 VM or on a remote Linux server, because GNS3 does not support QEMU on those desktops.

DesktopWhere to run the SONiC VM
x86-64 LinuxA local Linux server with QEMU and KVM, following the GNS3 Linux installation instructions
x86-64 Windows or Intel macOSA GNS3 VM that exposes x86-64 KVM, or a remote Linux server
An ARM desktop, including Apple siliconA remote x86-64 Linux server with KVM for this procedure

Enable hardware virtualization on the execution host, and on a Linux server confirm that /dev/kvm exists. If that host is a VM, its hypervisor must pass the virtualization extensions through. On Windows 10 and 11, Hyper-V, Virtualization-Based Security and the Virtual Machine Platform that WSL 2 uses stop VMware Workstation from doing this, so the VMware GNS3 VM fails to start or runs without KVM. Turn those features off, or use the Hyper-V GNS3 VM, which GNS3 starts with nested virtualization enabled. Many cloud VMs also hide these extensions.

Check that GNS3 connects to the intended server before importing an appliance. If that server lacks KVM, the import wizard stops at Qemu settings with “The selected server does not support KVM. A Linux server or the GNS3 VM running in VMware is required.”

GNS3 GUIyour desktoplocal Linux serverx86-64 Linux desktopGNS3 VMWindows or Intel Macremote Linux serverany desktop, Apple siliconSONiC VSQEMU and KVM
The GNS3 GUI can run on your desktop while a Linux server runs SONiC through QEMU and KVM.

Step 2. Choose the SONiC Branch

Use the branch shown for the lab you want to follow. Each guide was recorded on that branch.

GuideCommunity SONiC branch
VLAN202205
Inter-VLAN202205
PortChannel202205
MCLAGNot stated in the original lab. Use an image that includes iccpd
Config_DB202305
New labs on a current image202605, the newest release branch with VS builds on 14 November 2026

Each value in the table names a branch, which receives many builds. Record the build number, build date and commit as well, because two builds from one branch can contain different software.

On 14 November 2026 the build site offers no VS image for 202205 or 202305. Its vs rows go back only to 202311, the 202305 build history is empty, and the one remaining 202205 build, 20220831.4, has no artifacts.

For those historical branches, use an image you kept from that branch, or build one by following the branch’s README with make configure PLATFORM=vs and make target/sonic-vs.img.gz. Those branches use Debian 10 and 11 build environments, whose long-term support ended on 30 June 2024 and 31 August 2026, so the build may need package-source changes. A newer branch needs each lab command and result checked again, and cannot be assumed to reproduce the recorded lab.

For example, SONiC 202205 does not expose fast LACP through its CLI, while 202211 adds the --fast-rate option. The PortChannel guide explains that difference, so substituting a newer image changes which commands are available.

MCLAG needs the iccpd container, which community SONiC includes only in images built with INCLUDE_ICCPD=y, so check that the image has it before planning on MCLAG. The official 202605 VS build 20261114.3 does not include docker-iccpd.

Step 3. Download and Extract the VS Image

Prepare the files in a Linux shell with Bash, curl, gzip, md5sum, GNU stat and qemu-img from the qemu-utils package, such as the Linux server or a separate Linux VM. The macOS shell lacks GNU stat, and WSL 2 on Windows turns on the Virtual Machine Platform described in Step 1, so use WSL only with a remote server or the Hyper-V GNS3 VM. Open the official SONiC image pipeline and select Build History on the vs row for your branch. Choose a build whose result is succeeded, then select Artifacts.

Choose the sonic-buildimage.vs artifact and download target/sonic-vs.img.gz. Record the build number, date and commit from the history page, and keep each build in its own directory.

The Copy Latest Static Link button beside the file gives a link that follows the branch’s newest build, such as https://sonic-build.azurewebsites.net/api/sonic/artifacts?branchName=202605&platform=vs&target=target%2Fsonic-vs.img.gz. The 202605 archive is about 2.5 GB, and builds can disappear from the site, so keep the archive once you have it.

Extract the archive before creating the appliance, because the generator reads the uncompressed disk. Run the archive check in the directory containing the download. If gzip reports an error, stop and download the archive again.

gzip -t sonic-vs.img.gz

Extract the disk to a file name that includes the branch. GNS3 stores QEMU images by file name, so a second image named sonic-vs.img would replace the first one under its existing template and nodes. The command below keeps sonic-vs.img.gz and creates sonic-vs-202605.img.

gzip -dc sonic-vs.img.gz > sonic-vs-202605.img
qemu-img info sonic-vs-202605.img

qemu-img info should report file format: qcow2, because the VS build creates a QCOW2 disk despite the .img name. If it reports anything else, download the archive again.

FilePurpose
sonic-vs.img.gzCompressed disk image downloaded from the build
sonic-vs-202605.imgUncompressed disk image used by QEMU, named for its branch
.gns3a file generated in Step 4Appliance description containing the image reference and QEMU settings
sonic-vs.img.gzdownload archiveextractsonic-vs-202605.imgQCOW2 disksonic-gns3a.shappliance scriptgenerateSONiC-202605.gns3aJSON descriptionimport applianceSONiC VM template
Extract the disk image, generate its appliance description and import both files into GNS3.

Step 4. Generate the Appliance File

Download sonic-net’s appliance generator into the directory that holds the extracted image. The commit below is the script’s latest version on 14 November 2026. Keep spaces out of the image file name, because the script does not quote it.

curl -fLO https://raw.githubusercontent.com/sonic-net/sonic-buildimage/f1e84f9cd8a1ce8c3b5ec81daae6cae75854fb0a/platform/vs/sonic-gns3a.sh

This example uses a 202605 image. For an image from another branch, use that branch in both the file name and the -r value.

bash sonic-gns3a.sh -r 202605 -b sonic-vs-202605.img

Successful generation creates SONiC-202605.gns3a in the working directory. Running the script with bash means it needs no execute permission.

The release option supplies the version label. Confirm the running software in Step 9 before applying any lab commands.

An appliance file is a JSON description of the image and QEMU settings. It includes the image’s MD5 checksum and byte count, along with the settings below.

SettingGenerated value
Registry version3
Appliance statusexperimental
Device categoryrouter
Architecturex86_64
KVMRequired
RAM2048 MB
Network adapters10
Adapter typee1000
Disk interfacevirtio
ConsoleTelnet
vCPUsNot set, so GNS3 uses 1
Adapter nameseth0, then Ethernet0 to Ethernet8

Leave registry_version at 3. GNS3 2.2.61 checks versions 1 to 7 against one layout and version 8 against another, so changing the number to 8 without rewriting the file breaks it.

On Windows or macOS, copy the completed appliance and uncompressed image to a folder the GNS3 GUI can read. The import wizard uploads the image to the selected GNS3 VM or remote server.

Step 5. Import the Appliance

In GNS3, open File and select Import appliance, then choose the generated .gns3a file. On the Server page, select Install the appliance on the GNS3 VM (recommended), Install the appliance on a remote server or, on a Linux desktop, Install the appliance on your local computer, to match Step 1.

At Qemu settings, select the qemu-system-x86_64 binary that GNS3 lists for that server. When the server has only one, GNS3 selects it and can move to the next page by itself. At Required files, select SONiC version 202605 and import sonic-vs-202605.img if GNS3 has not found it. Continue when the version shows Ready to install, confirm the installation and finish the wizard.

If the checksum does not match, restore the intended image or regenerate the appliance for the exact file you intend to use. The generated checksum checks that those two local files agree, but does not establish the image’s source or branch.

The template appears under Browse Routers as SONiC 202605. GNS3 lists it there because the appliance uses the router category.

Step 6. Set the VM Resources

In Preferences, open Qemu VMs under QEMU, select the SONiC template and choose Edit. On General settings, change the RAM and vCPUs. The generator sets 2048 MB and leaves one vCPU, while sonic-net’s GNS3 example uses 8192 MB and four vCPUs. Use the GNS3 example’s allocation below for every branch.

ResourceAllocation per SONiC VM
RAM8192 MB
vCPUs4

Size the server for every switch in the lab as well as the host and GNS3. Two switches at this allocation need 16 GB of RAM and eight vCPUs on their own. A GNS3 VM starts with 2048 MB and one vCPU unless you change them, so raise both on its GNS3 VM page in Preferences before starting the switches.

Step 7. Start the Virtual Switch

Create a project through File and New blank project. Drag a SONiC node into the workspace and name it S1.

Right-click S1 and select Start, then open Console. The green toolbar button can start all nodes in a project, but begin with one switch so a boot problem is easy to identify.

Wait for the SONiC login prompt in the console. A running node icon confirms that QEMU started, while successful login and the checks in Step 9 confirm what booted.

Step 8. Log In and Change the Password

For a community image whose credentials were not changed at build time, sonic-net documents the default login below. The username and password are case sensitive.

FieldDefault
Usernameadmin
PasswordYourPaSsWoRd

Change the password before making the switch reachable from another network. Run the following command inside SONiC and enter the new password twice.

sudo passwd admin

Log out of the console session and confirm that you can log in with the new password. An image built with other USERNAME or PASSWORD make options uses those values instead, and one built from 202305 or later with CHANGE_DEFAULT_PASSWORD=y asks for a new password at first login.

Step 9. Check the Image and Starting Configuration

Check the software identity and interfaces before applying a lab configuration. Compare the build, hardware SKU and addresses with those required by the chosen guide.

show version
show platform summary
show interfaces status
show ip interfaces

Confirm that the software version and build commit match the image you selected. The appliance’s displayed version is only the label supplied to the generator.

Historical labs in this series use the Force10-S6000 hardware SKU and the t1 sample configuration. That preset gives the ports addresses before any lab commands are entered.

With the default Force10-S6000 SKU and t1 preset, a new switch on 202205, 202305 or 202605 starts with the addresses below. The preset assigns them as consecutive /31 subnets.

SONiC interfaceDefault IPv4 address
Ethernet010.0.0.0/31
Ethernet410.0.0.2/31
Ethernet810.0.0.4/31
Ethernet1210.0.0.6/31

An image with another hardware SKU or starting configuration needs its own port and address mapping. Unconnected ports can be operationally down, and the lab’s verification steps will check forwarding after the links and configuration are in place.

Step 10. Build the Chosen Lab

Add the SONiC nodes and hosts required by the selected guide. GNS3 includes Virtual PC Simulator, or VPCS, under End devices, without a separate host image.

Connect the devices using that lab’s topology. The link menu lists the template’s ports as eth0 and Ethernet0 to Ethernet8, and the canvas interface labels show them as eth0 and e0 to e8. Port eth0 is the SONiC management interface, and GNS3 port EthernetN is SONiC interface Ethernet followed by four times N.

GNS3 portSONiC interface
eth0eth0, management
Ethernet0Ethernet0
Ethernet1Ethernet4
Ethernet2Ethernet8
Ethernet3Ethernet12
Ethernet8Ethernet32, the last of nine data ports

Leave eth0 unconnected in these labs, and never connect a host to it. Follow the selected guide’s SONiC port names, and confirm each connection with its interface and ping checks.

Save the GNS3 project after building the topology. After configuring a switch, save its SONiC configuration from that switch’s console as well.

sudo config save -y

In each VPCS console, run save after setting its address, which writes it to startup.vpc. Saving the GNS3 project does not save switch or host settings.

save

Confirm persistence by stopping and starting the lab, then checking the saved switch and host settings. Use the selected guide’s verification tests after restoring the project.

A working virtual lab does not qualify a physical switch or measure a switch ASIC’s forwarding performance. For hardware, check the supported platform, image and features separately on the SONiC supported platforms page.

The many benefits of SONiC, once exclusive to hyperscalers, are now within reach for enterprise clients. Contact our team of seasoned networking experts to learn why right now is a transformative time in the industry as we move closer to wider SONiC adoption.

Humza Altaf
Hardware Nation

Quickly identify your needs and craft a plan of action with help from our seasoned experts.