KB 019765 - How to Add Device Images in PNETLab (Installed on Proxmox)?

KB 019765 - How to Add Device Images in PNETLab (Installed on Proxmox)?

1. Overview

This article provides a comprehensive guide for adding device images (such as Cisco, Huawei, FortiGate, and other network operating systems) to PNETLab. Adding images is essential for creating virtual network labs. There are two primary methods: automated downloading using the built-in ishare2 tool and manual upload for custom or EVE-NG images .


2. Prerequisites

Before proceeding, ensure you have the following:

  • PNETLab Installed:
     A running instance of PNETLab (VMware or VirtualBox). Default credentials are usually root / pnet .
  • Network Connectivity:
     The PNETLab VM must have internet access if using ishare2.
  • SSH Client:
     Software like PuTTY (Windows) or Termius (Mac/Windows) to access the command line .
  • SCP Client (Optional):
    WinSCP (Windows) or Cyberduck (Mac) for manual file uploads .
  • Image Files:
     The actual image files (e.g., .qcow2, .bin, .image) you wish to add, ensuring compliance with vendor licensing agreements .

3. Method 1:  iShare2 (Automated Method)

The ishare2 tool is a command-line utility pre-installed in PNET Lab that allows you to search for and download images from the community repository automatically.

Step 3.1: Access PNET Lab via SSH

  1. Open your SSH client.
  2. Connect to the IP address of your PNET Lab instance.
  3. Log in with your username and password (default: root / pnet) .

Step 3.2: Search for an Image

To find available images, use the search command. You can search for specific types like qemu,iol (IOS on Linux), dynamips, or all.

Syntax:

Info
ishare2 search <type>

Example:

To find Cisco IOSv images, type:

Info
ishare2 search vios

To find Huawei images or specific terminologies:

Info
ishare2 search adventerprise

The system will return a list of images with corresponding ID numbers .


Step 3.3: Download the Image

Once you have identified the image ID or name, use the pull command to download it.

To download a single image by ID:

Info
ishare2 pull qemu <ID>

To download all images of a specific type:

Info
ishare2 pull qemu all

Wait for the download to complete. The files will be placed in the correct directories automatically .

Step 3.4: Auto-Download for Existing Labs

If you have downloaded a lab file (.unl) that requires images you do not have, use the labs command to automatically download all required images for that specific lab.

InfoIdea
ishare2 labs all

This scans your lab files and pulls the necessary dependencies .


4. Method 2: Manual Upload (For Custom Images)

If you have a specific image file (e.g., from EVE-NG, CML, or a custom QEMU image), you must upload it manually to specific directories.

Step 4.1: Locate the Correct Directory

Connect to your PNETLab VM via SCP (WinSCP) or SSH. Images must be placed in specific folders based on their type :

Image Type

Destination Path

QEMU (e.g., Huawei NE40E, FortiGate, vEOS)

/opt/unetlab/addons/qemu/<device-name>/

IOL / IOSv (Binary images)

/opt/unetlab/addons/iol/bin/

Dynamips

/opt/unetlab/addons/dynamips/

Alert
Important for QEMU:
 Create a folder named after the device (e.g., huaweine40e) and place the image fi
le (usually named virtioa.qcow2 or hda.qcow2) inside it .

Step 4.2: Upload the File

Using your SCP client, drag and drop the image file from your local machine to the appropriate directory on the PNETLab server .

Step 4.3: Add Templates and Icons (Optional)

To make the device appear nicely in the Web UI, you may need to add a template and an icon :

  1. Template:
     Upload the .yml template file to /opt/unetlab/html/templates/.
  2. Icon:
     Upload a .png icon file to /opt/unetlab/html/images/icons/.

Step 4.4: Fix Permissions

Alert
This step is mandatory.
 After manually uploading any file, you must run the permission fix script. Without this, the nodes may fail to start .

Execute the following command in the SSH terminal:

Info
/opt/unetlab/wrappers/unl_wrapper -a fixpermissions


5. Verification

After adding images (via either method), verify that the images are available in the PNETLab Web GUI .

  1. Log in to the PNETLab Web Interface.
  2. Create a new lab or open an existing one.
  3. Right-click on the workspace canvas (or click the "Add Node" button).
  4. Check the list of available devices. You should see the newly added image name in the dropdown menu.
  5. If you do not see the device, refresh the browser page or ensure the permissions were fixed correctly.





6. References


  • PNETLab Official Website 
  • iShare2 GitHub Repository