Discussion of article "MetaTrader 5 on Linux" - page 38

Miguel Angel Vico Alba #:
The number of reports may indicate that the problem is genuine and affects several users, but this in itself does not prove that it is widespread or that it affects the majority of Ubuntu users.
All Ubuntu users are telling you that WebView is unworkable in Wine for the Store and the AI Assistant to run properly without freezing, bugs or keyboard layout issues, Karl!

The instructions on your official website for downloading MT5 are outdated and don’t work at all. That’s why we’re looking for workarounds to install MT5 using other emulators and methods. Yet you keep insisting that this doesn’t affect the majority of Ubuntu users… just like it doesn’t affect Mac users :)) It’s exactly the same problem there. Following your instructions on how to install the AI Assistant on a Mac platform or any broker’s DMG file (using the Wine emulator as a workaround) doesn’t provide a fully functional WebView2… that’s ridiculous. It’s absolutely laughable. Next you’ll be saying this isn’t a problem because the vast majority should be on Windows. The level of your reasoning is simply endearing

There are solutions – you need to start a new thread or discuss here what actually works on Ubuntu, and package it into a working installer that includes MT5 – either pre-installed or deliverable – with the correct hardcoded Wine settings, dependencies and components, rather than providing a SH file that stops working and broken repositoriesand broken ones. You did this for the macOS DMG for brokerage software, where MT5 and Wine were already hardcoded inside. But I’ll say it again: there’s the same issue with WebView2 there – you haven’t resolved it. Just as MyFXBook claimed that their robot and DLL wouldn’t work in Wine – although I found a way round it; there were four components missing:
winetricks remove_mono
winetricks dotnet48 vcrun2015 vcrun2019 corefonts gdiplus

And myfxbookEA now works on both macOS and Linux
Alain Verleyen #:

If you use Bottles, you do so at your own risk.

I’m not aware of any official mt5ubuntu.sh installer – where did you find it? The official installer for Linux is mt5linux.sh from this article : https://www.mql5.com/en/articles/625

Wine 10.0 is not supported by MetaQuotes; you need to use version 11.x (excluding 11.0).

I’m running Ubuntu 26.04 and MT5; I’ll test the AI Assistant and let you know the results.

wget https://download.terminal.free/cdn/web/metaquotes.software.corp/mt5/mt5linux.sh; chmod +x mt5linux.sh ; ./mt5linux.sh – well, there you go, a MetaQuotes script
Alex FXPIP #:
The WebView2/Wine problem is real; nobody denied that. What you have not demonstrated is that all Ubuntu users are affected, or even the majority. Several reports show that several users have the problem. They do not prove universal failure. The same goes for saying the official instructions "don't work at all".

You are also putting words in my mouth. I never said the problem was irrelevant, that Linux users should move to Windows, or that MetaQuotes should ignore it. I only said that the reports in this thread do not prove that most Ubuntu users are affected. And no, adding "Karl!" does not make that leap in logic any stronger.

As for Alain: he clearly said the official script is mt5linux.sh, not mt5ubuntu.sh. You then posted mt5linux.sh and said "there you go, a MetaQuotes script". Yes, Karl...that is exactly what Alain had just told you.
Miguel Angel Vico Alba #:
The problem with WebView2/Wine does indeed exist; no one has denied this. But you have not proven that it affects all Ubuntu users, or even the majority of them. Several reports indicate that some users have encountered this problem. However, they do not prove that the issue is widespread. The same applies to the claim that the official instructions ‘do not work at all’.

Furthermore, you are putting words in my mouth that I did not say. I never said that the issue is unimportant, that Linux users should switch to Windows, or that MetaQuotes should ignore it. I merely said that the posts in this thread do not prove that the issue affects the majority of Ubuntu users. And no, adding the word ‘Karl!’ does not make this logical leap any more convincing.

As for Alain: he clearly stated that the official script is mt5linux.sh, not mt5ubuntu.sh. You then posted mt5linux.sh and said: ‘Here you go, the script from MetaQuotes’. Yes, Karl… that’s exactly what Alan has just told you.

