mono.txt 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. Mono(tm) Binary Kernel Support for Linux
  2. -----------------------------------------
  3. To configure Linux to automatically execute Mono-based .NET binaries
  4. (in the form of .exe files) without the need to use the mono CLR
  5. wrapper, you can use the BINFMT_MISC kernel support.
  6. This will allow you to execute Mono-based .NET binaries just like any
  7. other program after you have done the following:
  8. 1) You MUST FIRST install the Mono CLR support, either by downloading
  9. a binary package, a source tarball or by installing from CVS. Binary
  10. packages for several distributions can be found at:
  11. http://go-mono.com/download.html
  12. Instructions for compiling Mono can be found at:
  13. http://www.go-mono.com/compiling.html
  14. Once the Mono CLR support has been installed, just check that
  15. /usr/bin/mono (which could be located elsewhere, for example
  16. /usr/local/bin/mono) is working.
  17. 2) You have to compile BINFMT_MISC either as a module or into
  18. the kernel (CONFIG_BINFMT_MISC) and set it up properly.
  19. If you choose to compile it as a module, you will have
  20. to insert it manually with modprobe/insmod, as kmod
  21. cannot be easily supported with binfmt_misc.
  22. Read the file 'binfmt_misc.txt' in this directory to know
  23. more about the configuration process.
  24. 3) Add the following entries to /etc/rc.local or similar script
  25. to be run at system startup:
  26. # Insert BINFMT_MISC module into the kernel
  27. if [ ! -e /proc/sys/fs/binfmt_misc/register ]; then
  28. /sbin/modprobe binfmt_misc
  29. # Some distributions, like Fedora Core, perform
  30. # the following command automatically when the
  31. # binfmt_misc module is loaded into the kernel.
  32. # Thus, it is possible that the following line
  33. # is not needed at all. Look at /etc/modprobe.conf
  34. # to check whether this is applicable or not.
  35. mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
  36. fi
  37. # Register support for .NET CLR binaries
  38. if [ -e /proc/sys/fs/binfmt_misc/register ]; then
  39. # Replace /usr/bin/mono with the correct pathname to
  40. # the Mono CLR runtime (usually /usr/local/bin/mono
  41. # when compiling from sources or CVS).
  42. echo ':CLR:M::MZ::/usr/bin/mono:' > /proc/sys/fs/binfmt_misc/register
  43. else
  44. echo "No binfmt_misc support"
  45. exit 1
  46. fi
  47. 4) Check that .exe binaries can be ran without the need of a
  48. wrapper script, simply by launching the .exe file directly
  49. from a command prompt, for example:
  50. /usr/bin/xsd.exe
  51. NOTE: If this fails with a permission denied error, check
  52. that the .exe file has execute permissions.