Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,284 changes: 1,216 additions & 68 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ scopeguard = "1.2"
serde = { version = "1.0", features = ["derive"] }
serde_bytes = "0.11"
serde_json = "1.0"
memmap2 = "0.9"
winit = "0.30"
softbuffer = "0.4"
serde-saphyr = { version = "1.0.1", default-features = false, features = ["deserialize"] }
sha2 = "0.11.0"
smoltcp = { version = "0.13", default-features = false }
Expand Down Expand Up @@ -207,3 +210,10 @@ parking_lot = "0.12"
rpassword = "7"
russh = "0.62.4"
russh-sftp = "2.3.0"

# Published 0.1.32 crates plus the changes the experimental virtio-gpu display
# needs (see third_party/README.md). Upstream target: zerocore-ai/libkrun.
[patch.crates-io]
msb_krun = { path = "third_party/msb_krun" }
msb_krun_devices = { path = "third_party/msb_krun_devices" }
msb_krun_utils = { path = "third_party/msb_krun_utils" }
5 changes: 5 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ tracing.workspace = true
zeroize = { workspace = true, optional = true }
tracing-subscriber.workspace = true

[target.'cfg(target_os = "macos")'.dependencies]
memmap2.workspace = true
softbuffer.workspace = true
winit.workspace = true

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61.2", features = ["Wdk_Foundation", "Wdk_Storage_FileSystem", "Win32_Foundation", "Win32_Security", "Win32_Storage_FileSystem", "Win32_System_IO"] }

Expand Down
8 changes: 7 additions & 1 deletion crates/cli/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use clap::{CommandFactory, Parser, Subcommand};
use console::style;
use microsandbox_cli::{
commands::{
completion, context, copy, create, exec, image, inspect, install, list, logs, metrics,
completion, context, copy, create, display, exec, image, inspect, install, list, logs, metrics,
modify, ping, ps, pull, registry, remove, restart, run, self_cmd, snapshot, start, stop,
touch, uninstall, volume,
},
Expand Down Expand Up @@ -114,6 +114,9 @@ enum Commands {
/// Check whether one or more sandbox agents are reachable.
Ping(ping::PingArgs),

/// Show a running sandbox's display in a native window (macOS).
Display(display::DisplayArgs),

/// Refresh idle activity for one or more running sandboxes.
Touch(touch::TouchArgs),

Expand Down Expand Up @@ -319,6 +322,8 @@ fn main() {
log_args::init_tracing(sandbox_level, false);
sandbox_cmd::run(args); // returns `!`
}
// The window event loop owns the main thread; no Tokio needed.
Commands::Display(args) => display::run(args),
command => {
// CLI commands write tracing to the user's terminal.
// Honor TTY detection + NO_COLOR; we set `ansi` explicitly
Expand Down Expand Up @@ -656,6 +661,7 @@ fn run_async_command_anyhow(

match command {
Commands::Sandbox(_) => unreachable!("handled before Tokio starts"),
Commands::Display(_) => unreachable!("handled before Tokio starts"),
Commands::SchemaBaseline(_) => unreachable!("handled before backend resolution"),
Commands::Context(args) => context::run(args),
#[cfg(windows)]
Expand Down
Loading