Skip to content

[Bug] Vizard: Real-Time Connection Fails on Windows with Docker Despite Successful Port Connectivity #1058

@gautam1858

Description

@gautam1858

Environment

Component Version
Operating System Windows 10 / 11
Docker Desktop v4.31.2 (or your specific version)
Basilisk Version develop branch (latest as of Aug 2025)
Vizard Version v3.2.1
Build Method Standard python3 conanfile.py in Docker

Problem Description

When running a Basilisk simulation inside a Docker container on a Windows host, the real-time connection to the Vizard application fails with a "Socket failed. Please check connection address" or "Timed out waiting for connection" error.

This connection failure is paradoxical because low-level network connectivity tests from the Windows host to the container on both required ports (5556 and 5570) are successful. This strongly suggests the issue is not with the network configuration (firewall, Docker port publishing) but with the application-level handshake between the Vizard binary and the ZMQ library running inside the container.

The file-based visualization workflow (saving to a .bin file and opening it in Vizard) works perfectly, confirming the Basilisk installation itself is correct and functional.

Steps to Reproduce

These steps consistently reproduce the issue:

  1. On a Windows host with Docker Desktop, start a container from a standard Ubuntu-based image (e.g., kmatsuka/ros2basilisk or ubuntu:20.04), publishing both required ports:

    docker run -it --name basilisk_session --publish 5556:5556 --publish 5570:5570 <image_name> /bin/bash
  2. Inside the container, clone the develop branch of the Basilisk repository:

    git clone https://github.com/AVSLab/basilisk.git
  3. Create a clean Python virtual environment and install the latest compatible build tools:

    python3 -m venv ~/.venv
    source ~/.venv/bin/activate
    pip install --upgrade pip "setuptools>=64" "conan>=2.0.5" "cmake>=3.26,<4.0"
  4. Navigate to the basilisk directory and run the full build with visualization enabled:

    cd ~/basilisk
    python3 conanfile.py --vizInterface
  5. Edit examples/scenarioBasicOrbitStream.py to use broadcastStream=True to ensure the simulation binds to all network interfaces (*) for Docker compatibility.

  6. Run the simulation. It will start correctly and wait for a connection:

    python3 examples/scenarioBasicOrbitStream.py
    # Expected Output:
    # BSK_INFORMATION: Broadcasting at tcp://*:5570
    # BSK_INFORMATION: Waiting for Vizard at tcp://*:5556
  7. On the Windows host, run Vizard v3.2.1.

  8. Attempt to connect Vizard to tcp://127.0.0.1:5556.

Expected Behavior

Vizard should connect to the simulation, and the real-time visualization should begin.

Actual Behavior

Vizard fails to connect and displays the error: "Socket failed. Please check connection address."

Crucial Evidence: Network Connectivity is Successful

This is the key diagnostic finding. While the simulation is running and waiting (Step 6), running the following Test-NetConnection commands in Windows PowerShell on the host machine both succeed:

# Test the handshake port
Test-NetConnection -ComputerName 127.0.0.1 -Port 5556
# OUTPUT: TcpTestSucceeded : True

# Test the data port
Test-NetConnection -ComputerName 127.0.0.1 -Port 5570
# OUTPUT: TcpTestSucceeded : True

This proves that the Docker port publishing is working correctly and the Windows Firewall is not blocking the connections. The failure is therefore happening at the application level, after the initial TCP connection is established.

Successful Workaround

The file-based method works flawlessly. By editing the script to use saveFile=__file__, a .bin file is generated. This file can be copied to the host using docker cp and opened in Vizard without any issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions