Samba networking with OPL on a Sony Playstation 2 SPCH-90010

2021-05-13

(last time edited: 2021-09-17)

tags: vidya, softmodding, linux

In this guide I will explain the usage of:

The DVD burned with FreeDVDBoot will be read even if your PlayStation 2 is unmodded. FreeDVDBoot launches wLaunchELF (a simple file manager).

With this file manager we will proceed to execute an ELF file stored in one of our USB drives connected to the PS2. The executable will be OpenTuna.

OpenTuna is a program made to exploit our PS2 and install Open PS2 Loader (OPL) in our original 8MB Memory Card. OpenTuna was written by alexparrado from scratch and by reverse engineering a previously closed source exploit called Fortuna. Info Technical Information

Once OpenTuna have been executed, OPL will populate in our Memory Card. We will use the Open PS2 Loader to play games and run programs.

Samba is a very well known daemon program for file sharing. OPL can connect to any device running Samba (any computer or Raspberry Pi, whatever) and retrieve ISO files containing PS2 video games.

Introduction

Notice! This guide can be followed successfully from start to end using any kind of Linux system. The whole setup works perfectly and was fully tested with Linux. I can assure this guide is also possible to be followed from a Windows system but I won't help you finding alternatives for certain tips. Use a Linux distribution at all costs.

So I bought this infamous -kinda used- Sony PlayStation 2 model SPCH-90010 (NTSC) that lots of idiots on the Internet talk about it saying "nooo don't buy that! it's impossible to hack! u dun goofed bro".

blogimg

Here is this blog post to prove that some people, whose names always get lost in the empty void of nothingness, worked their ass off to soft mod it and proven that is possible to play video games on it without hacking it physically with a nasty chinese chip.

blogimg

blogimg

FreeDVDBoot

FreeDVDBoot allows you to burn your own PlayStation 2 homebrew discs and play them on an unmodified console as seen in the demo video. With wLaunchELF as the initial program, users can include multiple homebrew programs on the same disc.

With FreeDVDBoot we will be able to run wLaunchELF (which is a binary program that comes included in FreeDVDBoot) and then install OpenTuna into an official 8MB PS2 Memory Card.

Download the .iso image.

And then burn it on a brand new and virgin DVD-R using growisofs. If you are not using Linux, what the fuck are waiting for?

# growisofs -dvd-compat -speed=1 -Z /dev/sr0=/path/too/downloaded_image.iso

It's better to use the lowest burning speed just in case. I happened to have a Thinkpad T420 that saved me with this task.

blogimg

Before inserting the disc in the PS2 we need to build a FAT32 USB drive and put OpenTuna in it.

OpenTuna

OpenTuna is an open source version of Fortuna. While Fortuna was merely a proof of concept, OpenTuna was made having future development in mind:

We will use fdisk to partition the USB drive.

First check which drive was assigned to your USB using lsblk.

$ lsblk

This is what appears on my host machine so in my case I will be targeting sdc.

NAME            MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda               8:0    0 XXX.XG    disk
......
sdb               8:16   0 XXX.XG  0 disk
......
sdc               8:32   1   7.3G  0 disk

Then partition.

# fdisk -w always -W always /dev/sdX

Create a new DOS disklabel.

Command (m for help): o
Created a new DOS disklabel with disk identifier 0x59640b34.

Just create a single partition, who cares.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): ENTER
Partition number (1-4, default 1): ENTER
First sector (2048-15248831, default 2048): ENTER
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-15248831, default 15248831): ENTER

Created a new partition 1 of type 'Linux' and of size XXXX.XXX.

Add W95 FAT32 type to the partition.

Command (m for help): t
Selected partition 1
Hex code or alias (type L to list all): 0b
Changed type of partition 'Linux' to 'W95 FAT32'.

Write changes.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Now we need to format the drive with FAT32 filesystem.

# mkfs.vfat -F 32 /dev/sdX1

Download OpenTuna v1, click here to download: link. These files ARE NOT hosted on my server.

