Repository navigation
Conversation
When initializing a container in --unshare-netns mode, we avoid mounting /run/systemd/resolve. This allows nsswitch to fallback to myhostname when resolving the container's hostname, fixing an issue where 'hostname -i' fails with 'Unknown host'. Fixes 89luca89#2079
balanza
self-requested a review
July 17, 2026 09:27
Collaborator
|
Hi @kairosci, I've tried the patch on this machine and it's not working > cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.4 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
> distrobox enter archlinux -- hostname -i
hostname: gethostbyname: Unknown host
2026/07/21 21:48:46 failed to execute enter command: failed to enter the container: error running the interactive command :exit status 1 |
Contributor
Author
|
@balanza I don't know why, but the push didn't push everything even though I literally ran |
Contributor
Author
distrobox enter test-arch -- hostname -i 2>&1
test-arch
Starting container... [ OK ]
Installing basic packages... [ OK ]
Setting up devpts mounts... [ OK ]
Setting up read-only mounts... [ OK ]
Setting up read-write mounts... [ OK ]
Setting up host's sockets integration... [ OK ]
Setting up host's sockets integration... [ OK ]
Integrating host's themes, icons, fonts... [ OK ]
Setting up distrobox profile... [ OK ]
Setting up sudo... [ OK ]
Setting up user's group list... [ OK ]
Setting up existing user - shell... [ OK ]
Setting up existing user - groups... [ OK ]
Ensuring user's access... [ OK ]
Container Setup Complete!
192.168.1.88 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR solves solves the systemd-resolved socket from being mounted when the container uses an isolated network namespace.
Closes #2079