1) I think you need to make a video showing how you install MT5 on Ubuntu following MetaQuotes’ instructions… even if it works, record a video of you opening the Market and the AI Assistant in MT5 on Ubuntu, and how it runs poorly and freezes with crashes…

2) And you’ll have personal proof that the problem is widespread and affects all Linux users.

3) Stop twisting my words – I wasn’t talking specifically about you; I was referring to the official responses from representatives on this forum. I don’t know whether you’re one of them or not. If you are one of them, then this is addressed to you too

4) Send the video to the support team; that way, you’ll also understand what the problem is and how to solve it

5) mt5linux.sh doesn’t work; the repository specified there is broken, and before installing it on a clean Linux system, you need to install a whole lot of other things as well... Ultimately, it doesn’t work, and you’ll need to spend half an hour using standard Wine to figure out for yourself how to get MT5 running on Linux

6) Web-based trading is unworkable on Linux and macOS.

7) P.S. Why bother with the web version in the first place if the platform is positioned for emulators?

As for macOS 27, I checked the latest PKG from MetaQuotes:
1) The AI assistant worked perfectly when called up directly in MT5 via the button

2) However, in MetaEditor, error 2026.09.29 03:17:35.602 still occurs: WebView2 could not find WebView2 Runtime


And there’s an error with the Editor as well

Even the Market works


What I’m getting at is – perhaps you could also build a package for Linux with the same correct dependencies?


To add to the above, on macOS, WebView will only work in the terminal or only in the Editor – depending on which one was launched first. I’m trying to fix


macOS (MetaTrader 5.app), build 6230: The AI assistant in MetaEditor says ‘couldn’t find WebView2 Runtime’. I’ve found the cause and a workaround. I used the official macOS pkg from MetaQuotes

Environment: MetaTrader 5 x64 build 6230, official MetaTrader 5.app, Wine 11.1, macOS (Darwin 27.0), Apple Silicon. The Terminal is launched from /portable, MetaEditor from /portable/language:English.

Symptom: The Assistant and Market work in the terminal. The Assistant does not open in MetaEditor; the log shows:

WebView2 could not find WebView2 Runtime


What was found.

  1. The installer places the fixed version of WebView2 (109.0.1518.78) in C :\Program Files\WebView2, but does not register it as Evergreen: the registry key EdgeUpdate \Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5} is missing from the registry. The terminal locates this runtime, whilst MetaEditor, it seems, searches for the installed Evergreen version and cannot find it.
  2. I set the path to the runtime for MetaEditor via the policy HKLM \SOFTWARE\Policies\Microsoft\Edge\WebView2\BrowserExecutableFolder, with the value metaeditor64 .exe = C :\Program Files\WebView2. After that, the assistant in the editor started working, but a second problem arose.
  3. Only the programme that first opened WebView2 works. If the terminal was opened first, an error occurs in the editor. If the editor was opened first, an error occurs in the terminal. The logs confirm this, and the issue occurs consistently.
  4. The reason is that terminal64 .exe and MetaEditor64 .exe use the same WebView2 data folder: C :\Program Files\MetaTrader 5\temp\EBWebView . According to WebView2 rules, the second process cannot create an environment in a folder that is already in use if its parameters differ. They do not differ in terms of the path to the runtime: I set the same `BrowserExecutableFolder` for both, and the conflict persisted. It is likely that the environment variables differ, for example the language (/language:English in the editor).

A workaround that works: run MetaEditor with a separate data folder via the WEBVIEW2_USER_DATA_FOLDER variable (Wine passes this from macOS to the Windows process):

export WINEPREFIX="$HOME/Library/Application Support/net.metaquotes.wine.metatrader5" export WEBVIEW2_USER_DATA_FOLDER='C:\Program Files\MetaTrader 5\temp\EBWebView-MetaEditor' "/Applications/MetaTrader 5.app/Contents/SharedSupport/wine/bin/wine" \ "C:\Program Files\MetaTrader 5\MetaEditor64.exe" /portable

So the assistant works simultaneously in both the terminal and the editor. However, if you open the editor via the IDE / F4 button from the terminal, the conflict reoccurs.

