Oblivion:Linux-Bottles-with-Modding
This how-to provides the following on a Linux system:
Accomplished in this manner:
- Oblivion (xOBSE) is run with Wine in a 32-bit prefix
- LOOT is installed via Flatpak and runs on Linux
- Wrye Bash is installed directly from the Git repository and runs on Linux
Contents
Assumptions[edit]
The following assumptions are made in order to shorten this how-to. If any of the below is not true for you, you may need to make some adjustments.
- You own GOG’s Oblivion GOTY Edition. Other sources would probably work with minimal changes; just point innoextract to a different installer file.
- Your
/home
directory resides on an ext4 filesystem. If not, check whether your filesystem supports casefolding (btrfs does not). If it does not, you can set up an ext4 partition somewhere (and change “$ROOT_DIR” below) or skip setting up casefolding (you will get warnings from LOOT and Wrye Bash about using a case-sensitive filesystem for storing Oblivion data—your risk of problems from this increases as you add mods to the game). - You are installing on Debian bookworm. For another Linux distribution, the package names might be a bit different.
- LOOT only manages Oblivion. However it is probably trivial to also use it for other games.
- Wrye Bash only manages Oblivion. If you want to use Wrye Bash to manage another game also, consider making another copy for that so you can in the the future keep whatever version works best for managing Oblivion.
Setup[edit]
Set variables[edit]
Set these variables in a shell session so you can use them later. This also allows you to easily adjust locations used for this how-to.
INSTALLER_DIR=~/gog-files/oblivion/setup_oblivion_1.2.0416_cs_12788
ROOT_DIR=~/Games/Oblivion
BOTTLE_DIR="$ROOT_DIR"/bottle
WINEPREFIX="$BOTTLE_DIR/Oblivion"
OBLIVION_USER_DIR="$WINEPREFIX/drive_c/users/$USER/Documents/My Games/Oblivion"
OBLIVION_INI="$OBLIVION_USER_DIR/Oblivion.ini"
WRYE_BASH_REPO="$ROOT_DIR"/wrye-bash.git
WRYE_BASH_VENV="$WRYE_BASH_REPO"/.venv
Casefolding[edit]
Enable the casefolding feature for the filesystem. Note this will not change the behavior of the filesystem directly; the filesystem will only enable casefolding when the attribute is explicitly enabled for a specific directory. The filesystem must be unmounted to enable this feature. If it is inconvenient to unmount the filesystem on which /home
resides, see the initramfs script example at https://unix.stackexchange.com/questions/747437.
# Enable filesystem casefold feature
sudo tune2fs -O casefold $dev
# Create directory
mkdir -p "$BOTTLE_DIR"
chattr +F "$BOTTLE_DIR"
Discard any old stuff[edit]
$BOTTLE_DIR
should be empty.~/.var/app/com.usebottles.bottles/data/bottles/bottles/Oblivion
should not exist.- There should not be any old desktop file launchers added by Bottles. You can check by running something like
grep -Eilr com.usebottles.bottles.+Oblivion ~/.local/share/applications/
(it will list any Oblivion-related files that were added by Bottles).
Install dependencies[edit]
# packages
sudo apt install 7zip flatpak git innoextract
# flatpak
flatpak install --user com.usebottles.bottles com.github.tchx84.Flatseal
Adjust Flatpak Bottles permissions[edit]
Open Flatseal (flatpak run com.github.tchx84.Flatseal
) and make these adjustments to the permissions for Bottles:
- Enable GPU acceleratino (
device=dri
) - Add filesystem path
~/Games/Oblivion
($ROOT_DIR
) - Add filesystem path
xdg-data/applications
(normally resolves to~/.local/share/applications
)
Install Oblivion[edit]
Create the bottle[edit]
- Open Bottles, open Preferences, and add runner “caffe-8.21”.
- Create a new bottle:
- Name: Oblivion
- Environment: Custom
- Architecture: 32-bit
- Runner: caffe-8.21
- Bottle Directory:
~/Games/Oblivion/bottle
($BOTTLE_DIR
) - Import Configuration: (Default)
Extract Oblivion files[edit]
innoextract --extract --exclude-temp \
--output-dir "$WINEPREFIX/drive_c/" \
"$INSTALLER_DIR"/setup_*.exe
mv $WINEPREFIX/drive_c/app $WINEPREFIX/drive_c/Oblivion
Add registry entries for Oblivion[edit]
Since we circumvented the installer, we need to manually add the required registry entry.
# 64-bit key path: "HKLM\Software\Wow6432Node\Bethesda Softworks\Oblivion"
# 32-bit key path: "HKLM\Software\Bethesda Softworks\Oblivion"
flatpak run --command=bottles-cli com.usebottles.bottles reg \
--bottle Oblivion \
--key "HKLM\Software\Bethesda Softworks\Oblivion" \
--value "Installed Path" \
--key-type REG_SZ \
--data "C:\Oblivion" \
add
Provide initial Oblivion.ini[edit]
# Create directory for user's Oblivion.ini
mkdir -p "$(dirname "$OBLIVION_INI")"
# Copy the default Oblivion.ini into the user location
cp "$WINEPREFIX"/drive_c/Oblivion/Oblivion_default.ini "$OBLIVION_INI"
# Disable joystick
sed -Ei "s/^(bUse Joystick)=.+/\1=0/" "$OBLIVION_INI"
# Disable intro movies
sed -Ei "s/^(SIntroSequence)=.+/\1=/" "$OBLIVION_INI"
sed -Ei "s/^(SMainMenuMovieIntro)=.+/\1=/" "$OBLIVION_INI"
Configure bottle[edit]
- Programs:
- Add Shortcuts…
- Add
$WINEPREFIX/drive_c/Oblivion/OblivionLauncher.exe
- Add
$WINEPREFIX/drive_c/Oblivion/Oblivion.exe
, open the dot-menu beside the resulting shortcut, click Rename… and rename it to “Oblivion (non-xOBSE)”
- Add
- Add Shortcuts…
- Settings
- Components
- Runner: caffe-8.21
- DXVK: Disabled
- VKD3D: Disabled
- LatencyFleX: Disabled
- Display:
- Deep Learning Super Sampling: Disabled
- FidelityFX Super Resolution: Disabled
- Discrete Graphics: Disabled
- Post-Processing Effects: Disabled
- Gamescope: Disabled
- Advanced Display Settings:
- Virtual Desktop: Disabled
- Fullscreen Mouse Capture: Disabled
- Take Focus: Disabled
- Mouse Warp: Enabled
- Window Manager Decorations: Enabled
- Screen Scaling: 96
- Renderer: GL (Default)
- Performance:
- Synchronization: System
- Monitor Performance: Disabled
- Feral GameMode: Disabled
- Preload Game Files: Disabled
- OBS Game Capture: Disabled
- Compatibility:
- Windows Version: Windows 10
- Language: System
- Working Directory: (Default)
- DLL Overrides: (none)
- Environment Variables: (none)
- Manage Drives (optionally, remove Z:):
- C:
../drive_c
- D:
/dev/sr0
- C:
- Snapshots:
- Automatic Snapshots: Disabled
- Compression: Disabled
- Use Exclusion Patterns: Disabled
- Components
Test[edit]
Now you should be able to run the Oblivion Launcher by clicking the play button beside its entry in the Programs list.
Configure the video settings with the Launcher and then run “Oblivion non-xOBSE” to make sure it is working. If you have problems, try with Mode = Windowed mode and Screen Effects = None. And see the Notes section.
Install xOBSE[edit]
wget -O /tmp/xOBSE.zip \
https://github.com/llde/xOBSE/releases/download/22.12.1/xOBSE-22.12.1.zip
unzip /tmp/xOBSE.zip \
Data/OBSE/obse.ini obse_1_2_416.dll obse_editor_1_2.dll \
obse_loader.exe \
-d $WINEPREFIX/drive_c/Oblivion
In Bottles:
- Add a program shortcut for
$WINEPREFIX/drive_c/Oblivion/obse_loader.exe
. - Open the dot-menu beside the resulting shortcut; click Rename… and rename it to “Oblivion (xOBSE)”.
- Open the dot-menu again and click Add Desktop Entry.
Install TES4Edit[edit]
Download TES4Edit 4.1.5f from https://www.nexusmods.com/oblivion/mods/11536?tab=files.
7zz x -o$WINEPREFIX/drive_c/ "TES4Edit 4.1.5f-11536-4-1-5f-1714279194.7z"
In Bottles:
- Add a program shortcuts for
$WINEPREFIX/drive_c/TES4Edit 4.1.5f/TES4EditQuickAutoClean.exe
. - Rename the resulting shortcut to “TES4Edit QuickAutoClean (Oblivion)”.
- Add a desktop entry for it.
Install Wrye Bash[edit]
# Install dependency packages (for building wxPython)
sudo apt install build-essential dpkg-dev freeglut3-dev libgl1-mesa-dev \
libgstreamer-plugins-base1.0-dev libgtk-3-dev libjpeg-dev libnotify-dev \
libpng-dev libsdl2-dev libsdl2-dev libsm-dev libtiff-dev \
libwebkit2gtk-4.0-dev libxtst-dev python-is-python3 python3-dev virtualenv
# Clone repository
git clone https://github.com/wrye-bash/wrye-bash.git "$WRYE_BASH_REPO"
# Checkout version
pushd "$WRYE_BASH_REPO"
git checkout v314
# Create virtualenv for Python dependencies
virtualenv "$WRYE_BASH_VENV"
"$WRYE_BASH_VENV"/bin/pip install -r requirements.txt
# Configure Wrye Bash
cp "$ROOT_DIR"/wrye-bash.git/Mopy/bash_default.ini \
"$ROOT_DIR"/wrye-bash.git/Mopy/bash.ini
sed -Ei "0,/^;(sOblivionPath)=.+/s||\1=../../bottle/Oblivion/drive_c/Oblivion|" \
"$ROOT_DIR"/wrye-bash.git/Mopy/bash.ini
sed -Ei "0,/^;(sUserPath)=.+/s||\1=../users/$USER|" \
"$ROOT_DIR"/wrye-bash.git/Mopy/bash.ini
sed -Ei "0,/^;(sPersonalPath)=.+/s||\1=../users/$USER/Documents|" \
"$ROOT_DIR"/wrye-bash.git/Mopy/bash.ini
sed -Ei "0,/^;(sLocalAppDataPath)=.+/s||\1=../users/$USER/AppData/Local|" \
"$ROOT_DIR"/wrye-bash.git/Mopy/bash.ini
Place this file at ~/.local/share/applications/Wrye-Bash-Oblivion.desktop
to make Wrye Bash appear in your desktop menu(s). You will need to change the /home/user
path to reflect the correct user:
[Desktop Entry]
Type=Application
Version=1.0
Name=Wrye Bash (Oblivion)
Exec=/home/user/Games/Oblivion/wrye-bash.git/.venv/bin/python "Wrye Bash Launcher.pyw"
StartupNotify=true
Path=/home/user/Games/Oblivion/wrye-bash.git/Mopy
Icon=Wrye-Bash
StartupWMClass=wrye bash.exe
Categories=Game;RolePlaying;
Install an icon for Wrye Bash:
icon_dir=~/.local/share/icons/hicolor/scalable/apps
mkdir -p $icon_dir
pushd $icon_dir
wget -O Wrye-Bash.svg \
"https://raw.githubusercontent.com/wrye-bash/wrye-bash/refs/heads/dev/Mopy/bash/images/bash.svg"
popd
Install LOOT[edit]
flatpak install --user io.github.loot.loot
Run Flatseal (flatpak run com.github.tchx84.Flatseal
) and add filesystem path ~/Games/Oblivion
($ROOT_DIR
) for LOOT.
Run LOOT (flatpak run io.github.loot.loot
) and then close it (this will add the settings.toml
file that needs to be edited).
Edit ~/.var/app/io.github.loot.loot/data/LOOT/settings.toml
and add a games
section below the [window]
section (replacing three instances of user
with your username):
[[games]]
folder = 'Oblivion (GOG)'
gameId = 'Oblivion'
local_path = '/home/user/Games/Oblivion/bottle/Oblivion/drive_c/users/user/AppData/Local/Oblivion'
master = 'Oblivion.esm'
masterlistSource = 'https://raw.githubusercontent.com/loot/oblivion/v0.21/masterlist.yaml'
minimumHeaderVersion = 0.80000001192092896
name = 'TES IV: Oblivion (GOG)'
path = '/home/user/Games/Oblivion/bottle/Oblivion/drive_c/Oblivion'
Notes[edit]
Fix Bottles easyterm bug[edit]
If the command line never opens, you may be affected by https://github.com/bottlesdevs/Bottles/issues/3843.
Check for the bug (if grep returns #!python
the bug is present):
grep '#!python' \
~/.local/share/flatpak/app/com.usebottles.bottles/current/active/files/bin/easyterm.py
An easy fix that is probably not recommended by Flatpak file (may get reverted if the com.usebottles.bottles
app is updated or reinstalled, but hopefully it will get fixed soon):
sed -i 's,#!python,#!/usr/bin/env python3,' \
~/.local/share/flatpak/app/com.usebottles.bottles/current/active/files/bin/easyterm.py
View Oblivion terminal output[edit]
If Oblivion crashes at some point or appears to never start, it may be helpful to run it in a terminal. In Bottles, click the dot-menu beside “Oblivion (xOBSE)” and click the “Launch with Terminal” button.
Performance[edit]
Here are things to try that may improve performance (or make it worse):
- Install d3dx9 (Bottles > Options > Dependencies)
- Use another runner (Bottles > menu > Preferences > Runners)
- Change graphics acceleration components (Bottles > Components)
- Enable Discrete Graphics if you hardware has multiple GPUs (Bottles > Options > Display > Discrete Graphics)
- Add the Oblivion Stutter Remover mod.
Remove segfaulting libgstva.so[edit]
If you have a problem with libgstva gStreamer plugin segmentation faults, you can try disabling all gStreamer plugins: add the GST_PLUGIN_SYSTEM_PATH=
environment variable in Bottles > Options > Settings > Environment Variables. This disables all gstreamer plugins. If it allows Oblivion to start, then you probably will not have an audio.
An easy fix that is probably not recommended by Flatpak (may get reverted if the org.gnome.Platform.Compat.i386
runtime is updated or reinstalled, but you probably don’t want this plugin anyway if it is causing crashes):
rm ~/.local/share/flatpak/runtime/org.gnome.Platform.Compat.i386/x86_64/47/active/files/gstreamer-1.0/libgstva.so
Gallium Nine[edit]
Maybe this will improve performance? See https://github.com/iXit/wine-nine-standalone.
# Install required packages
sudo apt install libd3dadapter9-mesa libd3dadapter9-mesa:i386
# Install Gallium Nine
pushd "$WINEPREFIX/drive_c"
wget https://github.com/iXit/wine-nine-standalone/releases/download/v0.10/gallium-nine-standalone-v0.10.tar.gz
tar -x -f gallium-nine-standalone-v0.10.tar.gz
cp gallium-nine-standalone/lib32/d3d9-nine.dll.so \
windows/system32/d3d9-nine.dll
cp gallium-nine-standalone/bin32/ninewinecfg.exe.so \
windows/system32/ninewinecfg.exe
popd
Now open a Wine terminal (Bottles > Tools > Command Line). Then run cd C:\windows
and ninewinecfg.exe -e
.
(For a win64 prefix)[edit]
cp gallium-nine-standalone/lib32/d3d9-nine.dll.so \
windows/syswow64/d3d9-nine.dll
cp gallium-nine-standalone/bin32/ninewinecfg.exe.so \
windows/syswow64/ninewinecfg.exe
cp gallium-nine-standalone/lib64/d3d9-nine.dll.so \
windows/system32/d3d9-nine.dll
cp gallium-nine-standalone/bin64/ninewinecfg.exe.so \
windows/system32/ninewinecfg.exe
Run cd C:\windows\syswow64
and ninewinecfg.exe -e
.