[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
- VirtualBox 7 on Windows, Linux or macOS (Intel).
- 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.
- 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.
- Open PowerShell as Administrator.
- 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
- 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.
- Go to https://gns3.com/software/download-vm.
- Select VirtualBox.
- Go to https://github.com/GNS3/gns3-gui/releases.
- In the Assets of the release, download the GNS3 VM file for VirtualBox.
The file is a ZIP archive. Extract it. It contains the file GNS3 VM.ova.
Step 3: Import the VM into VirtualBox
-
Start VirtualBox. Select File > Import Appliance.
-
Select the file
GNS3 VM.ovathat you extracted in Step 2. Click Open and complete the import.
Step 4: Configure the VM
Do this step when the VM is off.
-
In the VirtualBox Manager, select GNS3 VM.
-
Click Settings.
-
System > Motherboard: set the memory. Give the VM as much RAM as possible, but keep 4–8 GB for the computer.
-
System > Processor: set the number of CPUs. Select Enable Nested VT-x/AMD-V. GNS3 needs it to start SONiC with KVM.
If the checkbox is not available, use this command (VirtualBox installation directory or PATH):
VBoxManage modifyvm "GNS3 VM" --nested-hw-virt on
-
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.
- 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
-
Select GNS3 VM and click Start.
-
A console window shows the start of the VM.
-
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.
-
In a web browser, open the IP address. The GNS3 web interface opens.
To add SONiC to GNS3, create an appliance template (refer to the links at the end of this guide).
Troubleshooting
- 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
Enable hardware virtualization in the BIOS/UEFI of the computer. On Windows 11, do Step 1 and restart the computer.
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
Comments
Please sign in to leave a comment.