Skip to content

Commit

Permalink
x11: Use muvm-x11bridge instead of x112virtgpu
Browse files Browse the repository at this point in the history
Signed-off-by: Asahi Lina <lina@asahilina.net>
  • Loading branch information
asahilina committed Oct 31, 2024
1 parent fdfe406 commit 3fc1467
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions crates/muvm/src/guest/x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ use std::process::Command;
use anyhow::{anyhow, Context, Result};
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};

use super::socket::setup_socket_proxy;

use crate::utils::env::find_in_path;
use crate::env::find_muvm_exec;

pub fn setup_x11_forwarding<P>(run_path: P) -> Result<bool>
where
Expand All @@ -26,18 +24,10 @@ where
}
let host_display = &host_display[1..];

let x112virtgpu_path =
find_in_path("x112virtgpu").context("Failed to check existence of `x112virtgpu`")?;

if x112virtgpu_path.is_some() {
let mut cmd = Command::new(x112virtgpu_path.unwrap());
cmd.args(["--listen-display", ":1"]);
let mut cmd = Command::new(find_muvm_exec("muvm-x11bridge")?);
cmd.args(["--listen-display", ":1"]);

cmd.spawn().context("Failed to spawn `x112virtgpu`")?;
} else {
log::error!("x112virtgpu not available, X11 forwarding will operate in socket forwarding mode. This is probably not what you want.");
setup_socket_proxy(Path::new("/tmp/.X11-unix/X1"), 6000)?;
}
cmd.spawn().context("Failed to spawn `muvm-x11bridge`")?;

// SAFETY: Safe if and only if `muvm-guest` program is not multithreaded.
// See https://doc.rust-lang.org/std/env/fn.set_var.html#safety
Expand Down

0 comments on commit 3fc1467

Please sign in to comment.