v1.0.2 is the latest version up to May 26, 2021.

Unzip to extract the files.

$ unzip /path/to/opentuna.zip

You only need to copy the .ELF file to the USB drive. But first mount the drive.

# mkdir /mnt/fat32usb

# mount /dev/sdX1 /mnt/fat32usb

Copy the OpenTuna installer.

# cp /path/to/OpenTuna_Installer_v1B_FINAL.ELF /mnt/fat32usb

Unmount the USB drive.

# umount /mnt/fat32usb

Now you can remove the USB drive from the USB port.

Ok, insert the FreeDVDBoot DVD in the PS2 and insert the USB drive we built. Time to pray.

blogimg

wLaunchELF

wLaunchELF, formerly known as wLaunchELF, also known as wLE or uLE (abbreviated), is an open source file manager and executable launcher for the Playstation 2 console based off of the original wLaunchELF. It contains many different features, including a text editor, hard drive manager, as well as network support, and much more.

There isn't much to say about wLaunchELF. It's a nice graphical file manager and environment that lets us copy, move, execute and do certain tasks with the data found in our Memory Card or in the USB drive.

Like I said, this program binary comes included in FreeDVDBoot.

Once we are in wLaunchELF we are able to install OpenTuna to the Memory Card.

So the SPCH-90010 can be soft modded unlike people said. I took these screenshots using an elgato capture device.

It is preferable that your Memory Card is already empty.

blogimg

Press circle and navigate to mass:/ directory.

blogimg

Execute OpenTuna and you will be prompted to press X or circle.

blogimg

Once the installation is done go to your Memory Card and you'll see an invisible Corrupted Data item.

Press circle 2 times on it.

This action will execute OPL v1.0.0 which was packed inside OpenTuna and installed inside your Memory Card.

OPTIONAL! ...and very important. If for some reason you want to use wLaunchELF again, press circle on the invisible Corrupted Data item, and then HOLD circle until wLaunchELF is executed and shown on screen.

Interesting notes:

If you were wondering why some people call it LaunchELF (LE), uLaunchELF (uLE); wLaunchELF (wLE)... here is some information taken from this post by Jay-Jay on the PS2 Homebrew and Tools site regarding the history of this program.

There are other file managers alternatives such as LbFn but I haven't tried that one yet. wLaunchELF is the most common and stable with lots of development to this date.

OPL (Open PS2 Loader)

Open PS2 Loader (OPL) is a 100% open source game and application loader for the PS2 and PS3 units. It supports three categories of devices : USB mass storage devices, SMB shares and the PlayStation 2 HDD unit. USB devices and SMB shares support USBExtreme and *.iso formats while PS2 HDD supports HDLoader format. It's now the most compatible homebrew loader.

OPL is also developed continuously - anyone can contribute improvements to the project due to its open source nature.

Notice! OPL only plays PS2 games. I learned this the hard way.

This is the welcoming loading intro.

blogimg

This is the main menu.

blogimg

This is the about section with information of the programmers and program versioning, etc.

blogimg

Samba

Samba is a free software re-implementation of the SMB networking protocol, and was originally developed by Andrew Tridgell. Samba provides file and print services for various Microsoft Windows clients and can integrate with a Microsoft Windows Server domain, either as a Domain Controller (DC) or as a domain member. As of version 4, it supports Active Directory and Microsoft Windows NT domains.

To the moment I'm writing this blog post I'm using the 4.13.4 version of Samba.

Here comes the tricky part if you are not very into the basics of networking. We need to run the Samba server in our computer/workstation to share our .iso games across the network. Grab an ethernet cable and ram it in!

blogimg

I can assure this networking configuration is very simple. Basically we need to connect our OPL (especifically the Samba client that runs within OPL) to our computer, where the games are located at. Our router will be the middle-man.

This is my current routing configuration. Just a DHCP server that connects my multiple home devices.

blogimg

