Skip to content

tools: fix vm.run(user="root") on template imported from R4.2 (cont)#467

Open
marmarek wants to merge 1 commit intoQubesOS:mainfrom
marmarek:root-run-fix
Open

tools: fix vm.run(user="root") on template imported from R4.2 (cont)#467
marmarek wants to merge 1 commit intoQubesOS:mainfrom
marmarek:root-run-fix

Conversation

@marmarek
Copy link
Copy Markdown
Member

@marmarek marmarek commented Apr 9, 2026

Template imported from R4.2 already has qubes.VMRootShell service, but
it isn't really running as root by default. It's only R4.3+ when both
qubes.VMRootShell and qubes.VMRootExec got also force-user=root setting.
Since the check for VMRootExec is already needed anyway, use the same to
check if using qubes.VMRootShell makes sense, as both changes were
introduced at the same time in core-agent-linux:

1c538af2 Use rpc-config for running qubes.VMRoot* services as root
563a9cfa Add qubes.VMRootExec service

This is more flexible method than hardcoding version check.

And add a test for this case.

Fixes: f38c1d4 "use qubes.VMRootExec/qubes.VMRootShell services when root needed"
Fixes QubesOS/qubes-issues#10590

Template imported from R4.2 already has qubes.VMRootShell service, but
it isn't really running as root by default. It's only R4.3+ when both
qubes.VMRootShell and qubes.VMRootExec got also force-user=root setting.
Since the check for VMRootExec is already needed anyway, use the same to
check if using qubes.VMRootShell makes sense, as both changes were
introduced at the same time in core-agent-linux:

    1c538af2 Use rpc-config for running qubes.VMRoot* services as root
    563a9cfa Add qubes.VMRootExec service

This is more flexible method than hardcoding version check.

And add a test for this case.

Fixes: f38c1d4 "use qubes.VMRootExec/qubes.VMRootShell services when root needed"
Fixes QubesOS/qubes-issues#10590
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.67%. Comparing base (38c79ef) to head (626633e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #467      +/-   ##
==========================================
+ Coverage   76.65%   76.67%   +0.02%     
==========================================
  Files          53       53              
  Lines        9407     9407              
==========================================
+ Hits         7211     7213       +2     
+ Misses       2196     2194       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Root access fails on debian-12-minimal templates created in r4.2 and restored in r4.3, causing qubes-dist-upgrade error

1 participant