Skip to content

Juniper vJunos-router

The juniper_vjunos-router profile packages a vJunos-router QCOW2 disk. It uses four CPU cores, 5120 MiB RAM, a virtio disk, and 96 virtio data interfaces. The host needs nested virtualization available through /dev/kvm, using Intel VMX or AMD SVM. Packaging patches the VMX-only CPU check in /home/pfe/junos/start-junos.sh to recognize both flags, following this AMD workaround. See Juniper's deployment guide.

Juniper does not support launching vJunos-router from inside another VM because of its nested architecture; see the hardware and software requirements. Working console, SSH, or NETCONF access does not establish that the forwarding plane works. Check the FPC status and routed traffic separately.

Build the current Boxen runtime and package the disk:

make build-image build
dist/boxen build --disk /path/to/vJunos-router-25.2R1.9.qcow2 \
  --profile juniper_vjunos-router --reg example --tag 25.2R1.9

This creates example/boxen-juniper_vjunos-router:25.2R1.9. An existing vrnetlab image contains the original disk, which can be extracted without starting the VM:

docker pull ghcr.io/clab-labs/juniper_vjunos-router:25.2R1.9
docker create --name vjunos-disk-source \
  ghcr.io/clab-labs/juniper_vjunos-router:25.2R1.9
docker cp vjunos-disk-source:/vJunos-router-25.2R1.9.qcow2 .
docker rm vjunos-disk-source

Packaging patches the CPU check, logs into the Junos root shell, and waits for the first Auto Image Upgrade DHCP cycle before opening the CLI. It disables auto image upgrade, sets the root password, enables SSH and NETCONF, and configures the 96 data ports through the console before halting Junos cleanly. Factory DHCP messages can interrupt command echoes, so bootstrap writes wait for the resulting prompts and successful commit instead. At runtime Boxen sets the supplied hostname and user credentials and configures fxp0 with the container's IPv4/IPv6 management addresses and gateways in mgmt_junos. Transparent management is enabled by default: SSH and NETCONF use the container's management IP directly, without NAT port forwards. Set CLAB_MGMT_DHCP=true for IPv4 DHCP. Packaging always uses QEMU user networking.

Use Containerlab kind juniper_vjunosrouter (without a hyphen). Its defaults provide admin / admin@123. The packaged disk also has console root password admin@123. The serial console listens on TCP 5001.

Nested Junos can take longer than the base image's five-minute health-check startup period. In Containerlab, set the node's healthcheck.start-period to 1200 seconds. In c9s, also supply test: [CMD, /boxen/boxen, health], interval: 5, timeout: 5, and retries: 1 in spec.healthcheck so the Kubernetes startup probe waits up to 20 minutes while checking actual Boxen provisioning. A successful check ends the startup allowance immediately.

Mount a startup configuration at /config/startup-config.cfg. It must use Junos hierarchical syntax, for example:

system {
    domain-name lab.example;
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 192.0.2.1/30;
            }
        }
    }
}

Boxen loads it with load merge terminal and commits it after management provisioning. A failed load or commit prevents the container from becoming healthy. Configurations can override the base settings, so preserve management access and the root console credentials if the container will restart.

Data port ge-0/0/0 maps to container eth1, through ge-0/0/95 / eth96. The Boxen TC service attaches interfaces that appear after VM startup and reattaches interfaces that are removed and recreated. Boxen's image vendor label lets Containerlab and c9s select live link changes automatically.