In your host machine create an OPL share directory to serve all games. Create it with 770 permissions. If you don't know much about file permissions check out this beautiful chmod calculator, it's very handy for newbies.

$ mkdir -m 770 /home/your_username/OPL

770 is the same as rwxrwx--- which means:

If the OPL directory was already created then just chmod it.

$ chmod -v 770 /path/to/OPL

Now create a common share group.

In Void Linux:

# groupadd sambagroup

In Alpine Linux:

# addgroup sambagroup

And change the GID of the directory.

$ chgrp sambagroup /home/your_username/OPL

And give execution rights to your home dir so group members can have access to your OPL dir. Usually this is not necessary because the default home directory permissions are 755.

$ chmod 710 /home/your_username

And add sambagroup to your home dir too. This is absolutely not necessary when your home dir permissions is 755.

$ chgrp sambagroup /home/your_username

In this guide I opted NOT to create a guest account to connect to Samba server. It's not worth the risk. We are going to create a separate UNIX user.

Create a new user. Let's call it opllogin. You can call it whatever you want.

In Void Linux:

# useradd -M -s /bin/false -G sambagroup opllogin

In Alpine Linux:

# adduser -H -s /bin/false -G sambagroup opllogin

And add your daily UNIX user to the same group. This is necessary to move files between directories.

In Void Linux:

# usermod -G sambagroup -a your_username

In Alpine Linux:

# addgroup your_username sambagroup

Create an opllogin group.

In Void Linux:

# groupadd opllogin

In Alpine Linux:

# addgroup opllogin

And add opllogin to the your_username group, so he can at least enter the directory and search for the games.

In Void Linux:

# usermod -G your_username -a opllogin

In Alpine Linux:

# addgroup your_username opllogin

Relogin to your your_username shell to make group permissions work and keep going.

Now add opllogin user in the Samba password database. It will be enabled instantly. No need to pass -e argument. Choose any password you like.

# smbpasswd -a opllogin

New SMB password:
Retype new SMB password:

Let's make a Samba server configuration now.

[global]

log file = /tmp/samba/log.txt
log level = 5

hosts allow = 192.168.1.
server min protocol = NT1
ntlm auth = ntlmv1-permitted

[ps2]

path = /home/your_username/OPL

writeable = true
strict sync = false

valid users = opllogin
group = sambagroup

create mask = 660
directory mask = 770

Now save this configuration somewhere. I prefer to save it in a file called ~/.config/samba/smb.conf and then run it as a normal user rather than a daemonized service (root).

Some basic explanation of what we are doing here.

If you want more information on the smb.conf file use the manpages. The smb.conf manual page is very well documented and tells you the default values of every possible parameter.

$ man smb.conf

Totally Optional! Testparm is a program that comes included in the Samba package. This standalone program can be run wether Samba is running or not. It is useful for double checking our configuration syntax and default parameters.

To check for syntax errors in our configuration.

$ testparm -s /path/to/our_custom_smb.conf

To read default Samba parameter values.

$ testparm -sv | less

Now let's fill the all the information in the OPL Network Settings menu.

blogimg

As you can see in the PS2 part of the screenshot:

In the SBM server part:

Let's keep going and execute Samba once and for all. We need to do it under root account. Pay attention to the argument, we are calling the configuration we saved before.

# smbd -s /path/to/smb.conf

For further debugging, if you wanna know if Samba is connecting OPL to our host machine, you can use ss, a program that comes in the iproute2 package for network information. ss can display socket information.

If you use Void Linux like me, you can start the Samba server / service daemon (smbd) by creating a conf file in /etc/sv/smbd. Runit will read it and pass the arguments.

First create the file.

# touch /etc/sv/smbd/conf

Open it with a text editor.

# vim /etc/sv/smbd/conf

Add the following text.

#!/bin/sh
OPTS="-s /path/to/smb.conf"

And then you can just start the service by doing a symlink.

# ln -s /etc/sv/smbd /var/service

And use sv to manage the service.

For example:

# sv force-restart smbd

or

# sv force-stop smbd

