X session in Git Bash on Windows?

后端 未结 6 2139
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-19 13:20

I\'m using Git Bash on Windows. I have used Git Bash to SSH into a UNIX machine and tried to run a program with a GUI. I got the message: LINUX/UNIX system detected, but unable

相关标签:
6条回答
  • 2021-02-19 13:41

    You can try adding the -X switch to your ssh command in git bash. I'm not sure if this will work. However, it's not the method I would suggest. Instead, I would suggest that you look into X forwarding using putty. You should be able to find a variety of guides on how to set this up with a quick search.

    0 讨论(0)
  • 2021-02-19 13:42

    Your problem is, that you somehow have to carry over the XAuthority data to the remote host. Normally SSH does this for you, but only if it's started with the right environment variables. Basically you need to figure out the location of the xauth data and put that path into the XAUTHORITY environment variable. The DISPLAY is most likely ":0.0".

    I think the most straightforward solution was using Cygwin and the X11 server it ships, because the X startup script of it will open a xterm from which you can SSH to the remote machine.

    0 讨论(0)
  • 2021-02-19 13:48

    I was able to accomplish this using putty and xming http://sourceforge.net/projects/xming/

    Simply start xming and enable x session forwarding in putty's options.

    0 讨论(0)
  • 2021-02-19 13:49

    This Q is rather old, but anyway... I was (at last...) able to get this working using the ssh command from Git for Windows and XMing. All I had to do was to set the DISPLAY environment variable to localhost:0.0 (it was set to only :0.0).

    0 讨论(0)
  • 2021-02-19 13:52

    An alternative to Xming is VcXsrv built using Visual Studio C++. The latest version of Xming now requires a donation.

    Point your mouse to the X icon in the status bar, and find out what port it runs on. If it is :0.0 (or :25.0), then in Git Bash: export DISPLAY=localhost:0.0 (or export DISPLAY=localhost:25.0). You may also need to use -Y instead of -X to your ssh command.

    0 讨论(0)
  • 2021-02-19 13:56

    You have to start the X server before you connect using SSH. And when you connect to the other box you'll have to include the -X switch with SSH. That'll tell SSH to forward X11 apps output to your Windows box.

    0 讨论(0)
提交回复
热议问题