Repository navigation
Conversation
`sandbox exec`, `connect`, and file transfer reach the sandbox through the supervisor's SSH server. On Windows that server was never started and the relay rejected SSH targets, so exec failed on both MXC backends. Supervisor: the relay and the SSH server run in the same process, so on Windows each relay is handed to the server as one half of an in-memory duplex stream, registered under the configured socket path. No socket or pipe is created, so nothing outside the supervisor can reach the server. The Unix socket path is unchanged. MXC driver: pass OPENSHELL_SSH_SOCKET_PATH so the supervisor starts its SSH server. MXC boundary: accept shell exec intent. The gateway sends a POSIX command string built by shell_escape; when it is that plain form, recover argv, environment, and working directory and spawn the program directly. Other shell syntax runs through cmd.exe /d /s /c. When a program cannot be started directly, retry through cmd.exe, as a POSIX shell would report "command not found" itself; this also resolves cmd built-ins. Without the retry the SSH client waits for an exit status that never arrives. PTY (ConPTY) remains unsupported, so `sandbox connect` is not enabled. Signed-off-by: Geoffrey Trousdale (they/them) <getrou@microsoft.com>
- MXC boundary: pass the tail after `cmd.exe /c` verbatim (with /s and outer quotes) for both exec and the main process, because cmd.exe does not use CRT argument quoting. - MXC driver: honor a generic `create -- <command>` and default the working directory to a per-sandbox temp directory when the template sets none. - CLI/core: escape the SSH ProxyCommand for Windows and split Windows sandbox paths correctly. Signed-off-by: Geoffrey Trousdale (they/them) <getrou@microsoft.com>
StartSandbox returned Unimplemented. Stop already tears the runtime down completely (for an isolation session it also deprovisions the agent user), so start reruns the sandbox lifecycle from the stored spec with the fresh launch credentials the gateway supplies. Each start gets its own runtime generation and state directories; the previous generation's directories are removed. Host paths named by the policy, such as the workspace, persist across the restart. A start of a sandbox that is already starting or running succeeds without relaunching. The isolation-session agent user is not preserved across a restart: a new agent user is provisioned for each start. Also fix the Windows restart counter fixture: cmd includes the space before `&` in echoed text, so the counter read "2 " instead of "2". Signed-off-by: Geoffrey Trousdale (they/them) <getrou@microsoft.com>
|
Thank you for your interest in contributing to OpenShell, @getrou. This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer. To get vouched:
See CONTRIBUTING.md for details. |
|
Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text: I have read the DCO document and I hereby sign the DCO. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot. |
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.
Draft: opening for early feedback on the Windows exec approach. Linux verification and a linked accepted issue are pending.
Summary
Adds
sandbox execand sandbox restart to the MXC driver on Windows, so the standard OpenShell CLI flows (create, exec, stop, start, delete) work on both theprocess_containerandisolation_sessionbackends. Commands now run on Windows as written, without POSIX shell assumptions.Related Issue
Closes #NNN
Changes
cmd.exe /d /s /c.cmd.exe, so the gateway always gets an exit status instead of waiting on a failed channel.cmd /ctail is passed verbatim (cmd does not use CRT quoting) for both exec and the main process.create -- <command>works without driver config and defaults the working directory to%TEMP%\openshell-mxc\<sandboxId>.ProxyCommandquoting inopenshell-coreand the CLI, plussplit_sandbox_pathfor Windows paths.start_sandboxre-runs the MXC lifecycle with fresh launch authentication after a full stop. The workspace persists across restarts.start_sandboxtests.Release Notes
openshell sandbox execandopenshell sandbox start(restart) now work for MXC sandboxes on Windows.Testing
x86_64-pc-windows-msvc);cargo testpasses for the affected crates on WindowsManual verification on a Windows VM with MXC, on both
process_containerandisolation_session:sandbox execwith plain argv,cd X &&/K=vprefixes, and cmd syntax (&,if exist, redirection)mkdir -p,tar,realpath) inside the sandbox.Checklist