Skip to content

Visual novels on FreeBSD

Visual novels are only Microsoft Windows programs, therefore you must use Wine in order to run them.

Follow the steps below to run VNs on FreeBSD.

Japanese and UTF-8 support

By default, FreeBSD is unable to display Japanese text.

Installing a Japanese font

Make sure you have a Japanese font before proceeding. I recommend the following fonts:
ja-font-ipa
ja-font-koruri
ja-font-sazanami
ja-font-kochi
ja-font-mplus-ipa
ja-font-vlgothic
hanazono-fonts-ttf

You can install them from binary package by doing:

sudo pkg install ja-font-ipa ja-font-koruri ja-font-sazanami ja-font-kochi ja-font-mplus-ipa ja-font-vlgothic hanazono-fonts-ttf
You can verify that your FreeBSD system is able to display Japanese text if you can see the Japanese text below:

てすとテスト試験

Enabling Unicode UTF-8

FreeBSD also does not use Unicode by default. So Japanese filenames will be broken. You need to add these lines to your /etc/login.conf

25
26
27
28
default:\
            [...]
            :charset=UTF-8:\
            :lang=en_US.UTF-8:
Now rebuild database for this file:

sudo cap_mkdb /etc/login.conf
Log out by using pkill -u $USER and log back in.

KDE5/SDDM

If you are using KDE, create a file called locale.sh in $HOME/.config/plasma-workspace/env/. If the directory doesn't exist then just make it. Add the following contents:

1
2
export LANG=en_US.UTF-8
export MM_CHARSET=UTF-8

Graphics Drivers

This is important as we will need hardware acceleration. If you haven't already installed graphics drivers on your FreeBSD system, please do that now.

[AMD/ATI Radeon and Intel Graphics]
[NVIDIA Graphics]

Installing Wine and dependencies

Tip

If you are having issues with the binary packages, try compiling from the ports.

Wine on FreeBSD has limited functionality compared to its Linux counterpart. For example, you are not able to use WOW64 (64 bit Windows but able to run 32-bit applications) and you also must use the i386-wine package of Wine if on an amd64 system. Do not be fooled by this name, if you are on a 32-bit system, use the regular wine package. However. lack of WOW64 support is not an issue for visual novels, as they are all 32-bit anyway.
First install all the needed dependencies for Wine first, this is to ensure you don't end up in "Wine dependency hell":

lib32

You need to have lib32 for this to work! Check if /usr/lib32 exists! If you did not get it when installing FreeBSD, get it now.
Get lib32.txz for your FreeBSD version [here]
Then run sudo tar -C / -xpf lib32.txz and then run sudo freebsd-update

sudo pkg install p7zip cabextract freetype libosmesa libpcap libjpeg-turbo sane-backends ncurses ocl-icd liberation-fonts-ttf libgphoto2 json-c unixODBC nss_mdns gstreamer1 gstreamer1-plugins-good gstreamer1-plugins-ugly gstreamer-plugins-bad alsa-plugins libx11 libXcursor libXi libXext libXxf86vm libXrandr libXinerama libGLU libXrender libzip lcms2 cups libxml2 libxslt flac libICE libSM libXtst libXcomposite openal-soft gtk3 libva libexif mpg123

Now, we need to install Wine:

sudo pkg install i386-wine-devel

We will now need winetricks, do not use the one on the FreeBSD repository as it is outdated and WILL cause headaches.
Using, curl, download the latest winetricks binary.

curl https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks --output winetricks
Using chmod, make it executable.
chmod +x winetricks
Now copy it to your /usr/local/bin so it can be used in a command line.
sudo cp winetricks /usr/local/bin

Configuring Wine and installing runtimes

Creating the Wineprefix

First we need to create a 32 bit Wine prefix, this has the best compatibility and all visual novels are 32-bit anyway.

WINEARCH=win32 wineboot

When Wine is started for the first time, you will need to let it install Gecko and Mono packages.

Using Winetricks

Now we need to install the common redistributables such as DirectX, Visual C++ Runtimes and .NET Framework 3.5 and other things that make video cutscenes work.

Optional: Font smoothing

You can do winetricks fontsmooth=rgb because without it, the font is simply awful.

Optional: GUI Improvments

You can open the Registry Editor using wine regedit and import this .reg file, the GUI should look nice and clean then.

First, please update Winetricks, or else it will not work.

sudo winetricks --self-update
Now we can use Winetricks:

winetricks ffdshow quartz wmp9 d3dx9 dotnet35 vcrun2003 vcrun2005 vcrun2008 vcrun2010 vcrun2012 vcrun2013 vcrun2015

