Repository navigation
fix(install): Set up the host with sudo, with the host's own package manager - #36
Merged
Merged
Conversation
On a fresh Ubuntu 26.04 cloud image, a user install stopped before the download because uidmap and acl were missing, and printed a block of commands for root. The installer already makes the AppArmor profile, the udev rule and the module with sudo when sudo runs without a password, but treated packages and a subuid range as root's alone, so a user who had that sudo was stopped all the same and read it as a failure. With such a sudo, the installer now installs those packages and adds the range before the download, checks the host again, and goes on. Without one it stops as before, and now also says that `sudo -v` lets it do this, which it said only when no package was missing. If the sudo step fails, it says so and stops. Signed-off-by: Panagiotis Moustafellos <pmoust@nofire.ai>
1 of 6 tasks
pmoust
marked this pull request as ready for review
October 31, 2026 15:30
Under curl ... | sh, stdin is the script, so sudo -n was the only sudo the preflight could use, and a user whose sudo needs a password was stopped with a block of commands to run. A user in the sudo, admin or wheel group is now asked for the password once on the terminal, and the install goes on as it does with a sudo that needs none. With no terminal, or for any other user, it stops as before. Signed-off-by: Panagiotis Moustafellos <pmoust@nofire.ai>
The step that installs what the rootless setup needs always ran apt-get, so on RHEL 10 and openSUSE Leap 16, which lack setfacl, it failed and the install stopped. It now uses the package manager the host has (apt-get, dnf, yum, zypper or pacman) with the names that one gives the tools. On openSUSE Leap 16, with that fixed, every run then failed in the network setup: the CNI firewall plugin runs iptables, and Leap 16 ships nftables alone. urunc's "failed to read from init socket: EOF" hid the cause. A user install now installs iptables (iptables-nft on the RHEL family) with the other packages. The check also looks in /usr/sbin and /sbin, where Debian keeps it off a user's PATH, so Debian no longer warns about an iptables it has. Signed-off-by: Panagiotis Moustafellos <pmoust@nofire.ai>
Member
Author
|
Ran this branch at 034d3e2 on five fresh GCP VMs, as each image's default user (sudo without a password):
Doctor had no failing line on any of them. The first round, at e115abf, failed on RHEL and openSUSE (apt-get only) and then on openSUSE's missing |
This was referenced Oct 31, 2026
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.
An external tester ran
curl -fsSL brig.sh/install | shon the Ubuntu 26.04 LTS cloud image as a normal user, and the user install stopped before the download withnewuidmap is missing,setfacl is missingand a block of commands for root. They read it as a failure.Reproduced on GCP (Ubuntu 26.04.1, kernel 7.0, nested KVM). The default user there has sudo without a password. The installer already makes the AppArmor profile, the udev rule and the vhost_vsock module with that sudo, but treated packages and a subuid range as root's alone, so a fresh image, which lacks
uidmapandacl, stopped regardless. After running the printed block, the same install finished and booted Ubuntu 26.04, so nothing else on 26.04 is broken.With sudo that needs no password, the installer now installs those packages and adds the subuid range before the download, checks the host again, and goes on. The rest stays with the rootless setup, as before. When sudo needs a password, a user in the
sudo,adminorwheelgroup is asked for it once on the terminal, and the install goes on the same way. Undercurl | shstdin is the script, so the prompt reads/dev/tty. With no terminal, or for any other user, it stops as before, and now also namessudo -v(it did that only when no package was missing). A failed sudo step stops the install and says so.Checked:
install.shinstalleduidmapandacl, installed rc20,brig doctorhad no failing row, andbrig sh ubuntubooted. As a user with no sudo: it stopped, printed the block, and namedsudo -v. On a second fresh VM, as a user in thesudogroup whose sudo needs a password, under a terminal with the script on stdin ascurl | shruns it: one password prompt, then the install finished,brig doctorhad no failing row, andbrig sh ubuntubooted.tests/install-preflight.shhas new cases: no sudo, sudo, a failed sudo step, the password prompt, and no prompt without a terminal or a sudo group. They pass in a Debian container as a normal user, and the first fails on the installer from main.Run on five fresh GCP VMs (n2-standard-4, nested KVM), as the image's default user, with this branch's
install.sh, thenbrig doctorandbrig sh ubuntu:newuidmap, nosetfacl, AppArmor restricts user namespacesapt-get install -y uidmap aclnewuidmap, nosetfaclapt-get install -y uidmap aclsetfacldnf install -y aclsetfacl, noiptableszypper --non-interactive install acl iptablesusermod --add-subuids ...The first round found two more problems, now fixed here. The package step always ran
apt-get, so RHEL and openSUSE stopped. It now uses the host's package manager (apt-get, dnf, yum, zypper or pacman) and its package names. And on openSUSE Leap 16, which ships nftables alone, every run failed in the network setup, since the CNI firewall plugin runsiptables(plugin type="firewall" failed (add): could not initialize iptables protocol 0: exec: "iptables": executable file not found). urunc showed it asfailed to read from init socket: EOF, as in brig-sh/brig#541. A user install now installsiptableswith the other packages (iptables-nfton the RHEL family). The check also looks in/usr/sbin, so Debian, which keeps it there, stops warning about aniptablesit has.Fedora is not in the table: GCP has only Fedora CoreOS images.
This reaches
brig.sh/installonce a bundle release carries it and brig'sinstall.shpins that release (it pins rc19 today).