Skip to content

simulator: improve podman compatibility for container-backed VMs#4014

Open
hickeng wants to merge 1 commit into
vmware:mainfrom
hickeng:pr2/podman-support
Open

simulator: improve podman compatibility for container-backed VMs#4014
hickeng wants to merge 1 commit into
vmware:mainfrom
hickeng:pr2/podman-support

Conversation

@hickeng
Copy link
Copy Markdown
Contributor

@hickeng hickeng commented May 12, 2026

Description

Add helpers and options that let vcsim container-backed VMs work correctly
under rootless podman-docker:

  • commandError(cmd, err, stderr) – consistent error logging that includes the
    command's stderr so failures are easier to diagnose.
  • RUN.network ExtraConfig – explicit container network name; needed for
    rootless podman where the default bridge does not provide cross-container
    IP connectivity.
  • RUN.mountdmi ExtraConfig – error hint when /dev/mem mount fails
    (rootless podman permission issue).
  • syncNetworkConfigToVMGuestProperties – now calls ctx.Update for every
    modified property and retries IP resolution after container start to handle
    delayed IP assignment.
  • watchContainer callback – updated to accept a *Context so callers can trigger
    property change notifications.
  • test/helper.go – adds IsRootlessPodman() and ContainerNetworkFromSpec()
    helpers; Example_runContainer in feature_test.go uses them so the curl probe
    joins the same bridge network as the nginx VM.

How Has This Been Tested?

Unit and sim testing

Add helpers and options that let vcsim container-backed VMs work
correctly under rootless podman-docker:

  commandError(cmd, err, stderr) – consistent error logging that
    includes the command's stderr so failures are easier to diagnose.
  RUN.network ExtraConfig         – explicit container network name;
    needed for rootless podman where the default bridge does not
    provide cross-container IP connectivity.
  RUN.mountdmi ExtraConfig        – error hint when /dev/mem mount
    fails (rootless podman permission issue).
  syncNetworkConfigToVMGuestProperties – now calls ctx.Update for
    every modified property and retries IP resolution after container
    start to handle delayed IP assignment.
  watchContainer callback – updated to accept a *Context so callers
    can trigger property change notifications.

test/helper.go – adds IsRootlessPodman() and ContainerNetworkFromSpec()
  helpers; Example_runContainer in feature_test.go uses them so the
  curl probe joins the same bridge network as the nginx VM.

AI-Tool-Used: Cursor
AI-Tool-Use-Level: medium
AI-Code-Category: non-production
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: George Hicken <george.hicken@broadcom.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@hickeng hickeng requested a review from dougm May 12, 2026 18:51
@hickeng hickeng marked this pull request as ready for review May 12, 2026 18:51
@hickeng hickeng requested a review from akutz May 13, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant