Search code examples
ssh.netx11-forwardingteststand

forwarding x11 by SSH.NET c# library


I am using the ssh.net as an extension in TestStand, but I need somehow display the x11 forwarding. Is it possible somehow? I am using xming server on my win. machine.

Thank you


Solution

  • I found the solution:

     SSHInstance = new SshClient(HostOrIP, Port, Username, Password);
     SSHInstance.Connect();
     streamSSH = SSHInstance.CreateShellStream(ShellID, 1, 0, 0, 0, 2000000);
    
     ForwardedPortRemote forwardedPortRemote = new ForwardedPortRemote(6000 +X11ServerDisplay, HostOrIP, 6000 + X11LocalDisplay);
     SSHInstance.AddForwardedPort(forwardedPortRemote);
     forwardedPortRemote.Start();