About
This is a solution for using containers to run WeChat under a Linux system.
- Container operating environment: Docker, Wine, LXDE, xRDP
- LXDE: A lightweight desktop environment. WeChat can only be installed and run under the graphical interface.
- xRDP: Used to remotely connect to the desktop from
Windows
for configuration.
- Deployed based on WeChatFerry, thanks to lich0821
- Resource usage:
- disk:
- The image size after construction is approximately 4.69G;
- When Wine is started for the first time, the container occupies 1.49G after automatic initialization;
- After WeChat is installed, the initial state occupies 1.41G. The default configuration has placed these files in the host's mounting directory;
- If WeChat is used for a long time, the disk usage will continue to increase;
- Memory:
- After logging in to the desktop, the total occupied space is 194M;
- When WeChat is started, the total usage is about 1.7G. After WeChat is logged in, the total usage is about 4.9G . The host needs to reserve sufficient memory space;
Usage
Get resources
Download the installation package WeChatSetup
and tool package v??.?.?.zip
from the WeChatFerry release page and put them in the project directory ./package
.
WeChatFerry iterates frequently, and the latest version is
Build image
$ sudo ./docker/docker_build.sh
- By default,
root
is used as the xRDP user, and the default password is 123
Please modify it as needed.
boot image
$ sudo ./docker/docker_run.sh
The default container access configuration of the startup script,宿主机
=>容器
relationship is as follows, please adjust as needed:
- Port mapping:
- xRDP port:
13389
=> 3389
- WeChatFerry command port:
18001
=> 8001
- WeChatFerry message port:
18002
=> 8002
- Directory mounting:
- Installation information:
./package
=> /root/package
(only used when installing WeChat for the first time) - Program file:
./wechat/program
=> /root/.wine/drive_c/Program Files/Tencent/WeChat
- Icon file:
./wechat/share/icons
=> /root/.local/share/icons
- User data:
./wechat/user_dat
=> /root/.wine/drive_c/users/root/AppData/Roaming/Tencent/WeChat
- Mount the program and user data directories to the host to avoid installing programs again after the container is reset .
Log in to desktop
-
Windows
starts远程桌面连接
, address :服务器IP:13389
- Enter the xRDP login window, username :
root
, password : 123
Install WeChat
- If the mounting directory has been configured and WeChat has been installed, you do not need to install it again.
- Go to the desktop and start the installer. There are 2 startup methods:
- Desktop shortcut startup: Open the desktop icon
WeChatSetup
- Command line startup: Start the terminal
LXTerminal
in the lower left corner and execute: $ wine package/WeChatSetup- * .exe
- Start the normal installation process and close after completing the installation.
Start WeChat
- Go to the desktop and start the application. There are 2 ways to start:
- Desktop shortcut startup: Open the desktop icon
WeChatFerry
- Command line startup: Start the terminal
LXTerminal
in the lower left corner and execute: The terminal cannot be closed or exited after starting.
- WeChat general configuration, Settings in the lower left corner:
- Notifications: Close all
- General -> General: Do not select all
- Manage Files -> Auto-Download: Uncheck
- After starting and logging in, close the remote desktop directly without
Logout
. Because all programs running under the graphical interface will exit after logging out.
test
Run the test script on the host: ./test/test_wcferry.py
. The message is sent to文件传输助手
by default.
FAQ
Release Notes
- The version number is basically the same as that of WeChatFerry for easy comparison.
-
tag: v39.2
: Support WeChatFerry tag: v39.2.x
and above
Running error
- Fault phenomenon:
- Different environmental phenomena are different. Currently, we encounter the following types:
- Wine reports an error during startup and exits
- Wine starts and immediately reports an error and exits
- xRDP connection error
- Failure analysis:
- The current abnormal startup situation is common in servers using old distribution systems, such as CentOS 7 (kernel 4.x).
- It has been verified that servers using newer distribution systems can run normally. Such as: Fedora 39/40 (kernel 6.x)
- The specific reason is not yet clear, but it is speculated to be related to the kernel version.
- Solution:
- It is recommended to use a newer Linux distribution.
Crash or application black screen
- Fault phenomenon:
- Exit immediately after application startup
- The application interface is dark, but you can click and drag it, and you can see the application interface during the dragging process.
- Failure analysis:
- It was running normally before the fault occurred.
- Currently only encountered in the debugging stage.
- During debugging, certain operations may accidentally kill the system service process.
- Solution:
- Close and delete the container and restart the image