Release Announcement: NSO 6.5 is now released.
Head to the release highlights to see what's new
LogoLogo
NSO DevCenterTry NSO
NSO 6.2
  • Get Started
  • User Guides
  • Developers
  • Release Info
NSO 6.2
  • Start
  • What's New
  • Administration
    • Get Started
    • Installation and Deployment
      • Local Install
      • System Install
      • Post-Install Actions
        • Explore the Installation
        • Start and Stop NSO
        • Create NSO Instance
        • Enable Development Mode
        • Running NSO Examples
        • Migrate to System Install
        • Modify Examples for System Install
        • Uninstall Local Install
        • Uninstall System Install
      • Containerized NSO
      • Deployment Example
      • Upgrade NSO
    • Management
      • System Management
        • Cisco Smart Licensing
        • Log Messages and Formats
        • Alarm Types
      • Package Management
      • High Availability
      • AAA Infrastructure
      • NED Administration
    • Advanced Topics
      • Locks
      • Compaction
      • IPC Ports
      • Service Manager Restart
      • Security Issues
      • Run NSO as Non-Privileged User
      • IPv6 on Northbound Interfaces
      • Layered Service Architecture
  • Operation & Usage
    • Get Started
    • CLI
      • Introduction to NSO CLI
      • CLI Commands
    • Web UI
    • Operations
      • Basic Operations
      • NEDs and Adding Devices
      • Manage Network Services
      • NSO Device Manager
      • SSH Key Management
      • Alarm Manager
      • Plug-and-Play Scripting
      • Compliance Reporting
      • Listing Packages
      • Lifecycle Operations
      • Network Simulator
  • Development
    • Get Started
    • Introduction to Automation
      • CDB and YANG
      • Basic Automation with Python
      • Develop a Simple Service
      • Applications in NSO
      • Develop and Deploy a Nano Service
    • Core Concepts
      • Services
      • Implementing Services
      • Templates
      • Nano Services
      • Packages
      • Using CDB
      • YANG
      • NSO Concurrency Model
      • Service Handling of Ambiguous Device Models
      • NSO Virtual Machines
        • NSO Python VM
        • NSO Java VM
        • Embedded Erlang Applications
      • API Overview
        • Python API Overview
        • Java API Overview
      • Northbound APIs
        • NSO NETCONF Server
        • RESTCONF API
        • NSO SNMP Agent
    • Advanced Development
      • Development Environment and Resources
      • Developing Services
        • Services Deep Dive
        • Service Development Using Java
        • NSO Developer Studio
      • Developing Packages
      • Developing NEDs
        • NETCONF NED Development
        • CLI NED Development
        • Generic NED Development
        • SNMP NED
        • NED Upgrades and Migration
      • Developing Alarm Applications
      • Kicker
      • Scaling and Performance Optimization
      • Progress Trace
      • Web UI Development
        • JSON-RPC API
    • Connected Topics
      • SNMP Notification Receiver
      • Web Server
      • Scheduler
      • External Logging
      • Encryption Keys
  • Resources
    • Manual Pages
      • Section 1
      • Section 3
      • Section 5
Powered by GitBook
LogoLogo

Site

  • Cisco.com
  • Documentation
  • Learning Labs
  • Sample Code

Connect

  • Feedback
  • Community
  • Blogs
  • Events

Follow Us

  • X/Twitter
  • Facebook
  • YouTube
  • LinkedIn

© Copyright 2025 Cisco Systems, Inc. | This site is part of the official Cisco Crosswork NSO documentation set.

On this page
  • General Instructions
  • Common Mistakes

Was this helpful?

Edit on GitHub
Export as PDF
  1. Administration
  2. Installation and Deployment
  3. Post-Install Actions

Running NSO Examples

Run and interact with practice examples provided with the NSO installer.

PreviousEnable Development ModeNextMigrate to System Install

Last updated 9 months ago

Was this helpful?

Applies to Local Install.

This section provides an overview of how to run the examples provided with the NSO installer. By working through the examples, the reader should get a good overview of the various aspects of NSO and hands-on experience from interacting with it.

This section references the examples located in $NCS_DIR/examples.ncs. The examples all have README files that include instructions related to the example.

General Instructions

  1. Make sure that NSO is installed with a Local Install according to the instructions in .

  2. Source the ncsrc file in the NSO installation directory to set up a local environment. For example:

    $ source ~/nso-6.0/ncsrc
  3. Proceed to the example directory:

    $ cd $NCS_DIR/examples.ncs/getting-started/using-ncs/1-simulated-cisco-ios
  4. Follow the instructions in the README files that are located in the example directories.

Every example directory is a complete NSO run-time directory. The README file and the detailed instructions later in this guide show how to generate a simulated network and NSO configuration for running the specific examples. Basically, the following steps are done:

  1. Create a simulated network using the ncs-netsim --create-network command:

    $ ncs-netsim create-network cisco-ios-cli-3.8 3 ios

    This creates 3 Cisco IOS devices called ios0, ios1, and ios2.

  2. Create an NSO run-time environment using the ncs-setup command:

    $ ncs-setup --dest .

    This command uses the --dest option to create local directories for logs, database files, and the NSO configuration file to the current directory (note that . refers to the current directory).

  3. Start NCS netsim:

    $ ncs-netsim start
  4. Start NSO:

    $ ncs

It is important to make sure that you stop ncs and ncs-netsim when moving between examples using the stop option of the netsim and the --stop option of the ncs.

$ cd $NCS_DIR/examples.ncs/getting-started/1-simulated-cisco-ios
$ ncs-netsim start
$ ncs
$ ncs-netsim stop
$ ncs --stop

Common Mistakes

Some of the most common mistakes are:

Not Sourcing the ncsrc File

You have not sourced the ncsrc file:

$ ncs
-bash: ncs: command not found
Not Starting NSO from the Runtime Directory

You are trying to start NSO from a directory that is not set up as a runtime directory.

$ ncs
Bad configuration: /etc/ncs/ncs.conf:0: "./state/packages-in-use: \
   Failed to create symlink: no such file or directory"
Daemon died status=21

What happened above is that NSO did not find an ncs.conf in the local directory so it uses the default in /etc/ncs/ncs.conf. That ncs.conf says there shall be directories at ./ such as ./state which is not true. Make sure that you cd to the root of the example and check that there is a ncs.conf file, and a cdb-dir directory.

Having Another Instance of NSO Running

You already have another instance of NSO running (or the same with netsim):

$ ncs
Cannot bind to internal socket 127.0.0.1:4569 : address already in use
Daemon died status=20
$ ncs-netsim start
DEVICE c0 Cannot bind to internal socket 127.0.0.1:5010 : \
  address already in use
Daemon died status=20
FAIL

To resolve the above, just stop the running instance of NSO and netsim. Remember that it does not matter where you started the "running" NSO and netsim, there is no need to cd back to the other example before stopping.

Not Having the Netsim Device Configuration Loaded into NSO

Another problem that users run into sometimes is where the netsim device configuration is not loaded into NSO. This can happen if the order of commands is not followed. To resolve this, remove the database files in the ncs_cdb directory (keep any files with the .xml extension). In this way, NSO will reload the XML initialization files provided by ncs-setup.

$ ncs --stop
$ cd ncs-cdb/
$ ls
A.cdb
C.cdb
O.cdb
S.cdb
netsim_devices_init.xml
$ rm *.cdb
$ ncs

Local Install