How to set up GNS3 server on VirtualBox?

STORDIS-gns3-virtualbox-banner-3200x1200.png

[stordis-toc]

Introduction

GNS3 lets you build and test SONiC networks without physical switches. The GNS3 VM is a ready virtual machine with the GNS3 server. You do not need to install GNS3 manually.

This guide shows how to import the GNS3 VM into VirtualBox, configure it, start it and open the GNS3 web interface.

Prerequisites

  1. VirtualBox 7 on Windows, Linux or macOS (Intel).
  2. A CPU with hardware virtualization (Intel VT-x with EPT or AMD-V with RVI). Make sure that it is enabled in the BIOS/UEFI of the computer.
  3. Administrator rights on the computer.
Resource Recommended for the GNS3 VM
CPU 8 or more logical cores (for example Intel Core i7/i9 or AMD Ryzen 7/9)
RAM 32 GB or more in the computer
Disk 80 GB or more of free space on an SSD

What you need

  • The GNS3 VM for VirtualBox (refer to Step 2). Use the same version as your GNS3 client.
  • The name of the network interface of your computer for the bridged network (refer to Step 4).

Step 1: Prepare Windows 11 (only for Windows 11 24H2 and later)

Windows 11 24H2 and later uses Hyper-V and virtualization-based security. Then VirtualBox cannot give hardware virtualization to the GNS3 VM. Turn off these functions.

CAUTION

These commands turn off Hyper-V, WSL 2 and virtualization-based security (Memory integrity). On a company computer, speak to your IT department first.

  1. Open PowerShell as Administrator.
  2. Type these commands:
bcdedit /set hypervisorlaunchtype off
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
Disable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
Disable-WindowsOptionalFeature -Online -FeatureName WindowsHypervisorPlatform
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard" -Name "EnableVirtualizationBasedSecurity" -Value 0
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard" -Name "RequirePlatformSecurityFeatures" -Value 0
  1. Restart the computer. The changes start to operate only after the restart.

Step 2: Download the GNS3 VM

Download the VirtualBox version of the GNS3 VM.

GNS3 website (recommended) GitHub
  1. Go to https://gns3.com/software/download-vm.
  2. Select VirtualBox.

GNS3 VM download page with the VirtualBox option

The file is a ZIP archive. Extract it. It contains the file GNS3 VM.ova.


Step 3: Import the VM into VirtualBox

  1. Start VirtualBox. Select File > Import Appliance.

    Import Appliance in the File menu of VirtualBox

  2. Select the file GNS3 VM.ova that you extracted in Step 2. Click Open and complete the import.

    Selection of the GNS3 VM OVA file


Step 4: Configure the VM

Do this step when the VM is off.

  1. In the VirtualBox Manager, select GNS3 VM.

    GNS3 VM selected in the VirtualBox Manager

  2. Click Settings.

    Settings button in the VirtualBox toolbar

  3. System > Motherboard: set the memory. Give the VM as much RAM as possible, but keep 4–8 GB for the computer.

    Motherboard tab with the base memory

  4. System > Processor: set the number of CPUs. Select Enable Nested VT-x/AMD-V. GNS3 needs it to start SONiC with KVM.

    Processor tab with the number of CPUs

    If the checkbox is not available, use this command (VirtualBox installation directory or PATH):

    VBoxManage modifyvm "GNS3 VM" --nested-hw-virt on
  5. Network > Adapter 1:

    • Make sure that Enable Network Adapter is selected.
    • Set Attached to to Bridged Adapter.
    • In Name, select the network interface of your computer.
    • Open Advanced and set Promiscuous Mode to Allow All.

    Network settings of Adapter 1 with Bridged Adapter and Promiscuous Mode Allow All

  6. Click OK.
Network mode When to use it
Bridged Adapter (recommended) The VM is a separate device in your network with its own IP address. You can connect to GNS3 from other computers.
NAT The VM uses the IP address of the computer for internet access. Other devices cannot connect to the VM directly.
Internal Network A private network only between VMs. No connection to the computer or to other networks.

Step 5: Start the VM and open the GNS3 web interface

  1. Select GNS3 VM and click Start.

    Start button in VirtualBox

  2. A console window shows the start of the VM.

    Console window during the start of the GNS3 VM

  3. When the VM is ready, the console shows the IP address of the GNS3 server. Make sure that the KVM support line shows True. Write down the IP address.

    GNS3 VM console with the IP address and KVM support

  4. In a web browser, open the IP address. The GNS3 web interface opens.

    GNS3 web interface with a new project

To add SONiC to GNS3, create an appliance template (refer to the links at the end of this guide).


Troubleshooting

GNS3 shows that KVM is not available
  • Make sure that Enable Nested VT-x/AMD-V is selected (Step 4).
  • On Windows 11, make sure that Hyper-V is off. In PowerShell as Administrator, the command must show hypervisorlaunchtype Off:
bcdedit /enum | findstr hypervisorlaunchtype
The VM does not start: VT-x/AMD-V is not available

Enable hardware virtualization in the BIOS/UEFI of the computer. On Windows 11, do Step 1 and restart the computer.

The console shows no IP address

The GNS3 VM gets its address from DHCP. Make sure that Adapter 1 is bridged to the correct network interface (Step 4) and that your network has a DHCP server.


Procedure completion

Congratulations!

You have successfully set up the GNS3 server on VirtualBox. Now you can add SONiC and build virtual networks for tests and training.

Happy networking!

 

Useful links:

How to create a new GNS3 appliance template to work with SONiC using GNS3 Desktop Client?

How to create a new GNS3 appliance template to work with SONiC using GNS3 Web UI?

How to install and configure GNS3 Desktop Client (Windows / Linux / Mac)?

How to set up GNS3 server on Proxmox?

 

For more free resources, visit: https://stordis.com/free-resources/

Comments 0

Articles in this section