#Apps attachted to subsystems run under root

27 messages · Page 1 of 1 (latest)

faint mirage
#

For dev purposes I have created some subsystems with a custom home directory, namely dev-yocto at /home/myuser/yocto-home based on debian:stable and dev-gtk at /home/myuser/gtk-home based on vanilla-dev.
The main idea is to have individual .vscode-server folders cause otherwise VScode can't attach to the containers reliably.
The problem is regardless of which app I attach to a given subsystem, I run as root in that subsystem, leaving behind all sorts of files owned by root in my /home.
This is especially annoying when you work on source code and your .git/HEAD is suddenly owned by root.
I'm assuming this is just normal Podman, or even Docker, behavior but is there any way to have those apps running as my user instead when they attach? (Yes, su myuser in the vscode terminal works, but the app itself still runs as root)

Edit: Yes, I use the Remote Container Development stuff

hidden geyser
#

Podman doesn't have root access, so this shouldn't be possible at all

#

Is the file still owned by root if you run host-shell ls -lh in the folder where your root owned file is?

#

You are using Vanilla os right? Not some other distro with a custom apx install

faint mirage
faint mirage
# hidden geyser You are using Vanilla os right? Not some other distro with a custom apx install

This is the latest Vanilla release.

ABRoot Partitions:
 • Present: vos-b ✓
 • Future: vos-a

Loaded Configuration: /etc/abroot/abroot.json

Device Specifications:
 • CPU: Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz
 • GPU: [Intel Corporation CometLake-H GT2 [UHD Graphics] (rev 05) NVIDIA Corporation TU117M [GeForce GTX 1650 Ti Mobile] (rev a1)]
 • Memory: 15835 MB

ABImage:
 • Digest: sha256:e2fefb16dc0387312fca46ab8e5af7b09a6fd3d44f91bc2801742fdeb363a23f
 • Timestamp: 2025-03-03 15:37:59
 • Image: ghcr.io/vanilla-os/nvidia-exp:main

Kernel Arguments: quiet splash bgrt_disable $vt_handoff lsm=integrity

Packages:
 • Added: 
 • Removed: 
 • Unstaged: 

Package agreement: true
hidden geyser
#

Okay so it's not really root, it's just looking like a root owned from inside the container

#

Checking if I can replicate it

hidden geyser
#

What happens if you create the file via the touch command ?

#

Still owned as root?

faint mirage
#

Through vscode yes.

#

note that I did not su root or anything

hidden geyser
#

Also if you do it from a normal commandline?

faint mirage
#

then it is my user

hidden geyser
#

Oh wait I think I misunderstood the entire time how you were working

#

You use the flatpak vscode with the remote working feature to work inside the containers?

faint mirage
#

Oh my bad, that's indeed how I want this to work

hidden geyser
#

Okay, I don't have any plan how that works inside vscode then

#

What you can do instead of what I and most others do is either installing vscode directly inside the container or use the dev container feature somehow

#

how is the server started inside the subsystem?

faint mirage
hidden geyser
#

I think its the extension which connects as root

#

Have you seen this?

faint mirage
#

I have not seen this yet 👀