The same idea of running Samba as a daemonized service can be done in Alpine Linux. Add the service to the default runtime.

# rc-update add samba default

Then configure the service just like we did in Void Linux (runit). This time we are using the OpenRC conventions.

# vim /etc/conf.d/samba

And edit the text adding the Samba personal config path. You could as well just leave smbd in the daemon_list because nmbd is not needed.

daemon_list="smbd"
smbd_options="-D -s /path/to/your/custom/smb.conf`

Another way of using a configuration file is by copying your config and replacing the original one. But this one is the lazy way to achieve it.

# cp /path/to/your/custom/smb.conf /etc/samba/smb.conf

To check if OPL is connecting to your Samba server.

# ss -lnt -o state established '( sport = :445 )'

To check if your PS2 has established connection with your Samba server.

$ ss dsn -n PS2_IP_HERE

Recv-Q   Send-Q   Local Address:Port   Peer Address:Port     Process
0        0        192.168.1.107:445    192.168.1.109:49153   timer:(keepalive,118min,0)

Or you could just run this command as root which brings up also more information about the server, such as: protocol, encryption, signing, etc.

# smbstatus

Wrap these commands with watch -n 1 to refresh them with a second interval. For example:

# watch -n 1 smbstatus

or

# watch -n 1 ss -lnt -o state "established '( sport = :445 )'"

Time to play!

Now we need some games. If you download games like me from sketchy websites, you might get them compressed in .7z format rather than .iso format. No worries!

Let's convert our games to .iso easily using bchunk.

$ bchunk game.bin game.cue game

This works perfect with games that come in a single .bin. Some websites offer the same game in just 1 binary file, try to find them instead of trying to merge 2 .bin files. Most of the time this convertion won't work and OPL won't read them. I recommend you to search and download a different version of the same game from the Internet.

And store it in the CD or DVD directory depending on the game format. For example, Crazy Taxi was only released in CD-ROM, therefore it goes in the CD directory. OPL will detect them anyways no matter which directory you put them in, but let's keep things nice and tidy.

If everything went correctly, press start and you will see this image on screen. It shows ETH Games on the top middle, referring to the Samba networking via ethernet and it shows our games on the left.

blogimg

Remember! Don't panic if your OPL freezes if you refresh the game list. Just reboot your console, remove certain .iso images that could possibly be messing with OPL and try refreshing the game list again. OPL cannot read some .iso files, and OPL cannot play PSX games either. Shadow of the Colossus, Crazy Taxi and many other games work perfectly! There are websites where people contribute adding information of compatible games with OPL and Samba.

If you wanna leave a game, press and hold L1 + L2 + R1 + R2 + select + start at the same time.

blogimg

blogimg

Applications

The Open PS2 Loader (OPL) is incredibly dynamic. We can run also little programs in .elf format.

blogimg

To make this work first create a conf_apps.cfg file and place it in the OPL directory we use for Samba sharing.

And then with our favorite text editor add all the .elf programs manually, pointing to the file.

The pattern is very basic and simple: ANY_NAME=PATH

PadTest=smb:/APPS/padtest.elf
RetroArch=smb:/APPS/retroarch/raboot.elf
wLaunchELF=smb:/APPS/wlaunchelfv4.43a.elf

All our ELF files need to be stored in the APPS directory and pointed correctly.

Some programs I currently use:

Image taken by me 29/06/2021 showing my system temperature. It looks horrible but it works. Feels good to know temps are under 40°.

blogimg

Updating OPL

First download the latest release from the Open-PS2-Loader releases uploaded in GitHub.

When I wrote this guide I was using the version 1.0.0. At the time of updating this guide I just updated to 1.1.0.

Once you download the .elf from the releases, copy it to a W95 FAT32 formatted partitioned USB. Then load wLaunchELF and replace the OPNPS2LD.ELF file with the new one.


Some interesting details:

$ convert /path/to/image.jpg -resize x200 /path/to/image.jpg

Happy gaming!