msys on wine - partial success

Dan Kegel dank at
Sun Mar 19 10:53:04 CST 2006

Last year, I poked at using msys under wine:
but didn't follow up on the hint that wineconsole would help.
Finally got around to it.  Sure enough, you can run msys's
sh.exe in a wineconsole!  It's ugly and can't seem to run
configure scripts yet, but it does run simple shell
scripts and interactive commands like cd, pwd, and ls.
Sort of.

Here's what I tried:

created c:\msys\1.0.  Looking in that directory, I saw a script MSYS.BAT
that one uses to start a shell.  Rather than figuring out how to invoke
that batch file in Wine, I read it, saw that it invoked sh as "sh --login -i",
and wrote a little shell script that did something similar:
  wineconsole ~/.wine/drive_c/msys/1.0/bin/sh.exe --login -i

This had problems with the path -- it couldn't find msys's external
commands.  Running "echo $PATH" showed that it defaulted
to including /mingw/bin, so I cheated and added a symlink:
 ln -s ~/.wine/drive_c/msys/1.0 ~/.wine/drive_c/mingw
That worked; I can now use msys's external commands in
the msys sh.  I probably should have modified the PATH, but
that was hard to script.

The ugly part is, when you give any command, the first thing that happens
is a pair of warnings:

sh: fork: No such file or directory
sh: child setpgid (-45 to -50): Invalid argument

And if you try to run mauve's configure script.
it stops after the second statement.  It seems
that anything involving subshells or eval confuses
it greatly.

Also, if you're not very careful with the first command you type,
it gets into a bad state where it ignores half the keys you type,
or something.

All in all not very healthy, but that's not too surprising for
a first try.
- Dan

Wine for Windows ISVs:

More information about the wine-devel mailing list