Fix network configuration permission failures for non-root VC#756
Merged
Conversation
Write protected Linux network configuration files through an explicitly elevated copy operation so Virtual Client can run as a non-root user. Add coverage for each protected destination and preserve process diagnostics and temporary-file cleanup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e9198c10-5ac9-4f4f-bc79-06721f6194b0
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Keep the permission fix focused on explicitly elevated file copies without threading EventContext through the existing setup methods. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e9198c10-5ac9-4f4f-bc79-06721f6194b0
Keep only the existing test mock updates required for writes through a temporary path; live VM validation covers the elevation behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e9198c10-5ac9-4f4f-bc79-06721f6194b0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e9198c10-5ac9-4f4f-bc79-06721f6194b0
AlexWFMS
enabled auto-merge (squash)
July 17, 2026 22:05
ericavella
approved these changes
Jul 17, 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.
Problem
NetworkConfigurationSetupwrites directly to root-owned Linux files:/etc/security/limits.conf/etc/systemd/system.conf/etc/systemd/user.conf/etc/rc.localWhen Virtual Client runs as a non-root user, setup fails on the first write:
Change
CreateElevatedProcess.finally.VERSIONto3.3.24.This keeps the VC workload process non-root while explicitly elevating only
the system configuration operations that require it.
Validation
Live Ubuntu 22.04 VM
Tested current-main VC
3.3.22with the PERF-NETWORKNetworkConfigurationSetupdependency:limits.confaccess denial; process exited250.sudo0, requested the expected reboot, applied all protected settings, and left zero temporary files.The VM, NIC, disk, and transfer artifacts were deleted after validation.
Unit tests
Build