ffdshow

When installing ffdshow, make sure you check (tick) ☑ every single codec/format or else it will not work!

For some VNs, such as TYPE-MOON's, LAVFilters may be needed to playback video.

winetricks lavfilters

ffdshow and LAVFilters

Some games may break if you have both ffdshow and LAVFilters installed! Make sure you experiment!

Then, run this command to disable DLL overrides, and use the native DLLs instead:

winetricks alldlls=default

Japanese fonts in Wine

You need to install Japanese fonts to Wine now. Please download the pack below.
[Google Drive]
Unzip the file and move the font files to your Fonts folder in $WINEPREFIX/drive_c/windows/Fonts

$WINEPREFIX is usually in ~/.wine. You can do export WINEPREFIX=~/.wine to use this variable.

Why not install cjkfonts in winetricks?

Because it doesn't work properly for VNs.

Installing the visual novel

FreeBSD does not have CDEmu, FUSEISO or anything similar, so you'll need to mount the disc image file regularly. Luckily, FreeBSD doesn't make the distinction between virtual drives and physical drives.
BUT... FreeBSD does not support the simple mounting of drives without using mdconfig and EXECUTING AS ROOT! Even accessing a mounted disc image requires you to have root privileges.
You cannot execute Wine as root so we will not be mounting image files. So we will be using 7zip.

Extracting the ISO

MDS/MDF

If you have Alcohol 120% CD/DVD Images (MDS/MDF), you need to use tools such as mdf2iso. Common syntax is

mdf2iso <source>.MDF <output>.ISO
In other cases you may be able to rename the .MDF file to use the .ISO extension and it will just work.

Let's first make our destination folder and cd into it.

mkdir ~/extracted
cd ~/extracted

Now, extract it with 7z:

7z -x /path/to/<disc_image>.ISO

Running the installer

Now we can finally launch the installer with Wine.

LC_ALL="ja_JP.UTF-8" TZ="Asia/Tokyo" wine <setup_executable>.exe

.msi installer

If the installer executable is an .msi, run with msiexec instead of wine.

Proceed with the installation. You may want to take note of the installation directory. C:\ is relative to $WINEPREFIX/drive_c.

Launching the visual novel

I used Kanon Memorial Edition for this guide. I can cd into $WINEPREFIX/drive_c/KEY/KANON_ME_ALL and then run REALLIVE.EXE with Wine to launch the VN at any time.

cd /path/to/visualnovelfolder
LC_ALL="ja_JP.UTF-8" TZ="Asia/Tokyo" wine <vn_executable.exe>

AlphaROMdiE

For AlphaROMdiE, you need to run it with Wine and the VN executable as an argument. It should look like this:

LC_ALL="ja_JP.UTF-8" TZ="Asia/Tokyo" wine AlphaROMdiE.exe <VN_executable.exe>
For the 1st option, you must create an empty file disable_conv in the same location as AlphaROMdiE.exe, for the 3rd option, you must create an empty file other_engine in the same location as AlphaROMdiE.exe. You can do this easily by doing:
touch disable_conv other_engine

And viola! Here's a demonstration of 2 VNs working at the same time:

Image

And the actual games work see:

Image

Now go back to Visual Novel Guide to learn how to use Textractor, it works perfectly under Wine. Please note that it needs to be launched with LC_ALL=ja_JP.UTF-8 environment variable.

Need shortcuts?

You can add shortcuts to your ${HOME}/Desktop. Create a file such as "[vn].desktop". You can also put it in /usr/local/share/applications so it appears in application launchers. Here's how I am launching Kanon from a shortcut (with the icon too!)

#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Kanon Memorial Edition
Name[ja]=Kanon メモリアルエディション 全年齢対象版
Icon=/home/shoui/.wine/drive_c/KEY/KANON_ME_ALL/KANON_ME_ALL.ICO
Exec=LC_ALL=ja_JP.UTF-8 TZ=Asia/Tokyo wine ~/.wine/drive_c/KEY/KANON_ME_ALL/RealLive.exe
Terminal=false
Type=Application
Categories=Game
Remember, paths to icons must be absolute!

Preview

Image

Troubleshooting: Fuguriya VNs

VNs made by Fuguriya such as Sono Hanabira ni Kuchizuke o and Hanahira will not launch with Wine by default. Follow the steps below to fix this.

Download fjfix [here].
Extract the archive.
Now in the terminal, run:

LC_ALL=ja_JP.UTF-8 wine fjfix.exe -f /path/to/MGD

Now it should just work.

Found this useful? Consider supporting me on Patreon!

Support me on Patreon