Wine on Windows 10. It works

Wine is a program for running Windows applications on computers running Unix.



Launching Wine on Windows has been a dream come true for fans who follow the call of the heart β€œWe do what we must, because we don’t have to do it”, at least since 2004, when someone tried to compile Wine in Cygwin and broke the host registry system .



Justification: "But what about old applications that do not work properly in recent Windows?" But we understand that the true reason is "I suffered for a long time for my art, now it's your turn."



At the end of 2008 I was overcome by an obsession - and I (it seems, it was me) created the WineOnWindows page on the Wine wiki. In short: this was not possible at all, since everything worked through Cygwin, MinGW, or Windows Services for Unix. The current page is not much more successful.



Windows 10 introduced the Windows subsystem for Linux, and Ubuntu is conveniently downloaded from the Microsoft Store. As a result, our stupid idea is realized almost by itself, unless you need to manually set the DISPLAY environment variable.



Until now, it is breathtakingly useless. Wine works only with 64-bit Windows applications, that is, not even with all the applications that come with Windows 10 itself.



(The initial project started after someone was unable to run Encarta 97 on Windows 10. Thus, like any real geeky solution, it does not really solve the user's original problem).



But I want to emphasize once again: now it works trivially . I'm not some kind of crazy genius who realized a fantastic project - I just seem to be the first to publicly announce this fact.



How to do this stupid thing



1. You have 64-bit Windows 10, right? This is the only version with WSL.



2. Install WSL. Control Panel -> Applications -> Programs and Features -> Turn Windows Features on or off. Check the box "Windows Subsystem for Linux". Restart Windows.



3. Go to the Microsoft Store, install Ubuntu (basically, WSL was created to launch it). I installed Ubuntu 18.04 LTS. Open Ubuntu and you will see the bash terminal.



4. Install the following from the bash command line:



sudo dpkg --add-architecture i386 sudo apt update; sudo apt upgrade sudo apt install wine-stable
      
      





You can install a more current version of Wine if you want to fool around (do not forget about the two new libraries that are needed for wine-devel> = 4.5 and which are not yet included in Ubuntu!). Let me know if this works.



5. Add the following line to your .bashrc



:



 export DISPLAY=:0.0
      
      





You probably want to run this in the current bash window as well.



6. Install VcXsrv , a beautifully packaged version of xorg compiled for Windows - just grab the latest executable and run it. Launch X Server through the Start button and XLaunch. He will guide you through defaults - leave most of them as they are. Just in case, I checked the "Disable access control". Save the configuration.



6a. If you want to verify that the X server is configured correctly, install sudo apt install x11-apps



and run xeyes



for a brief trip back to the 80-90s.



7. wine



itself does not work, because 32-bit binaries do not start in WSL . On our 64-bit Windows 10, the error /usr/bin/wine: 40: exec: /usr/lib/wine/wine: Exec format error



. Apparently, this was fixed in WSL 2 .



In the meantime, run Notepad in Wine!



  wine64 /usr/lib/x86_64-linux-gnu/wine/fakedlls/notepad.exe 






TO DO: 32-bit support. We'll have to wait for the release of WSL 2 . I wonder if the ancient Win16 programs will work - in theory, they should run in Wine, even if they no longer work in Windows itself.



32-bit applications through qemu



Thanks to an anonymous commentator who suggested how to approach the launch of 32-bit applications.



  sudo apt install qemu-user-static
 sudo update-binfmts --install i386 / usr / bin / qemu-i386-static --magic '\ x7fELF \ x01 \ x01 \ x01 \ x03 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x03 \ x00 \ x03 \ x00 \ x01 \ x00 \ x00 \ x00 '--mask' \ xff \ xff \ xff \ xff \ xff \ xff \ xff \ xfc \ xff \ xff \ xff \ xff \ xff \ xff \ xff \ xff \ xf8 \ xff \ xff \ xff \ xff \ xff \ xff \ xff '
 sudo service binfmt-support start 




And now we can do:



  fun @ DESKTOP-7F6DU8P: ~ $ wine --version
 wine-3.0 (Ubuntu 3.0-1ubuntu1) 


However, Encarta 97 still does not work:



  fun @ DESKTOP-7F6DU8P: / mnt / e $ wine SETUP.EXE
 wine: Unhandled page fault on read access to 0xffffffff at address 0x11df: 0x00002c11 (thread 0011), starting debugger ...
 0011: err: seh: start_debugger Couldn't start debugger ("winedbg --auto 15 108") (2)
 Read the Wine Developers Guide on how to set up winedbg or another debugger 


For those in the topic: file



says SETUP.EXE: MS-DOS executable, NE for MS Windows 3.x



, so we need to go down to the rare 16-bit programs.



Encarta 97 installs and works flawlessly in Wine 4.13 on Linux ... but still not in 4.13 on Windows 10:



  fun @ DESKTOP-7F6DU8P: ~ $ wine /mnt/e/SETUP.EXE
 Xlib: extension "MIT-SHM" missing on display ": 0.0".
 Xlib: extension "MIT-SHM" missing on display ": 0.0".
 0009: err: process: __ wine_kernel_init boot event wait timed out
 001d: err: process: __ wine_kernel_init boot event wait timed out
 wine: Unhandled page fault on read access to 0xffffffff at address 0x11cf: 0x00002c11 (thread 001e), starting debugger ... 001e: err: seh: start_debugger Couldn't start debugger ("winedbg --auto 28 152") (2)
 Read the Wine Developers Guide on how to set up winedbg or another debugger
 001d: err: ntdll: RtlpWaitForCriticalSection section 0x7e6273e0 "syslevel.c: Win16Mutex" wait timed out in thread 001d, blocked by 001e, retrying (60 sec)
 Xlib: extension "MIT-SHM" missing on display ": 0.0".
 Could not load wine-gecko.  HTML rendering will be disabled.
 001e: err: seh: raise_exception Unhandled exception code c0000005 flags 0 addr 0x7b4a6abc
 wine client error: 1e: write: Bad file descriptor 


Of course, it gives out different error messages in several starts ...



All Articles