In my view, here’s how you can fix this:

  • assign MetaEditor its own WebView2 data folder, for example temp \EBWebView-ME , or create an environment with identical settings in both processes;
  • ensure that MetaEditor searches for the runtime in `C :\Program Files\WebView2` in the same way as the terminal, or ensure that the installer registers this runtime in the registry.
Установка в Mac OS - Для продвинутых пользователей - Начало работы - Справка по MetaTrader 5
Установка в Mac OS - Для продвинутых пользователей - Начало работы - Справка по MetaTrader 5
  • www.metatrader5.com
Мы подготовили специальный установщик торговой платформы для macOS. Это полноценный визард, позволяющий установить приложение как нативное. Он...

Linux update – webView2 and the AI assistant are working, though there are some freezes, and I had to write a script to fix the keyboard layout switching issue

MT5 build 6231 on Ubuntu 26.04 (Wine 11.18): The AI assistant is working; three issues and their solutions

System: Ubuntu 26.04.1, KDE Plasma 6.6.6 (Wayland and X11), Wine 11.18 staging (WineHQ),
Windows 11 prefix, MT5/MetaEditor build 6231, WebView2 Evergreen 154.0.4258.37.

1. `mt5linux.sh` does not support Ubuntu 26.04

For any Ubuntu version >= 25.10 , the script adds the WineHQ `questing` repository ; there are no branches for `resolute`
are missing. Furthermore, it removes `/etc/apt/sources.list.d/winehq*` without prompting and runs
`apt upgrade -y`.

Solution: I added the `resolute` repository manually, installed `winehq-staging`, and from the script
I only carried out the final steps: `winecfg -v=win11`, installation of WebView2 (`/silent /install`)
and `mt5setup.exe`.

Request: please add the `resolute` branch to the script and do not delete other people’s repository files.

2. The AI assistant is semi-transparent and freezes (in the terminal and in MetaEditor)

Reason: WebView2/Chromium GPU composition under Wine is not working correctly.

Solution: I disabled the GPU via the WebView2 policy, but only for MT5 processes:

```
for K in 'HKLM\SOFTWARE\Policies\Microsoft\Edge\WebView2\AdditionalBrowserArguments' \
'HKCU\Software\Policies\Microsoft\Edge\WebView2\AdditionalBrowserArguments'; do
wine reg add "$K" /v terminal64.exe /t REG_SZ /d '--disable-gpu --disable-gpu-compositing --disable-software-rasterizer' /f
wine reg add "$K" /v metaeditor64.exe /t REG_SZ /d '--disable-gpu --disable-gpu-compositing --disable-software-rasterizer' /f
done
```

After this, the assistant works. There is one cosmetic issue remaining: when the window is minimised, it
becomes semi-transparent for 1–2 seconds.

Request: please add a setting to the terminal to ‘Disable Assistant’s hardware acceleration’
or enable this automatically under Wine.

3. The RU/EN layout does not switch in the Assistant’s input field

In MetaEditor code and standard MT5 fields, the layout switches correctly, but not in the Assistant.

Reason (confirmed by Wine trace): the input field is handled by a separate process
`msedgewebview2.exe`, whilst Wine stores the current XKB layout separately in each process.
Only the terminal receives the layout change event; WebView2 remains on the layout
it was when it started. However, all processes can see changes to the entire layout table.

Solution: a small script intercepts the KDE signal for a layout change and, each time, sets
the current layout in the X server (`setxkbmap us` / `setxkbmap ru`). After that,
the layout switching works everywhere. The script is below.

This is a bug on Wine’s side; I’ll report it to WineHQ. However, it may be possible to integrate WebView2 in such a way
so that input goes through the terminal process, in which case the problem will disappear.

What already works without any modifications: the official WebView2 installer registers
the Evergreen runtime, and MetaEditor finds it automatically (on macOS with fixed version 109, I had to
set the path in the registry). The `ACP ai engine executable not found` error on first launch
resolves itself: LiveUpdate downloads `mt5onnx64`, after which MT5 needs to be restarted once
manually.

Keyboard layout synchronisation script (KDE Plasma) – `~/.local/bin/xwayland-layout-sync`,
add to KDE’s autostart:

