Issue #9 open
created an issue

Hi there,

I had a few questions:

1) Is this project compatible with Mono / GTK#?
2) If not, are there any blocking issues that would prevent an implementation in GTK? (IE: libcfx.dll requiring a linux/mono build).
3) Any general guidance on how to get a Mono Linux/Mac build working?


Comments (36)

  1. wborgsm

    A few thoughts:

    • I can already run mono CfxTestBrowser.exe on a windows box provided I define the BrowserSubprocessPath - so the C# stuff seems to work fine with mono, at least with mono for windows.
    • There are a few PInvokes to be made platform independent, mostly LoadLibrary and GetProcAddress - that would be dlopen and friends. And I am not familiar with the workings of DllImport in mono for linux.
    • libcfx.dll - this is pure C and CRT plus some windows stuff, mostly LoadLibrary again. Should be easy to make this platform independent with a few #defines.
    • I don't know much about GTK, but ChromiumFX.dll and libcfx.dll build upon libcef.dll which should take care of those details :). ChromiumWebBrowser.dll needs System.Windows.Forms though.

    All in all, it should not be too hard to make this platform independent. For me, the biggest problem is currently not having a linux box. I wrote this library for a windows only application and don't need a linux version, at least not now. But if people are really interested, I could setup a virtual machine. And if this goes forward, help would be appreciated.

  2. bchavez reporter

    Thanks wborgsm for the info. I'm using a Cross Platform UI toolkit called Eto.Forms ( and was thinking about possibly writing a ControlHandler for Linux/Mac (GTK) and WinForms to use the underlying ChromiumFx engine. Thank you, your info is helping evaluate what needs to be done to get this to work.

  3. wborgsm

    So far I got an implementation on Ubuntu precise which loads and initializes the native libraries and starts processing the windowless test application, but as soon as it starts rendering, it breaks with an advice "free(): invalid pointer" deep into I really don't know when I will have the time to debug this. Anyway, the code is in the "linux" branch.

  4. wborgsm

    The crash is definitely related to the upstream issue referred in java-cef issue. Reverting to CEF branch 1750 it was possible to build a working windowless prototype on Ubuntu Precise. Further development of the linux branch will have to wait until that issue is resolved.

    The prototype is in the cef-1750 branch, solution linux/CfxLinux.sln.

  5. wborgsm

    If you check out the cef-1750 branch, you will find solution linux/CfxLinux.sln which builds libcfx from the MonoDevelop IDE under Ubuntu Precise (and possibly others). Note that this cross-platform approach is quite outdated since I can't update the branch for the reasons mentioned above.

    Anyway, the libcfx build is quite simple: libcfx.c is the one and only translation unit. It includes all the other c files and the header files. You have to define CFX_LINUX and make sure the compiler can find all the #includes; I think the search paths libcfx/Source, libcfx/Generated and linux/cef should have it all.

    I am waiting for the java-cef issue mentioned above to be resolved before merging the linux stuff into the default branch.

  6. Andrius Bentkus

    I didn't realize that the branch existed, not familiar with the bitbucket UI.

    Are you saying that that branch is functional? That the windowless example is working? What kind of features does it lack?

  7. Andrius Bentkus

    Ok, I just downloaded cef 1750 and put the dynamic libraries in the same directory, but all I get is this exception:

    mono Windowless.exe
    Unhandled Exception:
    Chromium.CfxException: Unable to load libcef library /home/bentkus/Projects/mono/chromiumfx/Build/Debug/
      at Chromium.CfxApi.Load () [0x00000] in <filename unknown>:0 
      at Chromium.CfxApi.Probe () [0x00000] in <filename unknown>:0 
      at Chromium.CfxRuntime.ExecuteProcess (Chromium.CfxApp application) [0x00000] in <filename unknown>:0 
      at Windowless.Program.Main () [0x00000] in <filename unknown>:0 
    [ERROR] FATAL UNHANDLED EXCEPTION: Chromium.CfxException: Unable to load libcef library /home/bentkus/Projects/mono/chromiumfx/Build/Debug/
      at Chromium.CfxApi.Load () [0x00000] in <filename unknown>:0 
      at Chromium.CfxApi.Probe () [0x00000] in <filename unknown>:0 
      at Chromium.CfxRuntime.ExecuteProcess (Chromium.CfxApp application) [0x00000] in <filename unknown>:0 
      at Windowless.Program.Main () [0x00000] in <filename unknown>:0 
  8. Andrius Bentkus

    O man, an ldd revealed:

    ldd /home/bentkus/Projects/mono/chromiumfx/Build/Debug/ =>  (0x00007fff979ee000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff24ae000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff22a4000) => /lib/x86_64-linux-gnu/ (0x00007fcff209b000) => /lib/x86_64-linux-gnu/ (0x00007fcff1e97000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff185b000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff15a8000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff1386000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff1179000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff0f57000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff0c4c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff09ff000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff075b000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff051f000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcff02ce000) => /lib/x86_64-linux-gnu/ (0x00007fcfeffc5000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfefdbf000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfefbaf000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfef9ab000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfef671000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfef446000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfef219000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfef014000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfeedd7000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfeeba7000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfee995000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfee78f000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfee49e000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfee29b000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfee027000) => /lib/x86_64-linux-gnu/ (0x00007fcfedda6000) => /lib/x86_64-linux-gnu/ (0x00007fcfedb88000) => /lib/x86_64-linux-gnu/ (0x00007fcfed983000) => /lib/x86_64-linux-gnu/ (0x00007fcfed758000) => not found => /lib/x86_64-linux-gnu/ (0x00007fcfed513000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfed20e000) => /lib/x86_64-linux-gnu/ (0x00007fcfecf08000) => /lib/x86_64-linux-gnu/ (0x00007fcfeccf2000) => /lib/x86_64-linux-gnu/ (0x00007fcfec92c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfec70d000)
        /lib64/ (0x00007fcff7790000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfec509000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfec195000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfebf80000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfebd7c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfebb72000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfeb968000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfeb6be000) => /lib/x86_64-linux-gnu/ (0x00007fcfeb498000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfeb295000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfeb08b000) => /lib/x86_64-linux-gnu/ (0x00007fcfeae72000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfeac69000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfeaa60000) => /lib/x86_64-linux-gnu/ (0x00007fcfea822000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfea61d000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfea3f6000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfea1af000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe9ef1000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe9ce5000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe9ad3000) => /lib/x86_64-linux-gnu/ (0x00007fcfe98ce000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe96c9000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe94c3000) => /lib/x86_64-linux-gnu/ (0x00007fcfe92a0000) => /lib/x86_64-linux-gnu/ (0x00007fcfe9084000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe8e2f000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe8c27000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe895c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe872d000) => /lib/x86_64-linux-gnu/ (0x00007fcfe8528000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe831d000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe8109000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe7ec6000) => /usr/lib/x86_64-linux-gnu/ (0x00007fcfe7caa000) => /lib/x86_64-linux-gnu/ (0x00007fcfe7aa5000)

    It can't find, I have only 14.04 :(

  9. wborgsm

    Well, I wouldn't say it is functional. As far as I proceeded, the windowless example was kind of working: so far I could load a page and navigate from there. But the RPC layer that connects the render processes to the browser process is missing. The PipeFactory is not implemented for linux. I don't know, maybe the windows implementation with NamedPipeServerStream/NamedPipeClientStream works under mono/linux as well, maybe not.

    Besides that (which was the whole point of making a new c# binding for CEF), it shouldn't lack any features. And getting the pipes to work should be possible as well, it's just that I stopped working on it when I realized that there was an upstream issue preventing me from updating beyond branch 1750. This is far beyond anything I could solve or work around on my own.

  10. Andrius Bentkus

    Yeah, I read your comment about the 2xxx branch throwing exceptions. I just need whatever working version I can get on linux first, so I will take a look at the PipeFactory if the windowless thing runs on 12.04 with the 1750 branch.

    As for that exception, the original author didn't solve it in 6 months, I doubt someone will step up for him.:

  11. wborgsm

    Yeah I forgot: I had to set up 12.04 exactly because of that libudev issue. Search the web for « chromium ubuntu» and you'll find a lot of discussion about this. I think this was fixed in newer releases of chromium and CEF, but since I can't update from 1750, that doesn't help for the time being.

  12. Andrius Bentkus

    I got the Windowless example running on 2357.3, though it produces this strange window: (note that I copied only the content of the window).

    If I click on credits it throws a segmentation fault with:

    $ LD_PRELOAD=/home/bentkus/Projects/mono/chromiumfx/ mono Windowless.exe 
    [0803/] Running without the SUID sandbox! See for more information on developing with the sandbox on.
    Unknown command line option: '--type=zygote'
    [0803/] Cannot use V8 Proxy resolver in single process mode.
    [0803/] [GroupMarkerNotSet(!:D04E76EE22290000]GL ERROR :GL_INVALID_OPERATION : glTexStorage2DEXT: <- error from previous GL command
    Exception thrown during bootstrapping
    Extension or internal compilation error in native runtime.js at line 2.
    Exception thrown during bootstrapping
    Extension or internal compilation error in native runtime.js at line 2.
    Segmentation fault (core dumped)

    I don't really understand why the window pops up, I have to investigate the code first.

  13. Andrius Bentkus

    Ok, I get what you are doing in the windowless example, you create a win32 window, send all the mouse events to libcef and take the drawing buffer from libcef and use it to draw on the window.

  14. wborgsm

    That window is the built-in page for chrome://version/ and the windowless example loads it by default, that's not the problem. But from there, it should bring up the built-in credits page not seg fault when clicking the link.

  15. wborgsm

    Yes basically that's it, it was just a first approach to see something whatsoever at linux. Now since the LD_PRELOAD seems to do the trick, I think I am going to merge the linux solution back into the default branch and go from there as soon as I get some time for it.

    Your help is very appreciated, before trying to port this project I didn't touch linux for years... and back then, I used to run linux servers without a desktop, so I am a bit out of my field here :(

  16. Andrius Bentkus

    The segmentation faults are mainly because "[0803/] Cannot use V8 Proxy resolver in single process mode.", my own site worked fine, I have to investigate what the V8 Proxy actually does, because it getsx triggered on more complicated sites.

  17. wborgsm

    "single process mode" - I think I had it run in single process (CfxSettings.SingleProcess) mode to avoid the spawning of secondary processes for gpu and renderer. Maybe you can go multiprocess by creating a stub script which does LD_PRELOAD and launches mono and point to that in CfxSettings.BrowserSubprocessPath. The stub will have to pass in all the command line as well.

  18. Andrius Bentkus

    Ok, I have found the error. I used the debug version of natives_blob.bin and snapshot_blob.bin while using the release version of It is working fine now with all websites.

    Stupid me.

    I still find it though seriously freaking strange that it tries to read all the resource files out of /usr/bin/ instead of the local directory where it is executed, i need to copy ffmpegsumo and the bin, pak files to /usr/bin...

  19. wborgsm

    In windows it loads them from the app executable directory by default. Can you change that behavior by explicitly setting CfxSettings.LocalesDirPath and CfxSettings.ResourcesDirPath?

    Note that icudtl.dat is special, it must be where cef looks for executable rather than for resources.

  20. wborgsm

    There is a workable prototype now at revision 37b5c03.

    In order to get this to work, I added a launcher script (linux/windowless) which sets LD_PRELOAD and LD_LIBRARY_PATH and then starts mono.

    Pointing to that launcher in settings.BrowserSubprocessPath enabled multi process execution as well.

    The test app is configured to look up CEF files in cef/Release64 and cef/Resources. Exception: icudtl.dat, snapshot_blob.bin and natives_blob.bin still must be copied to /usr/bin. That is not good and should be fixed. I guess this happens because those files are hard coded to be loaded from the directory where the executable resides, and the executable is /usr/bin/mono.

  21. daveexmachina

    Hi, I followed all these steps and was able to load libraries and assemblies. Now when I try to run "mono Windowless.exe" from shell, I get an error:

    [0902/] Check failed: base::allocator::IsAllocatorInitialized(). 
    #0 0x7f386b5348de base::debug::StackTrace::StackTrace()
    #1 0x7f386b548d1b logging::LogMessage::~LogMessage()
    #2 0x7f386e593076 content::ContentMainRunnerImpl::Initialize()
    #3 0x7f386b44268f CefContext::Initialize()
    #4 0x7f386b44248b CefInitialize()
    #5 0x7f386b3e7c56 cef_initialize
    #6 0x7f38604dbbb3 cfx_initialize
    #7 0x00004178f21b <unknown>

    How can I solve this?

  22. Germanunkol

    I had this issue yesterday and got rid of it somehow - I believe it was by preloading Have you tried running the "windowless" script instead of the Windowless.exe (assuming you're on Linux?). It preloads the libcef and then starts the Windowless.exe.

  23. daveexmachina

    Ah, thank you very much! I was able to display the page, even though I can't type anything, I can navigate through credits and if I press ctrl+g Google starts. Now for the hard part, have to import on Unity3D

  24. Germanunkol

    I'm trying to do the same, maybe we can join forces :)? I can also compile the Windowless example (on Linux / MonoDevelop) and display the page (I can type, too :)).

    I'm currently stuck on the fact that Unity seems to need the ChromiumFX compiled for Mono / .NET 3.5. On Linux, it seems that I can't have Mono 3.5 and 4.5 installed at the same time. So I tried it on windows, but there, I'm having troubles compiling both with MonoDevelop and with VS (don't remember the exact issues right now and I'm on Linux atm so I can't check).

    I don't want to further hijack this thread, but if you want, feel free to contact me: germanunkol[at], or we could open a new issue for Unity3D integration?

  25. azraelrabbit

    i have make the current default branch working on linux with mono.

    But ChromiumWebBrowser.cs still does not support fcitx / ibus input method, it seems that the CEF framework bug. here:

    And The WindowLess.cs can run correct in linux with mono for now,and input method support normally.

    While modifying part of the code, so that can be compiled with linux with monodevelop 5.10.

    and merged some code from pull request :

    And i created new solution file : ChromiumFX-Mono.sln to support monodevelop. and the origin solution on windows still run normal.

    my fork:


    1. i just run correct in linux mint 17/18 x64 and ubuntu 16.04 x64 , other linux distributions are not tested.

    2. to compile in linux ,you must be use monodevelop 5.10,not 6.x or above, because since 6.x the monodevelop does not support c/c++ projects.

    3. sorry for my english is not very good.

    For Chinese:

    我从Default 分支 Fork ( 最新的代码,

    合并了部分代码从 pull request :

    修改部分平台适配代码,目前能正常运行在 linux下,并且可通过monodevelop 编译.

    但ChromiumWebBrowser.cs目前不支持任何输入法,测试过了fcitx.貌似是 CEF 源框架的bug,参见:

    另外 WindowLess.cs 调整部分代码后,也可正常运行在 linux 和mono 环境下,输入法支持也正常.

    为了从monodevelop 打开解决方案,我创建了新的解决方案: ChromiumFx-Mono.sln, 不会影响原解决方案在windows下的编译和使用.


    1. 我只在 linux mint 17/18 x64 和 Ubuntu 16.04 x64 下测试通过,其他 linux 发行版未测试.

    2. 在Linux 下,只能使用 monodevelop 5.10 打开并编译libcfx 工程,因为从 6.x 起,monodevelop 不再支持 c/c++工程的打开和编译.

  26. Log in to comment