mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #7048] Random hostname is not set & localhost is missing from /etc/hosts #3468
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#3468
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @liloman on GitHub (Jan 29, 2026).
Original GitHub issue: https://github.com/netblue30/firejail/issues/7048
Description
I was digging to resolve a problem with a sandbox till I discovered the root issue, the sandbox wasn't trying both ip stacks, as a fallback, inside the sandbox.
Steps to Reproduce
Expected behavior
Additional context
I've been trying to understand what's the difference but without a conclusion. Even using
--ignore=private-etckeeps failing.The real issue was android studio trying to connect to a local port for debugging purposes and failing to do it so, cause not trying on ipv4 after ipv6 failed...
Unfortunately
jail_prober.pywasn't a help here cause it affects even--noprofile:(Environment
Checklist
firejail /usr/bin/vlcinstead offirejail vlc; seehttps://github.com/netblue30/firejail/issues/2877)/usr/bin/vlc) "fixes" it).https://github.com/netblue30/firejail/issues/1139)browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.--profile=PROFILENAMEto set the right profile. (Only relevant for AppImages)Log
Output of
LC_ALL=C firejail /path/to/programOutput of
LC_ALL=C firejail --debug /path/to/program@rusty-snake commented on GitHub (Jan 29, 2026):
How does
/etc/hostslook in the sandbox?@liloman commented on GitHub (Jan 30, 2026):
I see.
So every time you execute firejail it creates a random hostname and modify /etc/hosts to assign that random hostname to 127.0.0.1.
I see 2 issues:
1)BUG: When it creates a random hostname never execute sethostname, so hostname is not set properly as when you assign it with --hostname=mi-name
You can see it clearly on your bash prompt (PS1)
2)BUG: You loose localhost ipv4 resolution and don't care about ipv6. It should add the hostname(random/set) to ipv4 and ipv6 lines
How do you think I should report these issues?
@netblue30 commented on GitHub (Feb 3, 2026):
Marking it as a bug. I'll add an option to disabled the automatic replacement of /etc/hostname
@netblue30 commented on GitHub (Feb 8, 2026):
You can try it now. Add --keep-hostname on the command line.
@kmk3 commented on GitHub (Feb 24, 2026):
Should be fixed by:
6f164f415("--keep-hostname part 2 (#7048)", 2026-02-03)ipv4 should be fixed by:
6f164f415("--keep-hostname part 2 (#7048)", 2026-02-03)ipv6 should be fixed by:
Edit: I'll add localhost lines after #7077.