Skip to content

[Bug]: TestCLINetwork issue with vmnet when testing prune + run commands #953

Closed

Description

@saehejkang

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

Capture the logs with command below

log stream --debug --info --predicate 'subsystem = "com.apple.NetworkSharing"'

Then the set of commands below similar to the prune test

#! /bin/bash -x

container system stop
container system start
container network rm in-use unused
container network create in-use
container network create unused
container run --name in-use-server --network in-use --rm -d -p 127.0.0.1:8000:8000 python:slim python3 -m http.server --bind 0.0.0.0 8000
container ls
container network rm unused
container stop in-use-server
container network rm in-use
container run --name default-server --rm -d -p 127.0.0.1:8000:8000 python:slim python3 -m http.server --bind 0.0.0.0 8000 
sleep 3
curl http://localhost:8000

Current behavior

The curl at the end fails, and the OS logs show that the container interface for default-server didn't get configured.

2025-12-08 13:37:56.572274-0300 0x3a2c3    Debug       0x0                  38322  0    InternetSharing: [com.apple.NetworkSharing:daemon] netrbCreateInterface: network handle was passed in
2025-12-08 13:37:56.572233-0300 0x3a27c    Info        0x0                  38321  0    com.apple.Virtualization.VirtualMachine: (Netrb) [com.apple.NetworkSharing:framework.netrb] _NETRBNetworkStartVirtualMachineInterface: adding virtual interface to network 0x7eac48140
2025-12-08 13:37:56.572285-0300 0x3a2c3    Default     0x0                  38322  0    InternetSharing: [com.apple.NetworkSharing:daemon] netrbCreateInterface: no network related to id
2025-12-08 13:37:56.572315-0300 0x3a27c    Default     0x0                  38321  0    com.apple.Virtualization.VirtualMachine: (Netrb) [com.apple.NetworkSharing:framework.netrb] _NETRBNetworkStartVirtualMachineInterface_block_invoke_2: interface creation failed

Expected behavior

TestCLINetwork pass and the default-server gets configured, when running the commands based on steps for reproduction

Environment

- OS: 26.1
- Xcode: 26.1.1
- Container: Local branch from https://github.com/apple/container/pull/914

Relevant log output

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added theissue type on Dec 12, 2025
  2. saehejkang commented on Dec 12, 2025

    @saehejkang
    ContributorAuthor
  3. jglogan commented on Dec 12, 2025

    @jglogan
    Contributor

    Thanks. This one is out of our hands for now. Since it impacts network deletion irrespective of pruning, let's get the network prune PR merged, but disabling the test that exposes this vmnet bug.

  4. JaewonHur commented on Jan 20, 2026

    @JaewonHur
    Contributor

    I'm not sure this is related, but running following script makes network not working.

    #!/bin/bash
    
    name=test-$(date "+%H%M")
    
    container network create --subnet 192.168.10.0/24 ${name}-1
    container network create --subnet 192.168.20.0/24 ${name}-2
    container network create --subnet 192.168.30.0/24 ${name}-3
    container run --rm --detach --name client-1 --network ${name}-1 docker.io/library/python:alpine python3 -m http.server --bind 0.0.0.0 10032
    container run --rm --detach --name client-2 --network ${name}-1 ghcr.io/linuxcontainers/alpine:3.20 sleep infinity
    container network rm ${name}-3
    sleep 2
    container kill client-2
    sleep 0.1
    container network rm ${name}-2
    

    After it, container exec -it client-1 ping 8.8.8.8 doesn't work.

  5. Kediel commented on Feb 7, 2026

    @Kediel

    I'm not sure this is related, but running following script makes network not working.

    #!/bin/bash
    
    name=test-$(date "+%H%M")
    
    container network create --subnet 192.168.10.0/24 ${name}-1
    container network create --subnet 192.168.20.0/24 ${name}-2
    container network create --subnet 192.168.30.0/24 ${name}-3
    container run --rm --detach --name client-1 --network ${name}-1 docker.io/library/python:alpine python3 -m http.server --bind 0.0.0.0 10032
    container run --rm --detach --name client-2 --network ${name}-1 ghcr.io/linuxcontainers/alpine:3.20 sleep infinity
    container network rm ${name}-3
    sleep 2
    container kill client-2
    sleep 0.1
    container network rm ${name}-2
    

    After it, container exec -it client-1 ping 8.8.8.8 doesn't work.

    I'm currently having issues just running "container network create --subnet [IP/CIDR] [name]" my machine just hangs. I can create a network with "container network create [name]" but after inspecting the network is set to NAT and I don't want that.

  6. added this to the 2026-02 milestone on Feb 11, 2026
  7. modified the milestones: 2026-03, 2026-04 on Apr 1, 2026
  8. jglogan commented on Apr 22, 2026

    @jglogan
    Contributor

    Closed by #953.

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

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions