how to enable chinese input method in WSL using ibus and wslg?
I am running Ubuntu 25.04 on WSL2 with WSLg enabled on Windows 11. I have installed IBus and can configure it via the GUI panel, but I encounter several issues:
- When I try to use Chinese input (e.g., Pinyin or Wubi) in Linux GUI applications like
gedit
orFirefox
, the candidate window either flashes briefly and disappears, or I cannot switch input at all.
ibus restart
sometimes gives errors such as Wayland input-method protocol version 1 does not work with the forked application
and No global engine
.
I have tried setting environment variables (GTK_IM_MODULE=ibus
, QT_IM_MODULE=ibus
, XMODIFIERS=@im=ibus
, IBUS_USE_PORTAL=0
), but the issue persists.
If I force MOZ_ENABLE_WAYLAND=0
to run Firefox in X11 mode, it fails with Error: cannot open display: :0
.
I have considered using Fcitx5, but it often reports it is already running even when it is not, making it unreliable in WSLg.
What I want to achieve:
Fully functional Chinese input method (Pinyin/Wubi) in Linux GUI applications running under WSLg.
Stable candidate window and input switching, without conflicts or crashes.
Ideally, a solution that works for both X11 and Wayland GUI applications, but X11-only solution is acceptable if Wayland cannot be supported.
What I have tried:
Installing IBus and necessary packages (ibus
, ibus-gtk
, ibus-gtk3
, ibus-qt4
, ibus-libpinyin
, ibus-table
)
Setting environment variables in ~/.bashrc
Starting ibus-daemon -drx --panel disable
Testing with both lightweight editors (Leafpad) and heavier applications (Gedit, Firefox)
Attempting to use Fcitx5 but facing the “already running” problem
Question: What is the recommended way to enable a stable Chinese input method in WSL2 with WSLg using IBus (or Fcitx5 if better) for Linux GUI applications?I am running Ubuntu 25.04 on WSL2 with WSLg enabled on Windows 11. I have installed IBus and can configure it via the GUI panel, but I encounter several issues:
When I try to use Chinese input (e.g., Pinyin or Wubi) in Linux GUI applications like gedit
or Firefox
, the candidate window either flashes briefly and disappears, or I cannot switch input at all.
ibus restart
sometimes gives errors such as Wayland input-method protocol version 1 does not work with the forked application
and No global engine
.
I have tried setting environment variables (GTK_IM_MODULE=ibus
, QT_IM_MODULE=ibus
, XMODIFIERS=@im=ibus
, IBUS_USE_PORTAL=0
), but the issue persists.
If I force MOZ_ENABLE_WAYLAND=0
to run Firefox in X11 mode, it fails with Error: cannot open display: :0
.
I have considered using Fcitx5, but it often reports it is already running even when it is not, making it unreliable in WSLg.
What I want to achieve:
Fully functional Chinese input method (Pinyin/Wubi) in Linux GUI applications running under WSLg.
Stable candidate window and input switching, without conflicts or crashes.
Ideally, a solution that works for both X11 and Wayland GUI applications, but X11-only solution is acceptable if Wayland cannot be supported.
What I have tried:
Installing IBus and necessary packages (ibus
, ibus-gtk
, ibus-gtk3
, ibus-qt4
, ibus-libpinyin
, ibus-table
)
Setting environment variables in ~/.bashrc
Starting ibus-daemon -drx --panel disable
Testing with both lightweight editors (Leafpad) and heavier applications (Gedit, Firefox)
Attempting to use Fcitx5 but facing the “already running” problem
Question:
What is the recommended way to enable a stable Chinese input method in WSL2 with WSLg using IBus for Linux GUI applications?
The Error Reports I received:
weber@DESKTOP-L9N6UR0:~$ export GTK_IM_MODULE=ibus
weber@DESKTOP-L9N6UR0:~$ export QT_IM_MODULE=ibus
weber@DESKTOP-L9N6UR0:~$ export XMODIFIERS=@im=ibus
weber@DESKTOP-L9N6UR0:~$ source ~/.bashrc
weber@DESKTOP-L9N6UR0:~$ nano ~/.bashrc
weber@DESKTOP-L9N6UR0:~$ source ~/.bashrc
weber@DESKTOP-L9N6UR0:~$ firefox
xdg-settings: unknown desktop environment
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
weber@DESKTOP-L9N6UR0:~$ MOZ_ENABLE_WAYLAND=0 firefox
xdg-settings: unknown desktop environment
Error: cannot open display: :0
weber@DESKTOP-L9N6UR0:~$ nano ~/.profile
weber@DESKTOP-L9N6UR0:~$ ibus restart
Wayland input-method protocol version 1 does not work with the forked application.
weber@DESKTOP-L9N6UR0:~$
(ibus-ui-gtk3:5632): IBUS-CRITICAL **: 01:08:49.886: string_substring: assertion '(offset + len) <= string_length' failed
(ibus-ui-gtk3:5632): IBUS-CRITICAL **: 01:08:49.886: string_substring: assertion '(offset + len) <= string_length' failed
(ibus-ui-gtk3:5632): IBUS-WARNING **: 01:08:49.904: ibus_bus_call_sync: org.freedesktop.DBus.Properties.Get: GDBus.Error:org.freedesktop.DBus.Error.Failed: No global engine.
(ibus-ui-gtk3:5632): IBUS-WARNING **: 01:08:49.907: panel.vala:983: Please unset QT_IM_MODULE and GTK_IM_MODULE environment variables and 'ibus-daemon --panel disable' should be executed as a child process of ibus-ui-gtk3 component.
(ibus-ui-gtk3:5632): IBUS-WARNING **: 01:08:49.914: ibus_bus_call_sync: org.freedesktop.DBus.Properties.Get: GDBus.Error:org.freedesktop.DBus.Error.Failed: No global engine.
Gdk-Message: 01:08:49.939: Error 71 (Protocol error) dispatching to Wayland display.
^C
weber@DESKTOP-L9N6UR0:~$ export GTK_IM_MODULE=ibus
weber@DESKTOP-L9N6UR0:~$ export QT_IM_MODULE=ibus
weber@DESKTOP-L9N6UR0:~$ export XMODIFIERS=@im=ibus
weber@DESKTOP-L9N6UR0:~$ export IBUS_USE_PORTAL=0
weber@DESKTOP-L9N6UR0:~$ export MOZ_ENABLE_WAYLAND=0
weber@DESKTOP-L9N6UR0:~$ source ~/.bashrc
weber@DESKTOP-L9N6UR0:~$ ibus-daemon -drx --panel disable
weber@DESKTOP-L9N6UR0:~$ gedit
** (gedit:5763): WARNING **: 01:10:04.268: Could not load Peas repository: Typelib file for namespace 'Peas', version '1.0' not found
** (gedit:5763): WARNING **: 01:10:04.268: Could not load PeasGtk repository: Typelib file for namespace 'PeasGtk', version '1.0' not found
weber@DESKTOP-L9N6UR0:~$ gedit
** (gedit:6042): WARNING **: 01:14:32.643: Could not load Peas repository: Typelib file for namespace 'Peas', version '1.0' not found
** (gedit:6042): WARNING **: 01:14:32.643: Could not load PeasGtk repository: Typelib file for namespace 'PeasGtk', version '1.0' not found
weber@DESKTOP-L9N6UR0:~$ export GTK_IM_MODULE=ibus
export QT_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export IBUS_USE_PORTAL=0
export MOZ_ENABLE_WAYLAND=0
weber@DESKTOP-L9N6UR0:~$ source ~/.bashrc
weber@DESKTOP-L9N6UR0:~$ ibus-daemon -drx --panel disable
weber@DESKTOP-L9N6UR0:~$ sudo apt install leafpad -y
Package leafpad is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Error: Package 'leafpad' has no installation candidate
weber@DESKTOP-L9N6UR0:~$ sudo apt install leafpad -y
Package leafpad is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Error: Package 'leafpad' has no installation candidate
weber@DESKTOP-L9N6UR0:~$ sudo apt install leafpad
Package leafpad is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Error: Package 'leafpad' has no installation candidate
weber@DESKTOP-L9N6UR0:~$ gedit
** (gedit:6205): WARNING **: 01:16:20.127: Could not load Peas repository: Typelib file for namespace 'Peas', version '1.0' not found
** (gedit:6205): WARNING **: 01:16:20.127: Could not load PeasGtk repository: Typelib file for namespace 'PeasGtk', version '1.0' not found
In Addition:
i've tried to use fcitx5, however, it always fails the failure is the fcitx thinks itself has been started but actually not... so that's why i changed to ibus...
weber@DESKTOP-L9N6UR0:~$ fcitx5
I2025-08-24 01:50:35.065529 instance.cpp:1394] Override Enabled Addons: {}
I2025-08-24 01:50:35.065606 instance.cpp:1395] Override Disabled Addons: {}
I2025-08-24 01:50:35.068257 addonmanager.cpp:205] Loaded addon wayland
I2025-08-24 01:50:35.070169 xcbconnection.cpp:199] Connecting to X11 display, display name::0.
I2025-08-24 01:50:35.070335 xcbconnection.cpp:204] X11 display: :0 is xwayland.
I2025-08-24 01:50:35.070438 addonmanager.cpp:205] Loaded addon xcb
I2025-08-24 01:50:35.071281 addonmanager.cpp:205] Loaded addon quickphrase
I2025-08-24 01:50:35.071793 addonmanager.cpp:205] Loaded addon clipboard
I2025-08-24 01:50:35.071974 addonmanager.cpp:205] Loaded addon unicode
I2025-08-24 01:50:35.072102 addonmanager.cpp:205] Loaded addon imselector
I2025-08-24 01:50:35.074780 addonmanager.cpp:205] Loaded addon keyboard
I2025-08-24 01:50:35.074954 addonmanager.cpp:205] Loaded addon waylandim
I2025-08-24 01:50:35.075308 addonmanager.cpp:205] Loaded addon luaaddonloader
I2025-08-24 01:50:35.075905 addonmanager.cpp:205] Loaded addon pinyinhelper
I2025-08-24 01:50:35.076849 addonmanager.cpp:205] Loaded addon dbus
I2025-08-24 01:50:35.079768 addonmanager.cpp:205] Loaded addon fcitx4frontend
I2025-08-24 01:50:35.080339 addonmanager.cpp:205] Loaded addon imeapi
I2025-08-24 01:50:35.081117 addonmanager.cpp:205] Loaded addon ibusfrontend
E2025-08-24 01:50:35.081702 xim.cpp:165] Failed to open xim, retrying.
E2025-08-24 01:50:36.082424 xim.cpp:165] Failed to open xim, retrying.
E2025-08-24 01:50:37.082969 xim.cpp:165] Failed to open xim, retrying.
I2025-08-24 01:50:38.083208 addonmanager.cpp:205] Loaded addon xim
I2025-08-24 01:50:38.084383 addonmanager.cpp:205] Loaded addon dbusfrontend
I2025-08-24 01:50:38.106557 inputmethodmanager.cpp:209] Found 739 input method(s) in addon keyboard
I2025-08-24 01:50:38.116160 addonmanager.cpp:205] Loaded addon kimpanel
I2025-08-24 01:50:38.116417 addonmanager.cpp:205] Loaded addon virtualkeyboard
I2025-08-24 01:50:38.128447 classicui.cpp:88] Created classicui for x11 display::0
I2025-08-24 01:50:38.128494 classicui.cpp:109] Created classicui for wayland display:
I2025-08-24 01:50:38.128562 addonmanager.cpp:205] Loaded addon classicui
I2025-08-24 01:50:38.128912 addonmanager.cpp:205] Loaded addon notificationitem
I2025-08-24 01:50:38.129397 addonmanager.cpp:205] Loaded addon notifications
zwp_input_method_v1#10: error 0: permission to bind input_method denied
E2025-08-24 01:50:38.134407 waylandeventreader.cpp:129] Wayland connection got error: 71
I2025-08-24 01:50:38.134461 waylandmodule.cpp:360] Connection removed
I2025-08-24 01:50:38.138806 addonmanager.cpp:308] Unloading addon notifications
I2025-08-24 01:50:38.138871 addonmanager.cpp:308] Unloading addon notificationitem
I2025-08-24 01:50:38.138916 addonmanager.cpp:308] Unloading addon classicui
I2025-08-24 01:50:38.139715 addonmanager.cpp:308] Unloading addon virtualkeyboard
I2025-08-24 01:50:38.139765 addonmanager.cpp:308] Unloading addon kimpanel
I2025-08-24 01:50:38.139808 addonmanager.cpp:308] Unloading addon dbusfrontend
I2025-08-24 01:50:38.139850 addonmanager.cpp:308] Unloading addon xim
I2025-08-24 01:50:38.139969 addonmanager.cpp:308] Unloading addon ibusfrontend
I2025-08-24 01:50:38.140031 addonmanager.cpp:308] Unloading addon imeapi
I2025-08-24 01:50:38.140111 addonmanager.cpp:308] Unloading addon fcitx4frontend
I2025-08-24 01:50:38.140180 addonmanager.cpp:308] Unloading addon dbus
I2025-08-24 01:50:38.140236 addonmanager.cpp:308] Unloading addon pinyinhelper
I2025-08-24 01:50:38.140267 addonmanager.cpp:308] Unloading addon luaaddonloader
I2025-08-24 01:50:38.140289 addonmanager.cpp:308] Unloading addon waylandim
I2025-08-24 01:50:38.140330 addonmanager.cpp:308] Unloading addon keyboard
I2025-08-24 01:50:38.140437 addonmanager.cpp:308] Unloading addon imselector
I2025-08-24 01:50:38.140457 addonmanager.cpp:308] Unloading addon unicode
I2025-08-24 01:50:38.140478 addonmanager.cpp:308] Unloading addon clipboard
I2025-08-24 01:50:38.140500 addonmanager.cpp:308] Unloading addon quickphrase
I2025-08-24 01:50:38.140634 addonmanager.cpp:308] Unloading addon xcb
I2025-08-24 01:50:38.140787 addonmanager.cpp:308] Unloading addon wayland
Please! i know it may sound weird but i won't get i high GPA/score if i don't use Chinese😭😭😭
Windows for home | Windows 11 | Input and language
1 answer
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more