![]() |
|
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 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 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
|