rsharo / steamos_docker

Builds a SteamOS image for Docker with 3D graphics and sound
11 stars 5 forks source link

Error #13

Open brunini opened 7 years ago

brunini commented 7 years ago

I`m running Fedora 24 and i have this error, with nvidia and default Make target too.

Removing intermediate container 2a48c5ae3f8d Step 24 : WORKDIR /root ---> Running in d84ef72e329f ---> 261eda0dfc63 Removing intermediate container d84ef72e329f Step 25 : SHELL Unknown instruction: SHELL Makefile:21: recipe for target 'steamos_buildmach.built' failed make[2]: [steamos_buildmach.built] Error 1 make[2]: Leaving directory '/root/steamos_docker/steamos_buildmach' Makefile:25: recipe for target 'steamos_buildmach' failed make[1]: [steamos_buildmach] Error 2 make[1]: Leaving directory '/root/steamos_docker' Makefile:37: recipe for target 'build/brewmaster.built' failed make: *** [build/brewmaster.built] Error 2

rsharo commented 7 years ago

@brunini Can you tell us what version of Docker you're using? This project was developed and deployed for Docker version 1.13.

rsharo commented 7 years ago

@brunini Additional info: Looking at the docker repo, it looks like the SHELL instruction is also supported in Docker v1.12. Is your install v1.11.2 or earlier?

These instructions might help if you want to upgrade to the latest docker version: https://docs.docker.com/engine/installation/linux/fedora/

Please post an update if this addresses the failure.

brunini commented 7 years ago

Thanks. i was able to update Docker to version 1.13.0 and run Make successfully as well.

Now inside the container i got this:


** Run "steam" if you want to run the steam client.
** You are a sudoer. Default password is "steamuser".
steamuser@4d6081ef575d:~$ steam
/home/steamuser/.local/share/Steam/steam.sh: line 99: no match: **:
steamuser@4d6081ef575d:~$ xterm
No protocol specified
xterm: Xt error: Can't open display: :0

Looks like some permission error or something. I will try to explore more.... I'm really new to Docker and container stuff.

rsharo commented 7 years ago

@brunini Congrats! You're almost there! Its just that you're running the docker container without connecting audio or X11. Fortunately, there is a script to help with that.

Instead of running docker run directly, try running the script called util/steambox. That is, this script.

The following environment variables can be set to control how the script runs:

STEAMBOX=${STEAMBOX:-"steambox"}
STEAMUSER_DISPLAY=${STEAMUSER_DISPLAY:-":0"}

echo STEAMUSER_UID=${STEAMUSER_UID:?"$0: you must set the environment variable STEAMUSER_UID"}
echo STEAMUSER_HOME=${STEAMUSER_HOME:?"$0: you must set the environment variable STEAMUSER_HOME"}
echo STEAMUSER_DISPLAY=${STEAMUSER_DISPLAY}
brunini commented 7 years ago

I tried to use the script but, still the same problem with X, maybe i am doing something wrong with those ENVIRONMENT VARIABLES, i hope do not end playing Justin Bieber accidentally LOL

[root@sala steamos_docker]# XUSER=bruno
[root@sala steamos_docker]# export STEAMUSER_UID=$(id -u ${XUSER})
[root@sala steamos_docker]# export STEAMUSER_GID=$(id -g ${XUSER})
[root@sala steamos_docker]# export STEAMUSER_HOME=$(grep "${XUSER}" /etc/passwd | cut -f6 -d:)
[root@sala steamos_docker]# STEAMBOX=steambox_nvidia ./util/steambox
./util/steambox: WARNING: This script launches a steambox Docker container with
unrestricted access to your X session, audio drivers, and dbus.

There are no provisions stopping the container from:
   1) Showing you spoofed windows, including prompts to enter your password.
   2) Accessing your microphone
   3) Capturing mouse gestures and/or keystrokes
   4) Sending commands to other desktop applications via dbus
   5) Reading (but not changing) your machine-id
   6) Accessing shared memory
   7) Playing polka music or even worse... Justin Bieber.

Are you sure you want to continue? [N/y] y
STEAMUSER_UID=1000
STEAMUSER_HOME=/home/bruno
STEAMUSER_DISPLAY=:0
./util/steambox: Using args: -v /home/bruno/steamhome:/home/steamuser -v /tmp/.X11-unix:/tmp/.X11-unix --device /dev/dri/card0 --device /dev/dri/renderD128 --device /dev/nvidiactl --device /dev/nvidia-modeset --device /dev/nvidia0 --env DISPLAY=:0 --device /dev/snd/hwC1D0 --device /dev/snd/pcmC1D9p --device /dev/snd/pcmC1D8p --device /dev/snd/pcmC1D7p --device /dev/snd/pcmC1D3p --device /dev/snd/controlC1 --device /dev/snd/hwC0D0 --device /dev/snd/pcmC0D2c --device /dev/snd/pcmC0D1p --device /dev/snd/pcmC0D0c --device /dev/snd/pcmC0D0p --device /dev/snd/controlC0 --device /dev/snd/seq --device /dev/snd/timer -v /dev/shm:/dev/shm -v /etc/machine-id:/etc/machine-id:ro -v /run/user/1000/pulse:/run/user/1000/pulse -v /var/lib/dbus:/var/lib/dbus -v /home/bruno/.pulse:/home/steamuser/.pulse

The programs included with the SteamOS GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

SteamOS GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

** Run "steam" if you want to run the steam client.
** You are a sudoer. Default password is "steamuser".
steamuser@e4012da5779f:~$ xterm
No protocol specified
xterm: Xt error: Can't open display: :0
steamuser@e4012da5779f:~$ steam
/home/steamuser/.local/share/Steam/steam.sh: line 99: no match: **:
rsharo commented 7 years ago

@brunini Thanks for providing the full console output! I think I'm spotting the problem.

You appear to be running util/steambox as root. If you're logged into the computer as bruno, then bruno "owns" the X display -- root cannot open :0.

Please try running util/steambox from the bruno account instead of root. I think it will work if you do that.

brunini commented 7 years ago

Fedora, RHEL and clones prevent non-root users to run docker by default. After some workarounds i was able to run docker as a non-root user that "owns" X (bruno). But as you can see, i have the same problem. I Believe that Fedora is the "root" of the problem, but i don't understand enough docker yet, to trace the problem.

[bruno@sala steamos_docker]$ STEAMBOX=steambox_nvidia ./util/steambox
./util/steambox: WARNING: This script launches a steambox Docker container with
unrestricted access to your X session, audio drivers, and dbus.

There are no provisions stopping the container from:
   1) Showing you spoofed windows, including prompts to enter your password.
   2) Accessing your microphone
   3) Capturing mouse gestures and/or keystrokes
   4) Sending commands to other desktop applications via dbus
   5) Reading (but not changing) your machine-id
   6) Accessing shared memory
   7) Playing polka music or even worse... Justin Bieber.

Are you sure you want to continue? [N/y] y
STEAMUSER_UID=1000
STEAMUSER_HOME=/home/bruno
STEAMUSER_DISPLAY=:0
./util/steambox: Using args: -v /home/bruno/steamhome:/home/steamuser -v /tmp/.X11-unix:/tmp/.X11-unix --device /dev/dri/card0 --device /dev/dri/renderD128 --device /dev/nvidiactl --device /dev/nvidia-modeset --device /dev/nvidia0 --env DISPLAY=:0 --device /dev/snd/hwC1D0 --device /dev/snd/pcmC1D9p --device /dev/snd/pcmC1D8p --device /dev/snd/pcmC1D7p --device /dev/snd/pcmC1D3p --device /dev/snd/controlC1 --device /dev/snd/hwC0D0 --device /dev/snd/pcmC0D2c --device /dev/snd/pcmC0D1p --device /dev/snd/pcmC0D0c --device /dev/snd/pcmC0D0p --device /dev/snd/controlC0 --device /dev/snd/seq --device /dev/snd/timer -v /dev/shm:/dev/shm -v /etc/machine-id:/etc/machine-id:ro -v /run/user/1000/pulse:/run/user/1000/pulse -v /var/lib/dbus:/var/lib/dbus -v /home/bruno/.pulse:/home/steamuser/.pulse

The programs included with the SteamOS GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

SteamOS GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

** Run "steam" if you want to run the steam client.
** You are a sudoer. Default password is "steamuser".
steamuser@c1c5b04be224:~$ steam
/home/steamuser/.local/share/Steam/steam.sh: line 99: no match: **:
steamuser@c1c5b04be224:~$ xterm
No protocol specified
xterm: Xt error: Can't open display: :0
brunini commented 7 years ago

Because an unknown motive my X was running with :1

[bruno@sala ~]$ echo $DISPLAY
:1

[bruno@sala ~]$ ll /tmp/.X11-unix/
total 0
srwxrwxrwx. 1 root gdm   0 Jan 30 15:34 X0
srwxrwxrwx. 1 root bruno 0 Jan 30 15:46 X1

So only adjusting DISPLAY variable and running as non-root user, Steam is now working as it should in the beginning.

This is really amazing, and i believe very soon your project will be the standard approach to run Steam on a container.

Very thanks.

rsharo commented 7 years ago

@brunini Congrats!

I'm going to keep this issue open a little while longer to remind me to improve the documentation a little bit.

Happy gaming!

brunini commented 7 years ago

I have now some problem with pass through of game controller. ( Dual Shock 4 with Bluetooth ) but I'm pretty sure that I will be successful.

jcorrado commented 7 years ago

@rsharo - I'm bummed I didn't get a notification about this ticket! I would have liked to have assisted.

@brunini - I'm glad, and not surprised, that @rsharo got you sorted out! If you encounter additional issues, please open a new ticket. Good luck with your game controller.