Skip to content

Windows broker: guest socket() fails EIO — no SocketProvider (UnsupportedSocketProvider) #1663

Open

Description

Environment

• Branch: ulitebox, commit 4276ac3
• Host: Azure Standard_D4s_v5 (4 vCPU / 16 GiB), Windows 11 Pro 24H2 x64 Gen2
• Guest: Linux Python 3.12 (python:3.12-slim rootfs via litebox-packager OCI)
• Entry: litebox-broker-userland.exe --fs-initial-files .\agent-rootfs.tar
--allow-tcp-destination 10.0.2.1/32:4000
--runner litebox_runner_linux_on_windows_userland.exe

Expected

Guest socket(AF_INET, SOCK_STREAM) succeeds. Guest (10.0.2.15) can connect via host gateway 10.0.2.1 to host-loopback services per broker destination policy.

Actual

Socket creation fails immediately, before connect:

      OSError: [Errno 5] Input/output error
        File "/usr/local/lib/python3.12/socket.py", line 233, in init
          _socket.socket.init(self, family, type, proto, fileno)

Minimal repro (no agent, no network target)

      litebox-broker-userland.exe --fs-initial-files .\agent-rootfs.tar \
        --runner litebox_runner_linux_on_windows_userland.exe \
        /usr/local/bin/python3 -c 'import socket; s=socket.socket(socket.AF_INET, socket.SOCK_STREAM); print("socket ok")'

Result: same Errno 5 panic path, runner exit 101.
Success marker after fix: prints socket ok.

Root cause (from source at this commit)

• litebox_broker_userland/src/builder.rs: platform_socket_provider
returns LinuxSocketProvider only on Linux; all other targets get
litebox_broker_core::socket::UnsupportedSocketProvider.
• UnsupportedSocketProvider::create() returns
BrokerError::UnsupportedOperation (litebox_broker_core/src/socket.rs),
which guest maps to EIO.
• litebox_broker_platform_windows_userland provides only sync
primitives; no Winsock provider exists. Policy/routing layer
(SocketPolicy::guest_network, HOST_GATEWAY_IPV4_ADDRESS 10.0.2.1,
host_socket_destination loopback translation) is present but has
no Windows host provider behind it.

Suggested fix

Implement WindowsSocketProvider in litebox_broker_platform_windows_userland (Winsock, WSAPoll or IOCP reactor) satisfying SocketProvider + broker readiness, mirroring litebox_broker_platform_linux_userland/src/socket.rs (~2108 lines plus tcp.rs/udp.rs), wired in builder.rs cfg(windows).

Workaround

None on Windows. Live guest networking requires Linux host provider today.

Notes

I asked my Agent if this was valid and the answer that I got back was "yes, and here's why".

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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