6 Adding a Virtual Machine to GNS3

Mathew J. Heath Van Horn, PhD

GNS3 is unique in that it is an emulator rather than a simulator, unlike Cisco’s Packet Tracer. With GNS3, you can add any VM you create in VirtualBox and use it within the GNS3 environment. The purpose of this lab is to give you experience in creating GNS3 appliances using VMs.

Phase 0 – Professional Alignment

Enterprise networks are composed of interconnected systems that must communicate reliably across physical and virtual infrastructures. In this chapter, you will integrate a virtual machine into your GNS3 environment, developing the skills needed to deploy, connect, and validate endpoint systems within an enterprise network simulation.

DCWF Work Roles

The knowledge and skills developed in this chapter align with the following Department of Defense Cyber Workforce Framework (DCWF) work roles:

  • 511 – Network Operations Specialist
  • 531 – Systems Administrator
  • 441 – Network Services Specialist

NICE Work Roles

This chapter supports competencies associated with the following NICE Workforce Framework for Cybersecurity work roles:

  • Network Operations Specialist
  • Systems Administrator
  • Network Services Specialist

Professional Skills

By completing this chapter, you will begin developing the ability to:

  • Integrate virtual machines into enterprise network simulation environments.
  • Configure virtual network interfaces and connectivity.
  • Validate communication between endpoints and network infrastructure.
  • Manage virtual machine resources within GNS3.
  • Troubleshoot connectivity and configuration issues in virtual environments.
  • Prepare endpoint systems for enterprise networking and cybersecurity laboratories.

What You’ll Be Able to Do

After completing this chapter, you should be able to:

  • Import and configure a virtual machine for use within GNS3.
  • Connect a virtual machine to routers, switches, and other network devices.
  • Configure virtual network adapters to support laboratory exercises.
  • Verify communication between the virtual machine and other devices in the topology.
  • Troubleshoot common virtual machine integration and connectivity issues.
  • Prepare a fully integrated endpoint for use in subsequent enterprise networking labs.

 

Learning Objectives

  • Create GNS3 appliances using VirtualBox VMs

Prerequisites

Deliverables

  • None – this is a preparatory lab for other labs

Resources

Contributors and testers

  • Enzo Gonzalez
  • Violet Barton

Phase I – Adding a Virtual Machine to GNS3

This is pretty straightforward. In this lab, we use a Windows Server VM as an example; however, any VM you create in VirtualBox can be used.

Screenshot of command
Figure 5 – Screenshot of the VM showing in GNS3 Workspace
  1. Open VirtualBox and choose a VM you want to import into GNS3. You can use the TinyCore Linux VM if you like. In this example, we are using a Windows Server VM
  2. Start GNS3
  3. Create a new lab
  4. On the GNS3 menu, navigate to Edit and then Preferences
    Screenshot of command
    Figure 1 – Adding VirtualBox VMs to GNS3
  5. Select VirtualBox VMs, and you will see a list of VirtualBox VMs (if any) already added to GNS3
  6. Select new at the bottom of the window
    Screenshot of command
    Figure 2 – Adding new VirtualBox VMs to GNS3
  7. Make sure the radio button for running the VM on my local computer is selected, and click on Next
    Screenshot of command
    Figure 3 – Radio button selected
  8. You will now see a window with a drop-down box to select any of the VMs that are loaded in VirtualBox; in this example, we will select Windows Server 2022 for GNS3
    Screenshot of command
    Figure 4 – Adding Windows Server 2022
  9. Click Finish
  10. To edit the properties of the VM, click edit on the bottom left of the window
    1. Here you can change things such as the default symbol, device name, RAM, etc
    2. In the Network tab, make sure to check the Allow GNS3 to use any configured VirtualBox adapter option box
    3. When you are finished, make sure you click Apply or risk the VM not being added
  11. Click OK
  12. Click on the all devices button, and you can now see our VM added to the appliance list
    Screenshot of command
    Figure 5 – Screenshot of the VM showing in GNS3 Workspace

     

    Right click opens the menu
    Figure 5a – zoom
  13. You can drag the recently added VM to the GNS3 Workspace and start it
    Screenshot of command
    Figure 6 – Drag the new VirtualBox object to the GNS3 Workspace
    Same as instruction
    Figure 6a – zoom
  14. When the VM starts, it will run outside of GNS3, so look for it on your toolbar as a VM
    Screenshot of command
    Figure 7 – Looking at the toolbar for the VM
  15. That’s it. Remember, you can do this for any functional virtual machine (VM) in VirtualBox. However, VMs use much more resources than the emulated devices within GNS3. So, if you add ten Windows 11 VMs, you will overload your host machine’s processor pretty fast

 

Phase II – Installing other types of Virtual Machines (VM)

Not all Virtual Machines need to run in VirtualBox. Some can be run in the GNS3 VM through QEMU or Docker. QEMU stands for Quick EMUlator and is free software that runs various guest operating systems. It is typically used in Linux environments as a Virtual Machine Manager for Linux’s KVM Type 1 hypervisor. Docker is a set of products that run software in containers without requiring an Operating System.

Since these options use the GNS3 VM, you may run out of resources allocated to it. If you add many of these devices, make sure to add RAM and Cores to the GNS3 VM in VirtualBox before starting the GNS3 environment, or it may crash!

  1. Start your GNS3 environment
  2. Open the “All devices” menu on the left side
  3. At the bottom, click on “+New Template”
    Click on a new template
    Figure 8 – Click on new template
  4. Select the radio button for “Install an appliance from the GNS3 server,” then click on next
    Make a selection
    Figure 9 – Make a selection
  5. Click “Update from online registry” at the bottom of the new window
    Update from online registry
    Figure 10 – Update from online registry

    NOTE: This update is pretty good, but it lags behind the appliance downloads on the GNS3 Appliance page.

  6. We are going to install some lightweight guest operating systems
    1. Chromium
      1. Select the arrow next to guests to expand what is available
      2. Select Chromium for Docker from the list
        Expand the list
        Figure 11 – Expand the list
      3. Click the “Install” button
      4. Leave the default selection and select “Next”
        Select the server and press next
        Figure 12- Select the server and press next
      5. Read the usage notes and then click “Finish”
        Read the notes
        Figure 13 – Read the usage notes and click finish
      6. You will get a pop-up saying it has been successfully added – press OK
        Success pop up
        Figure 14 – success pop-up
      7. You can now see that Chromium has been added to your devices
        Chromium on list
        Figure 15 – Chromium is now on our list
      8. Test the template
        1. Start a new project
        2. From the “All Devices” menu, drag the NAT cloud to the new project
        3. When prompted to choose a server, click the drop-down and select “GNS3 VM” – press OK
        4. Drag the Chromium device to the new project
        5. Connect the two devices with a network cable
          Function Check
          Figure 17 – Function Check
        6. Right-click on the Chromium Device and click on configure
          Check network settings
          Figure 18 – Check network settings
          1. Edit the network configuration at the bottom
            Check more network settings
            Figure 19 – Check more network settings
          2. Remove the comment command (#) to enable DHCP
            Enable DHCP
            Figure 20 – enable DHCP
          3. Click on Save

            NOTE: You can only access the network configuration when the device is off and has been added to the GNS3 environment.

        7. Click on Apply, then click on OK
        8. Start the Chromium VM in GNS3
        9. Right-click on the device and select “console”
        10. The VNC viewer will open, and you can surf the web like normal
          Surf the web
          Figure 21 – surf the web
    2. Firefox on Tiny Core Linux

      NOTE: Many of the screenshots are similar to those in the Chromium installation and have been omitted from this section, so read carefully!

      1. Select the arrow next to guests to expand what is available
      2. Select Firefox for Qemu from the list
        Select Firefox version
        Figure 22 – select Firefox version
      3. Click the “Install” button
      4. Leave the default selection and select “Next”
      5. Leave the Qemu binary alone and click “Next”
      6. On the required files menu
        1. Use the arrows to highlight the version you want
        2. Click the download button
          Select Firefox
          Figure 23 – select Firefox version
        3. It will open a webpage and start downloading the image file
        4. Wait for the download to finish
        5. Click on the import button and select the location where the image file was downloaded
          Select the downloaded file
          Figure 24 – select the file you downloaded
        6. Click “Open”
        7. It will now say “Ready to install”
        8. Highlight the version that is ready to install and click on “next”
        9. When asked if you want to install, click on “Yes”
        10. Review the usage notes and click on “Finish”
      7. You will get a pop-up saying it has been successfully added – press OK
      8. You can now see that Firefox has been added to your devices
      9. Test the template
        1. Drag the Firefox device to the new project
        2. Delete the network cable going to the Chromium VM
        3. Connect the NAT cloud to the Firefox VM
        4. Start the Firefox VM
      10. Right-click on the device and select “console”
      11. The VNC viewer will open, and you can surf the web like normal
        Mouse settings
        Figure 25 – mouse settings and browser test

NOTE: Sometimes VNC Viewer and TinyCore don’t play well together, and the mouse cursor doesn’t line up between the metal machine and the VM. You can set the mouse speed in the VM’s control panel to 1 instead of 3, which should help.

 

Career Connection

Integrating systems into existing network infrastructures is a routine responsibility for network administrators and systems administrators. Whether deploying new workstations, testing applications, validating security controls, or troubleshooting connectivity problems, IT professionals regularly connect and verify virtual and physical systems before they are placed into production. The skills developed in this chapter mirror the deployment and integration processes used in enterprise data centers, cloud environments, and cybersecurity laboratories.

End of Lab

Feedback email
Figure 00 – Contact us via prmaster@erau.edu

 

License

Icon for the Creative Commons Attribution-NonCommercial 4.0 International License

Mastering Enterprise Networks 3e Copyright © 2024 by Mathew J. Heath Van Horn is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License, except where otherwise noted.