#414805 qemu: can't use fakeroot in linux-user target when setuid root

Package:
qemu
Source:
qemu
Submitter:
"Stuart R. Anderson"
Date:
2025-08-11 08:13:02 UTC
Severity:
normal
Tags:
#414805#5
Date:
2007-03-13 22:02:06 UTC
From:
To:
Admitedly, this one is a bit ugly since it involves making qemu be setuid root,
but with this fix, fakeroot will work inside of a chroot of another architecture.
With this, I can use sbuild on top of a chroot of another architecture to build
packages for that architecture (ie arm on x86_64). This setup is similar to
http://wiki.debian.org/QemuUserEmulation, but does not need the dpkg-cross stuff.

#414805#12
Date:
2013-11-28 21:55:30 UTC
From:
To:
[Replying to an old bugreport]

14.03.2007 01:02, Stuart R. Anderson wrote:

This is ugly indeed.  Not just ugly, but actually unacceptable, because qemu is
not designed to run as setuid-root, and it is a rather complex piece of software
with a ton of it own bugs, so making it setuid-root effectively makes the target
system 0wned.

I'm marking this as wontfix due to this reason.

However, see #707626 which is apparently the same issue, but reported differently.
Apparently there's a prob with using fakeroot under qemu-user, but it looks like
the actual bug should be found and fixed, instead of working around it by making
qemu to be setuid.

Do you know _why_ it fails in the first place?

Thanks,

/mjt

#414805#19
Date:
2013-11-29 15:51:38 UTC
From:
To:
Been a while 8-), but IIRC, this was a follow-on to bug #412032. If qemu
was made setuid root, then the env needed to be restored to get the right
behavior. If there is now another way of accomplishing setuid capability
via binfmt, and is suggested in #412032, then this part of the fix is
most likely not needed, so closing it is fine.

                                  Stuart

Stuart R. Anderson                               anderson@netsweng.com
Network & Software Engineering                   http://www.netsweng.com/
1024D/37A79149:                                  0791 D3B8 9A4C 2CDC A31F
                                                   BD03 0A62 E534 37A7 9149

#414805#24
Date:
2025-08-11 08:10:06 UTC
From:
To:
On Fri, 29 Nov 2013 10:51:38 -0500 (EST) Stuart Anderson <anderson@netsweng.com> wrote:
This has been fixed quite long time ago, in version 0.11.1-1, when
qemu package in debian registered with binfmt_misc subsystem:

qemu (0.11.1-1) unstable; urgency=low

   [ Aurelien Jarno ]
   * qemu-user-static: register QEMU with binfmt mecanism. Closes:
     #306637.