X session in Git Bash on Windows?

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 to access X11 display.

I have X-Win 32 (commercial). I’ve also used Xming which is like a free version of X-Win 32 but has problems with certain graphics.

  • Auto deployment with Git and Rails, How does it work?
  • EGit Push: How to store the remote repository info
  • Git console in Netbeans
  • GitLab: is there a way to assign a status/comment to a branch?
  • Complex git rebase maneuver
  • git: Create new local branch without any local un-committed change
  • Is there a way I can get this remote system to access my X11 display through X-Win 32 or Xming or through any way ?

    I’d just like to run programs like MATLAB, with a GUI popping up, from UNIX machines, when SSH’ed into that machine via Git Bash on Windows.

    I also have PuTTY and Secure Shell Client installed, but would prefer to work exclusively form Git Bash because it requires less buttons to press in order to ssh to other machines.

    If it’s impossible to get this working on Git Bash I’d like to get it working with PuTTY (Secure Shell Client is good but has discontinued updates permanently).

  • how can i parse the output of `defaults read` on OS X?
  • How do I pull my project from github?
  • Fabric error: Fatal error: local() encountered an error (return code 2) while executing 'git commit -m 'message'
  • Microsoft Visual Studio Tools for git push error
  • git special characters on mac
  • How do I create a commit without a parent in Git?
  • 6 Solutions collect form web for “X session in Git Bash on Windows?”

    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).

    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.

    I was able to accomplish this using putty and xming

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

    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.

    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.

    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.

    Git Baby is a git and github fan, let's start git clone.