![]() |
|
Wine Blockland server guide for Linux VPS (Debian) - Printable Version +- Blockland Fan Forums (https://forum.bcs.place) +-- Forum: Blockland Forums (https://forum.bcs.place/forumdisplay.php?fid=1) +--- Forum: Tools and Resources (https://forum.bcs.place/forumdisplay.php?fid=3) +--- Thread: Wine Blockland server guide for Linux VPS (Debian) (/showthread.php?tid=89) |
Wine Blockland server guide for Linux VPS (Debian) - Queuenard - 05-09-2026 https://codeberg.org/Queuenard/blockland-wine-vps-dedi-server Update June 24, 2026: Added method for distribution-default Wine and now works with all versions of Wine I wrote this so that there's a current guide for running dedicated Blockland servers on a Linux VPS. New Wine versions have been a nightmare since they keep indirectly removing features that dedi servers require. I can't explain everything about managing Linux servers but I can hopefully help people who just need to know how we currently deal with Wine. I also made the script so that multiple Wine versions can be easily swapped. Goals
Assumptions
Current Wine problems
RE: Wine Blockland server guide for Linux VPS (Debian) - Queuenard - 05-25-2026 Major breakthrough. By changing the Blockland executable's subsystem from 2 to 3 (IMAGE_SUBSYSTEM_WINDOWS_GUI -> IMAGE_SUBSYSTEM_WINDOWS_CUI) Wine can then correctly handle console input and output as a normal console application. The requirements of having xvfb and WineFix.dll would be dropped. The Torque executable is compiled with the WINDOWS_GUI subsystem flag (which is meant for applications that spawn windows on the desktop) but spawns its own console window. It's probably a miracle the console even worked in some older versions of Wine. Converting an executable can be done in 10 lines of Python with python3-pefile installed. I also assigned MajorSubsystemVersion to 4 because that's what console applications appear to use. Code: import pefileA full solution needs some time to finish. Credit to Trigun for mentioning subsystem designations which proved to be the key to fixing the problem. Resources used https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#windows-subsystem https://www.devever.net/~hl/win32con https://stackoverflow.com/questions/493536/can-one-executable-be-both-a-console-and-gui-application/494000#494000 https://devblogs.microsoft.com/oldnewthing/20090101-00/?p=19643 RE: Wine Blockland server guide for Linux VPS (Debian) - Queuenard - 05-27-2026 The bash method to patch the EXE to a IMAGE_SUBSYSTEM_WINDOWS_CUI executable is this: Code: PatchedExe="Blockland.patched.exe";If you use the script from this thread, you can insert the above code in the startup script and transparently map the patched EXE into the bwrap namespace using the normal EXE name: Code: --ro-bind $server_location/Blockland.exe /home/user/$server/Blockland.exe \Code: --ro-bind $server_location/$PatchedExe /home/user/$server/Blockland.exe \Remember to remove xvfb-run and WineFix.dll. The guide needs a rewrite since Wine 11 is now the minimum version and several other requirements have disappeared. The distro-supplied Wine versions are now usable as well and this will require a new method. RE: Wine Blockland server guide for Linux VPS (Debian) - Queuenard - 06-13-2026 (05-27-2026, 03:35 AM)Queuenard Wrote: The bash method to patch the EXE to a IMAGE_SUBSYSTEM_WINDOWS_CUI executable is this: This requires a switch of shell from /bin/sh to /bin/bash, which I will address when I update the script. /bin/sh (defaults to /bin/dash shell on Debian) does not support hex escape characters as used in those printf calls, only octal, because I don't fucking know why. The good news is that I immediately learned about dash's limitation when I was first constructing the statement. The bad news is that I forgot to switch shells in my script when finally testing on my VPS, so I wasted hours trying to figure out how the environments were so different, culminating in me compiling Wine from source and adding a few debug trace statements. I found out the image (EXE) wasn't being loaded as IMAGE_SUBSYSTEM_WINDOWS_CUI, making me realize the patch wasn't being applied correctly because I wasn't using the correct shell. The good part of the bad news is that besides teaching me how to compile and edit Wine, it's clear that some parts of Wine (including the relevant dlls/ntdll/unix/env.c) are missing documentation of certain important behaviors and missing TRACE statements that would have exposed this behavior, so I can make a more complete bug report. when figure out how to fix a problem but forget to fix the problem
RE: Wine Blockland server guide for Linux VPS (Debian) - Queuenard - 06-30-2026 After the patch now in the script and some package installations, it now works with Wine 11 and presumably with any future versions of Wine. The script was also cleaned up so check the entire commit for details. There is a new method 1 (original method 1 and 2 moved to 2 and 3) Wine setup - Method 1 (RECOMMENDED): Distribution Wine (use wine from the distribution's package manager) Wine setup - Method 2: Repository Wine (use official winehq repositories with the package manager) Wine setup - Method 3: Extracted Wine (download and extract packages from winehq) RE: Wine Blockland server guide for Linux VPS (Debian) - Pecon - 07-01-2026 New patch and run method works swimmingly for wine 11. Great work here RE: Wine Blockland server guide for Linux VPS (Debian) - Bristem - 07-17-2026 Fantastic!! Also the script linked in the page doesnt actually match the guide! It defaults to method 3 instead of 1. Also assumes you have a modules folder and RedBlocklandLoader RE: Wine Blockland server guide for Linux VPS (Debian) - Queuenard - 08-10-2026 (07-17-2026, 11:59 PM)Bristem Wrote: Fantastic!! https://codeberg.org/Queuenard/blockland-wine-vps-dedi-server/commit/df6fb22f2f4ed7d66b2310bccf85665e07f8b009
|