```bash
#!/bin/bash
# Keeps the Xwayland/X11 keymap at a single layout matching the active KDE layout.
# Wine caches the XKB group per process, so WebView2 (a separate process) never sees
# group switches; a full keymap change (MappingNotify) affects every Wine process.
export DISPLAY="${DISPLAY:-:0}"

apply() {
local idx list layouts variants
idx=$(qdbus6 org.kde.keyboard /Layouts org.kde.KeyboardLayouts.getLayout 2>/dev/null) || return
list=$(qdbus6 --literal org.kde.keyboard /Layouts org.kde.KeyboardLayouts.getLayoutsList 2>/dev/null) || return
mapfile -t layouts < <(grep -oP '\(sss\) "\K[^"]*' <<<"$list")
mapfile -t variants < <(grep -oP '\(sss\) "[^"]*", "\K[^"]*' <<<"$list")
[ -n "${layouts[$idx]}" ] || return
if [ -n "${variants[$idx]}" ]; then
setxkbmap -layout "${layouts[$idx]}" -variant "${variants[$idx]}" 2>/dev/null
else
setxkbmap -layout "${layouts[$idx]}" 2>/dev/null
fi
}

apply
dbus-monitor --session "type='signal',interface='org.kde.KeyboardLayouts',member='layoutChanged'" 2>/dev/null |
while read -r line; do
[[ $line == *member=layoutChanged* ]] && apply
done
```

---

## Text for WineHQ Bugzilla (in English, if desired)

Summary: Keyboard layout (XKB group) switch not applied in cross-process child window (WebView2)

Component: winex11.drv - Version: 11.18 (staging)

Keyboard input typed into a WebView2 control (msedgewebview2.exe, a child window of another
process’s top-level window, as used by MetaTrader 5 build 6231) always uses the XKB group that
was active when msedgewebview2.exe started. Switching the layout (e.g. ru <-> us with multiple XKB
groups) works in the host process’s native controls but not in the WebView2 child.

Trace (`WINEDEBUG=+pid,+keyboard,+imm`): key events are processed in the msedgewebview2.exe
process with HKL 0x10001000; the XKB group change is only observed by the process owning the
focused X window. A full keymap change (`setxkbmap -layout us` / `ru`, MappingNotify) is picked
up by all processes, which is used as a workaround.

Environment: Ubuntu 26.04, KDE Plasma 6.6.6 (Wayland/Xwayland 24.1.10 and X11 session),
WebView2 Evergreen 154.0.4258.37.



P.S.: What a mess...

Miguel Angel Vico Alba #:
The issue with WebView2/Wine does indeed exist; no one has denied this. However, you have not proven that it affects all Ubuntu users, or even the majority of them. A few reports suggest that some users have encountered this problem. However, they do not prove that it is a widespread failure. The same applies to the claim that the official instructions ‘do not work at all’.

So, does the official guide for Linux actually work or not? Or should we make a video? Is the failure widespread or not? I wonder how many times it’ll take for people to get it

Miguel Angel Vico Alba #:
As for Alain: he clearly stated that the official script is mt5linux.sh, not mt5ubuntu.sh. You then posted mt5linux.sh and said: ‘Here you go, the script from MetaQuotes’. Yes, Karl… that’s exactly what Alain has just told you.

And what’s this:

Alex FXPIP #:
1. `mt5linux.sh` does not support Ubuntu 26.04

For any Ubuntu version >= 25.10 , the script adds the WineHQ `questing` repository and the branches for `resolute`
are not available. Furthermore, it deletes `/etc/apt/sources.list.d/winehq*` without prompting and executes
`apt upgrade -y`.

Solution: I added the `resolute` repository manually, installed `winehq-staging`, and from the script
I only carried out the final steps: `winecfg -v=win11`, and installed WebView2 (`/silent /install`)
and `mt5setup.exe`.

Request: please add the `resolute` branch to the script and do not delete files from other people’s repositories.

Read

Alex FXPIP #:

Well, if nothing else, all this back-and-forth has at least helped turn "it doesn’t work at all" into a properly documented, specific issue. 🙂