Wine is such a nice tool. It finally allows me to run Photoshop 7 (Screenshot) (and some windoze Games that are not available in a Linux version) on my Linux workstation. But if one wants to run some Windows program with it, one always had to run it like "wine /path/to/program.exe" and if one runs windows programs (like Photoshop or even Counterstrike) with wine very often this procedure is getting quiet anoying.
To run those programs more quickly, one often creates a shellscript or an alias so the program can be run with just one command instead of running the commandline above. But if you have many tools this method also gets quite anoying, but there is an even better alternative :)
How about running Photoshop and any other Windowsprogram just by typing just Photoshop.exe? The following Tutorial shows you how to get it running with Linux 2.6.
Note: The same procedure might apply to older Kernels too, but as i don't have any of them running, i have no easy way to verify this.
Requirements: You need a flavor of wine installed to get this Windows example working.
Step 1.
If you've compiled a Linux Kernel yourself, you've probably noticed the "Executable file formats" submenu in menuconfig with this "Kernel support for MISC binaries" and you've probably left it enabled as it is by default.
To check if you have it enabled just run the following command:
Code: Select all
grep binfmt_misc < /proc/filesystemsStep 2.
Now run the following command
Code: Select all
echo 'binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc defaults 0 0' >> /etc/fstabCode: Select all
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc defaults 0 0Step 3.
Just type
Code: Select all
mount /proc/sys/fs/binfmt_miscOpen /etc/conf.d/local.start with your favorite editor and add the following two lines:
Code: Select all
# Enable support for Windows / DOS binaries by running them automatically with wine
echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/registerCode: Select all
echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/registerStep 5.
Lazy folks like me also might want to add the directories containing the Windows binaries into PATH environment variable ... for convenience i added this to my ~/.bashrc
Code: Select all
# Windows programs locations
WINE=~/.wine/fake_windows/Program\ Files
PATH=$PATH:$WINE/Adobe/Photoshop
PATH=$PATH:$WINE/Halflife
export PATHThe "Kernel support for MISC binaries" really supports all kind of "binaries" even if they are not technically "executable" binaries. For example you can have native support for Java binaries, MP3 files or whatever as long they get the executable bit. A good example besides Java applets are C64 floppy images (*.d64), which when made executeable could be automatically started with an assigned C64 emulator. There is a good example for Java binaries in /usr/src/linux/Documentation/java.txt how to get this working with Java binaries. The official Documentation for the "Kernel support for MISC binaries" is located in /usr/src/linux/Documentation/binfmt_misc.txt.

