On Tue, 24 Jun 2025 12:33:17 +0100
"Richard W.M. Jones" <rjones(a)redhat.com> wrote:
On Tue, Jun 24, 2025 at 12:37:22PM +0200, Stefano Brivio wrote:
> On Tue, 24 Jun 2025 15:46:13 +0530
> "Aithal, Srikanth" <sraithal(a)amd.com> wrote:
>
> > On 6/24/2025 3:04 PM, Stefano Brivio wrote:
> > > On Tue, 24 Jun 2025 09:12:33 +0100
> > > "Richard W.M. Jones"<rjones(a)redhat.com> wrote:
> > >
> > >> On Tue, Jun 24, 2025 at 01:25:47PM +0530, Aithal, Srikanth wrote:
> > >>> libguestfs: command: run: \ --pid /tmp/libguestfsJamIlZ/passt1.pid
> > >> ...
> > >>> Don't run as root. Changing to nobody...
> > >> ...
> > >>> PID file open: Permission denied
> > > I think that might be due to an issue in the AppArmor policy from the
> > > version shipped with Ubuntu 24.04 (that's a rather old version), but
> > > I'm not entirely sure what it might be.
> > >
> > > Aithal, could you have a look at /var/log/audit/audit.log (say,
> > > "tail -f /var/log/audit/audit.log") while you're running
this?
> > >
> > > AppArmor access denials are logged there, as well as in the system log.
> >
> > I updated my Ubuntu 24.04 system to the latest version using apt
> > upgrade. Following the update, I can now run virt-customize as a
> > non-root user with passt, resolving the previous permission issue.
> >
> > However, I am still encountering the original issue I faced with
> > libslirp and now with passt: the network interfaces inside the
> > libguestfs appliance are not being assigned IP addresses.
> >
> > I have attached the new logs for your review. Thank you for your time
> > and assistance.
> >
> >
> > /# dpkg -l | grep passt/
> > ii passt 0.0~git20240220.1e6f92b-1 amd64
> > user-mode networking daemons for virtual machines and namespaces
> >
> >
> > /# sudo -u amd virt-customize -v -x -a
> > /home/amd/noble-server-cloudimg-amd64.qcow2 --install isc-dhcp-client/
> >
> > ..
> >
> > libguestfs: command: run: passt --help
> > Usage: passt [OPTION]...
> >
> > -d, --debug\t\tBe verbose
> > --trace\t\tBe extra verbose, implies --debug
> > ..
> >
> > ..
> >
> > libguestfs: command: run: passt
> > libguestfs: command: run: \ --one-off
> > libguestfs: command: run: \ --socket /tmp/libguestfsTs3w5r/passt.sock
> > libguestfs: command: run: \ --pid /tmp/libguestfsTs3w5r/passt1.pid
> > libguestfs: command: run: \ --address 169.254.2.15
> > libguestfs: command: run: \ --netmask 16
> > libguestfs: command: run: \ --mac-addr 52:56:00:00:00:02
> > libguestfs: command: run: \ --gateway 169.254.2.2
> > No routable interface for IPv6: IPv6 is disabled
> > Template interface: enp97s0 (IPv4)
> > MAC:
> > host: 52:56:00:00:00:02
> > DHCP:
> > assign: 169.254.2.15
> > mask: 255.255.0.0
> > router: 169.254.2.2
> > DNS:
> > 169.254.2.2
> > DNS search list:
> >
amd.com
> > UNIX domain socket bound at /tmp/libguestfsTs3w5r/passt.sock
>
> ...I didn't realise you don't have IPv6 connectivity on the host,
> sorry. Then passt won't really help bypassing IPv4.
>
> Rich, I think the issue here is that appliance/init does:
>
> iface=$(ls -I all -I default -I lo /proc/sys/net/ipv4/conf)
>
> and that will pick sit0 over eth0, but it shouldn't. If requesting
> jq(1) is an option, perhaps:
>
> iface=$(ip -j link show | jq -rM '.[] | select(.link_type ==
"ether").ifname')
>
> would be somewhat more accurate.
I'm a bit confused here. How does host IPv4 or IPv6 affect what
happens in the appliance?
The appliance still needs to connect to hosts using IPv4 or IPv6
addresses.
My hope was simply that availability of IPv6 would work around the
issue, because IPv4 isn't configured here (due to the issue I'm pointing
out).
The interface appliance/init selects to configure IPv4 via DHCP is
sit0 instead of eth0.
For example if the host only had IPv6, it should still work
wouldn't
it?
With IPv6 only, appliance/init would at least need to bring up the
interface to configure the interface via SLAAC. I don't see it being
done, so, unless it's done implicitly somewhere, that shouldn't work,
either.
I guess that should be fixed as well, with, say:
ip link set "${iface}" up
Also I'm confused where sit0 comes from (or even what it is,
really).
Why does it appear inside the appliance at all?
See original report from Aithal for full details (and in my opinion a
reasonable request to offer a way to disable the module inside the
appliance).
Long story short, you configure the kernel with CONFIG_IPV6_SIT, and
the kernel will automatically create the sit0 interface at boot, which
causes appliance/init to ask dhclient to configure it (instead of eth0).
SIT stands for "Simple Internet Transition" and it's essentially the
6to4 (
https://en.wikipedia.org/wiki/6to4) implementation on Linux. It's
not supposed to be used in the appliance at all, but the interface
appears merely because the kernel is configured with it.
My mental model is that passt provides an IPv4 address inside the
host
on eth0. If the host has, say, only IPv6, then requests would be
proxied out over that. We don't care how that happens precisely.
Protocol families are not simply proxied between each other because
there's no shared address space between IPv4 and IPv6.
Let's say you connect to 88.198.0.164 from the appliance, but there's
no IPv4 routing available on the host: passt will *not* reverse-resolve
88.198.0.164 to passt.top and connect you to 2a01:4f8:222:904::2
instead. That would be kind of surprising and add convoluted DNS
requirements.
We have a request for CLAT:
https://bugs.passt.top/show_bug.cgi?id=43
where one could do something like that, but you would need to configure
it explicitly (the day it's implemented).
In any case, this has all little to do with the actual issue. The
problem is that the appliance runs dhclient or dhcpcd on sit0 instead
of eth0, because excluding "all", "default", and "lo" is not
enough. If
you prefer a minimal fix:
iface=$(ls -I all -I default -I lo -I sit0 /proc/sys/net/ipv4/conf)
would also work.
I can send a patch, too, but it might take me a while before I find a
moment to prepare the test setup.
--
Stefano