Play MJ4 (Mahjong game) on Linux Mint 20

When I tried to run MJ4 with Wine on Linux Mint20, I couldn't do it at all, so I will describe how to deal with it.

What is MJ4?

SEGA Mahjong Game There are smartphone apps, Windows apps, and arcade versions, but there is no Linux version.

What I tried to do

Runs on Wine on Linux Mint 20 ⇛ When playing a game, the app crashes a little ⇛NG

Put Ubuntu on VirtualBox and run it on Wine ⇛ The drawing on the screen is heavy. It's a pain to start up in the first place ⇛NG

Put Wine in Ubuntu on Docker and run ⇛ No problem

Therefore, enjoy MJ4 by putting Wine in Ubuntu on Docker and executing it.

Procedure to execution

Overview

  1. Create an Ubuntu Docker image that can launch GUI apps from commands
  2. Create a Docker image with Wine installed above
  3. Create a Docker image with dotnet35sp installed above
  4. Create a Docker container with MJ4 installed above

Details

Create an Ubuntu Docker image that can launch GUI apps from commands

Create an image based on the Dockerfile below

FROM ubuntu

# ***********************************************
# install packages for xrdp, and do setting
# ***********************************************
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y \
        language-pack-ja bash-completion zenity x11-apps gnome-terminal

# ***********************************************
# setting skelton
# ***********************************************
RUN mkdir -p /etc/skel/Desktop \
    /etc/skel/Downloads \
    /etc/skel/Templates \
    /etc/skel/Public \
    /etc/skel/Documents \
    /etc/skel/Music \
    /etc/skel/Pictures \
    /etc/skel/Videos

# ***********************************************
# set local
# ***********************************************
RUN update-locale LANG=ja_JP.UTF-8

# ***********************************************
# setting keyboard layout
# ***********************************************
RUN { \
      echo 'XKBMODEL="pc105"'; \
      echo 'XKBLAYOUT="jp""'; \
      echo 'XKBVARIANT=""'; \
      echo 'XKBOPTIONS=""'; \
      echo ''; \
      echo 'BACKSPACE="guess"'; \
    } > /etc/default/keyboard

Here's what we're doing: ■ apt installation Introduction of Japanese package Introduced bash-completion so that input completion can be used in bash (this is not a setting for using MJ4, but simply easy to use) Introduced zenity so that GUI apps can be launched from commands The need is unknown, but x11-apps is introduced Introduced gnome-terminal so that commands can be launched from winetricks

■ Creating a template for the user's home folder

■ Japanese localization I'm not sure if it's working well in this regard

■ Japanese keyboard layout I'm not sure if it's working well in this regard

Creating an image file

Create an image with the following command The image name is sabocla6 / ubuntu_ui

sudo docker build ./ -t sabocla6/ubuntu_ui

Create a Docker image with Wine installed above

Create an image from the Dockerfile below.

FROM sabocla6/ubuntu_ui

# ***********************************************
# install wine
# ***********************************************
RUN dpkg --add-architecture i386
RUN apt-get -y autoclean
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
        curl wine-stable winetricks

I have installed curl to download the MJ4 setup program to install. Since it runs Wine, we have introduced wine-stable and winetricks.

Creating an image file

Create an image with the following command The image name is sabocla6 / tmp_wine

sudo docker build ./ -t sabocla6/tmp_wine

Create a Docker image with dotnet35sp

Based on this image, create a container image with dotnet35sp installed. This work can only be done from the GUI (I think), so create a container and execute it.

First, start the container.

sudo docker run -it --shm-size=2G --privileged --network host -e DISPLAY=$DISPLAY -v $HOME/.Xauthority:/root/.Xauthority sabocla6/tmp_wine

The GUI may not open during the work. In that case, restart the Docker container.

After the container starts, start winetricks and create a 32-bit Windows 10 WINEPREFIX. The name of WINEPREFIX is win32. After the creation is completed, restart the container once.

Introduced fake japanese ipamona with font After the installation is complete, restart the container again.

Install dotnet35sp1 on that WINE PREFIX. After the installation is complete, save the container as an image.

sudo docker commit [Container ID] sabocla6/wine

Create a Docker container with MJ4 installed

Create a container from sabocla6 / wine.

sudo docker run -it --shm-size=2G --privileged --network host -e DISPLAY=$DISPLAY -v $HOME/.Xauthority:/root/.Xauthority sabocla6/wine

Download the MJ4 installer with curl, launch the shell with the 32-bit version of WINEPREFIX created with winetricks, and Run the installer with wine. The installation destination has been changed to c: \ Program Files \ SEGA . (Isn't it translated into Japanese? The installation folder name is garbled)

Create a script called /root/start.sh with the following contents

#! /bin/bash

export COLORTERM=truecolor
export HOSTNAME=PortableMint
export HOME=/root
export WINEPREFIX=/root/.local/share/wineprefixes/win32
export WINE=wine
export W_PLATFORM=wine
cd /root/.local/share/wineprefixes/win32/drive_c/Program\ Files/SEGA/
wine MJ_Launcher.exe

Add writing to /root/.bashrc

/root/start.sh

When you restart the container, MJ4 will start up.

Recommended Posts

Play MJ4 (Mahjong game) on Linux Mint 20
Play with Turtle on Google Colab
[Latest version] Play YouTube videos on discord.py!
Play MJ4 (Mahjong game) on Linux Mint 20
Elixir = Comfortable on Linux Mint
Introducing Elixir on Linux Mint
Install CUDA on Linux Mint Mate 20
Linux Mint can't boot on ASUS X205TA
[Note] Install wxPython 3.x on Linux Mint (Ubuntu)
Daemonizing processes on Linux
Linux mint installation procedure
jblas on Arch Linux
Linux (WSL) on Windows
NAT router on Linux
Develop .NET on Linux
Wake on lan on Linux
Update vscode on linux
Try NeosVR on Linux
LiveUSB creation on Linux
Linux operation on Win10
Game distribution to YouTube Live on Arch Linux (Nintendo Switch)