Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# EditorConfig helps maintain consistent coding styles across editors
# https://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[Makefile]
indent_style = tab

[*.Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[*.yaml]
indent_size = 2

[*.json]
indent_size = 2

[*.toml]
indent_size = 2
4 changes: 4 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,7 @@ Attach debugger to the XPC helpers using their launchd service labels:
## Pre-commit hook

Run `make pre-commit` to install a pre-commit hook that ensures that your changes have correct formatting and license headers when you run `git commit`.

## Troubleshooting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super helpful and thank you for starting on it! Take a look at #773, as it relates to the changes you made here.

Feel free to work on any other points in that issue, but due to scope, I think this PR is good as is and should serve as the initial setup of the section itself, with a couple of solutions (like you have). This also might live better in its own file and can instead be linked to in this file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just looked at #773 — makes sense to keep a dedicated troubleshooting doc. Want me to split it into a separate file and link it from BUILDING.md in this PR, or should I do that in a follow-up?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the changes should be done in this PR. The idea is to follow the first step from the issue, but start on a much smaller scale, since this will serve as the baseline to follow in the future. Also, there will be a lot more issues to add and we don't the Building.md file to become too large.

What do you think about the steps below for a first iteration?

  1. Create the new troubleshooting doc and add a link to it in Building.md.
  2. For any issues you've already identified, cross-check them with related open or closed issues and link those in the new doc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea — I moved the troubleshooting content into its own TROUBLESHOOTING.md and added a link from BUILDING.md. Also cross-referenced a few related issues, where I could find them. Let me know if this is what you had in mind.


If you run into build or runtime issues, check the [troubleshooting guide](TROUBLESHOOTING.md).
84 changes: 84 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Troubleshooting

Known issues and workarounds. If your problem isn't listed here, check the [open issues](https://github.com/apple/container/issues) or file a new one.

## Xcode or developer tools not found

Build errors about missing compilers usually mean `xcode-select` is pointing at the Command Line Tools instead of a full Xcode installation:

```bash
xcode-select --print-path
```

If this returns `/Library/Developer/CommandLineTools`, switch it to Xcode:

```bash
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
```

On macOS 26 you'll want the latest Xcode:

```bash
sudo xcode-select --switch /Applications/Xcode-latest.app/Contents/Developer
```

## Wrong Swift version

Swift 6.1+ is required. Check with `swift --version`.

If you have multiple toolchains, SPM picks whatever `swift` is first in `$PATH`. You can also just set `DEVELOPER_DIR` before building:

```bash
DEVELOPER_DIR=/Applications/Xcode-latest.app/Contents/Developer make all
```

## Permission errors during install

`make install` builds a `.pkg` and runs `sudo installer` to put binaries in `/usr/local`. If you don't have sudo or prefer a different location:

```bash
DEST_DIR=~/.local/ SUDO= make install
```

Don't forget to add `~/.local/bin` to your `$PATH` afterwards.

See also [#1281](https://github.com/apple/container/issues/1281) for Homebrew-specific permission issues.

## Network errors in integration tests

Integration tests spin up VMs that need outbound network access. Corporate proxies can interfere — try excluding the local ranges:

```bash
export NO_PROXY="${NO_PROXY},192.168.0.0/16,fe80::/10"
export no_proxy="${no_proxy},192.168.0.0/16,fe80::/10"
make test integration
```

VPN can also cause issues, see [#1307](https://github.com/apple/container/issues/1307).

## Kernel install hangs

The `install-kernel` target starts the container system and waits for the kernel to finish installing. If it times out:

1. Stop the system: `bin/container system stop`
2. Give launchd a few seconds to clean up
3. Try again with a longer timeout: `bin/container --debug system start --timeout 120`
4. Run `make install-kernel` again

Still stuck? Check for stale launchd services:

```bash
launchctl list | grep com.apple.container
```

You can clean these up with `scripts/ensure-container-stopped.sh -a`. See [#1280](https://github.com/apple/container/issues/1280) and [#1306](https://github.com/apple/container/issues/1306) for related issues.

## vmnet fails under ~/Documents or ~/Desktop

macOS 26 has a bug in the `vmnet` framework — network creation fails if the project or helper binaries sit under `~/Documents` or `~/Desktop`. Move the project somewhere else:

```bash
mv ~/Documents/container ~/projects/container
```

Alternatively, `make install` puts binaries in `/usr/local` which isn't affected.