Create a new Unetlab template

An example howto create a new Unetlab Ubuntu template:

Re-use an existing template
Go to /opt/unetlab/html/templates/ and find any of the template which is close to your need.Regarding Ubuntu Linux I selected template name linux.php.Copy and rename to your one, for example ubuntu.php

Customize the template
$p[‘type’] = ‘qemu’;
$p[‘name’] = ‘Linux’;
$p[‘icon’] = ‘Server.png’;
$p[‘cpu’] = 1;
$p[‘ram’] = 2048;
$p[‘ethernet’] = 1;
$p[‘console’] = ‘vnc’;
$p[‘qemu_arch’] = ‘x86_64’;
$p[‘qemu_nic’] = ‘virtio-net-pci’;
$p[‘qemu_options’] = ‘-machine type=pc-1.0,accel=kvm -vga std -usbdevice tablet -boot order=dc’;

Create a config fileFile name:
/opt/unetlab/html/includes/config.phpconfig.php content:
Copy the content from init.php and add ubuntu as a new line in the file.

<?php $node_templates = Array(
‘a10’           =>  ‘A10 vThunder’,
‘clearpass’     =>  ‘Aruba ClearPass’,
‘timos’         =>  ‘Alcatel 7750 SR’,
‘timos12’       =>  ‘Alcatel 7750 SR RTC shifted (for license)’,
‘veos’          =>  ‘Arista vEOS’,
‘brocadevadx’   =>  ‘Brocade vADX’,
‘cpsg’          =>  ‘CheckPoint Security Gateway VE’,
‘acs’           =>  ‘Cisco ACS’,
‘asa’           =>  ‘Cisco ASA’,
‘asav’          =>  ‘Cisco ASAv’,
‘cda’           =>  ‘Cisco Context Directory Agent’,
‘csr1000v’      =>  ‘Cisco CSR 1000V’,
‘cips’          =>  ‘Cisco IPS’,
‘ise’           =>  ‘Cisco ISE’,
‘c1710’         =>  ‘Cisco IOS 1710 (Dynamips)’,
‘c3725’         =>  ‘Cisco IOS 3725 (Dynamips)’,
‘c7200’         =>  ‘Cisco IOS 7206VXR (Dynamips)’,
‘iol’           =>  ‘Cisco IOL’,
‘titanium’      =>  ‘Cisco NX-OSv (Titanium)’,
‘sourcefire’    =>  ‘Cisco Sourcefire’,
‘vios’          =>  ‘Cisco vIOS’,
‘viosl2’        =>  ‘Cisco vIOS L2’,
‘vnam’          =>  ‘Cisco vNAM’,
‘vwlc’          =>  ‘Cisco vWLC’,
‘vwaas’         =>  ‘Cisco vWAAS’,
‘coeus’         =>  ‘Cisco Web Security Appliance’,
‘xrv’           =>  ‘Cisco XRv’,
‘nsvpx’         =>  ‘Citrix Netscaler’,
‘cumulus’       =>  ‘Cumulus VX’,
‘extremexos’    =>  ‘ExtremeXOS’,
‘bigip’         =>  ‘F5 BIG-IP LTM VE’,
‘fortinet’      =>  ‘Fortinet FortiGate’,
‘hpvsr’         =>  ‘HP VSR1000’,
‘olive’         =>  ‘Juniper Olive’,
‘vmx’           =>  ‘Juniper vMX’,
‘vsrx’          =>  ‘Juniper vSRX’,
‘linux’         =>  ‘Linux’,
‘mikrotik’      =>  ‘MikroTik RouterOS’,
‘ostinato’      =>  ‘Ostinato’,
‘paloalto’      =>  ‘Palo Alto VM-100 Firewall’,
//’riverbed’    =>  ‘Riverbed’,
‘sterra’        =>  ‘S-Terra’,
‘svtc’          =>  ‘Spirent Test Center’,
‘vyos’          =>  ‘VyOS’,
//’esxi’        =>  ‘VMware ESXi’,
‘win’           =>  ‘Windows’,
‘ubuntu’        =>  ‘Ubuntu’
);

Copy the QEMU image to the right place
Hard disk file name: hda.qcow2Copy to the following directory, you can use the additional directory name convention like this: /opt/unetlab/addons/qemu/ubuntu-14.04/hda.qcow2

Fix Unetlab image permissions
run the following command: /opt/unetlab/wrappers/unl_wrapper -a fixpermissions

Finished
Now you can use the new Template name under the Lab editor

 

Share with: