# Adding New Linux Libraries: Steam Client



## Amzo (Jul 6, 2013)

I was playing about getting steam to work using the Linux binary emulation. Surprising enough. It only needs glibc 1.12; Which I used by setting up a custom *L*inux jail from Arch Linux rollback server. (Works great, I may add.)

However. I currently managed to get Steam to run, update and execute after initial bootstrapping. However the last issue I have with running Steam is the libraries Steam bootstraps. Which are saved in $HOME/.steam/. I can't get the binary to use these libraries. 

Do libraries need to be branded as well? `brandelf -t linux` Or do you need to add that path to *L*inux ldconfig? `/compat/linux/sbin/ldconfig -r $HOME/.steam/` Well either way I'm having a tough time getting it to find its libraries. Even setting LD_CONFIG_PATH.

Anyone have any ideas?


----------



## Amzo (Jul 6, 2013)

Well I finally got it to detect the libraries, but it hangs. I think this is probably due to the system calls not being implemented:


```
+ ./steam
/home/buildbot/buildslave_steam/steam_rel_client_ubuntu12_linux/build/src/common/completionportmanager_posix.cpp (47) : Assertion Failed: m_nPollFd >= 0
/home/buildbot/buildslave_steam/steam_rel_client_ubuntu12_linux/build/src/common/completionportmanager_posix.cpp (50) : Assertion Failed: m_nPostFd >= 0
/home/buildbot/buildslave_steam/steam_rel_client_ubuntu12_linux/build/src/common/completionportmanager_posix.cpp (131) : Assertion Failed: epoll_ctl failed with error 38
/home/buildbot/buildslave_steam/steam_rel_client_ubuntu12_linux/build/src/steamUI/SteamIPC.cpp (59) : Assertion Failed: m_NamedPipe >= 0
/home/buildbot/buildslave_steam/steam_rel_client_ubuntu12_linux/build/src/common/completionportmanager_posix.cpp (47) : Assertion Failed: m_nPollFd >= 0
/home/buildbot/buildslave_steam/steam_rel_client_ubuntu12_linux/build/src/common/completionportmanager_posix.cpp (50) : Assertion Failed: m_nPostFd >= 0
/home/buildbot/buildslave_steam/steam_rel_client_ubuntu12_linux/build/src/common/completionportmanager_posix.cpp (131) : Assertion Failed: epoll_ctl failed with error 38
[2013-07-06 12:30:38] Startup - updater built Jun  6 2013 13:48:29
Looks like steam didn't shutdown cleanly, scheduling immediate update check
```

Patches for the needed system calls are:

http://lev.vlakno.cz/~rdivacky/patches/linux_epoll.patch

So I'll try again later on, with the epoll patch.


----------



## ManaHime (Jul 7, 2013)

That is really interesting indeed. You should post your progress about this on the freebsd-emulation mailing list*.*


----------



## mgp (Jul 7, 2013)

Great work! How close are you to a port, provided that epoll is in place?

10x


----------



## Amzo (Jul 7, 2013)

Well unfortunately, when I compile with the patch, I'm giving the following errors when trying to `kldload linux` (_a_fter a reboot into the new kernel of course):

```
exec format error
```

I'm not sure of the issue of this yet, as the module loads when I recompile _the_ kernel and all modules without the patch. So _I'm_ pretty much stuck at a dead end until I can solve that.

I also doubt it will ever be in ports as of yet. _It n_eeds a custom Linux base in /compat/linux, _the_ kernel will possibly need patching (_m_ay already have the system calls implemented in 10)*.*


----------



## nicolaecarabut (Aug 26, 2013)

Hi, 

*A*ny progress there*?* *I*s the *L*inux *S*team client running games on 64-bit freebsd FreeBSD 9+ with NVidia?

*T*hanks.


----------



## adripillo (Aug 29, 2013)

*TF2 Dedicated server*

[size=-1][Separate thread merged in. -- Mod][/size]

Hello, I want to know if I need to install something special to make a dedicated server for Team Fortress 2. I mean what software I need to make it run nice beside of FreeBSD of course.


----------



## ironudjin (Jan 5, 2014)

*Re: TF2 Dedicated server*

Hello,

I've patched the kernel of FreeBSD 10.0-PRERELEASE r260296M by epoll patch and fixed all compile errors. I also fixed the  kqueue() call in linux_epoll_create(). But there is another problem: Steam updates itself and next starts saying:

```
Fatal Error: Failed to load libsteam.so
```
In dmesg I see:

```
linux: pid 1125 (steam): syscall eventfd2 not implemented
```
According to amd64/linux32/linux32_dummy.c, eventfd2() was added in Linux-2.6.27 and it's not implemented in the Linuxator yet.

Steam found libsteam.so:

```
linux_open("/lib/libsteam.so",0x0,013)		 = 8 (0x8)
read(8,"\^?ELF\^A\^A\^A\0\0\0\0\0\0\0\0"...,512) = 512 (0x200)
linux_fstat64(0x8,0xffff9658,0x282d1fc4,0x0,0x82fd280,0x6) = 0 (0x0)
linux_mmap2(0x0,0x344a40,0x5,0x802,0x8,0x6)	 = 735055872 (0x2bd01000)
linux_mmap2(0x2c02f000,0x15000,0x3,0x812,0x8,0x6) = 738390016 (0x2c02f000)
linux_mmap2(0x2c044000,0x1a40,0x3,0x32,0xffffffff,0x6) = 738476032 (0x2c044000)
close(8)					 = 0 (0x0)
munmap(0x2af84000,16605)			 = 0 (0x0)
munmap(0x2bd01000,3426880)			 = 0 (0x0)
```
but I don't know why it couldn't load it.


----------



## cabriofahrer (Jan 7, 2016)

Amzo said:


> However. I currently managed to get Steam to run, update and execute after initial bootstrapping. However the last issue I have with running Steam is the libraries Steam bootstraps. Which are saved in $HOME/.steam/. I can't get the binary to use these libraries.



Hello, could you please explain in detail how you even get that far? If I download the client from here (unpackaged):

https://developer.valvesoftware.com/wiki/Steam_under_Linux

After extracting and executing the steam.sh script in my $HOME/.local/share/Steam/ directory, I only get:


```
$ ./steam.sh
Error: Unsupported Operating System
./steam.sh: line 69: STEAMOS: unbound variable
```


----------



## tobik@ (Jan 7, 2016)

There was a games/linux-steam port but it was removed because no one maintained it.  The Linux ports are currently being updated for the newer linux(4) in FreeBSD 11.0-CURRENT. I would wait a little before trying to get Steam to run.

Also see https://twitter.com/xmjEE/status/684940635380576256 and https://twitter.com/xmjEE/status/684884337108586500


----------



## vcore (Jan 17, 2016)

https://forums.freebsd.org/attachments/2015-06-04-124620_1920x1080_scrot-png.2589/


----------



## pkubaj (Jan 18, 2016)

vcore said:


> https://forums.freebsd.org/attachments/2015-06-04-124620_1920x1080_scrot-png.2589/


That great news would be even greater if you wrote how you managed to do it


----------



## vcore (Jan 18, 2016)

https://github.com/SteamOnFreeBSD/Steam
just a simple guide for getting started steam


----------



## abishai (Jan 18, 2016)

Have you managed to start any game from it ?


----------



## vcore (Jan 18, 2016)

oOnly Counter-Strike  and CS:SOURCE

oOther games iI can't start.


----------



## Eli Boaz (Jan 19, 2016)

Is there anything special about the Ubuntu 12.04 tarball, or is it just a base 12.04 system?
Thanks!


----------



## vcore (Jan 19, 2016)

I created ubuntu12.04.tar.gz  based on the  http://download.openvz.org/template/precreated/ubuntu-12.04-x86.tar.gz


----------



## hrenznaet (May 5, 2017)

vcore said:


> I created ubuntu12.04.tar.gz  based on the  http://download.openvz.org/template/precreated/ubuntu-12.04-x86.tar.gz


The question was why ubuntu *12.04*. It is 5 years old, there's Ubuntu 17.04 already.


----------



## SirDice (May 10, 2017)

You're responding to an old thread. So yes, it's going to reference old stuff which has been updated in the mean time.


----------

