Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Duplicate Threads
  • Search

Howto use the "Kernel support for MISC binaries" w

Threads in this read-only forum cover topics discussed elsewhere in other forums.
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
rojaro
l33t
l33t
Posts: 732
Joined: Mon May 06, 2002 4:56 pm
Contact:
Contact rojaro
Website

Howto use the "Kernel support for MISC binaries" w

  • Quote

Post by rojaro » Fri Sep 19, 2003 7:28 pm

Introduction
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/filesystems
If this results in a line saying "nodev binfmt_misc" then you're ready to go to step two. Otherwise, you have to recompile your kernel and make sure that you have the CONFIG_BINFMT_MISC option enabled (Executable file formats -> Kernel support for MISC binaries). Don't forget to install the kernel properly and reboot.

Step 2.
Now run the following command

Code: Select all

echo 'binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc defaults 0 0' >> /etc/fstab
or open the /etc/fstab file with your favorite editor and add the line

Code: Select all

binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc defaults 0 0
by hand - just make sure it gets mounted AFTER proc has been mounted.

Step 3.
Just type

Code: Select all

mount /proc/sys/fs/binfmt_misc
Step 4.
Open /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/register
and then either run the local.start script or just type the following line again at the shell.

Code: Select all

echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
This makes it work imediately without rebooting. Now you just give those *.exe files you want to run the executable bit (chmod +x stupid.exe).

Step 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 PATH
The End
The "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.
A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970)
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Mon Jun 05, 2017 3:36 am

Moved from Documentation, Tips & Tricks to Duplicate Threads in, perhaps belated, deference to "[topic=86868]Howto use the "Kernel support for MISC binaries" w[/topic]".
Top
Post Reply

2 posts • Page 1 of 1

Return to “Duplicate Threads”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic