Skip to content

Commit

Permalink
Update documentation with new deployment configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh5 committed Sep 29, 2023
1 parent 12cc164 commit f4cad0a
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 80 deletions.
18 changes: 1 addition & 17 deletions docs/compose-files/docker-compose.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ services:
- apparmor:unconfined

# NETWORK:
network_mode: host
hostname: ${NAME}
extra_hosts:
- "${NAME}:127.0.0.1"
networks:
external-macvlan:
ipv4_address: ${CONTAINER_IP_ADDRESS}

# ENVIRONMENT:
## Read all config variables from the .env file
Expand Down Expand Up @@ -63,18 +61,4 @@ services:
# Leave commented out to not share the pulse socket with any other Docker containers.
#- /opt/container-data/steam-headless/pulse/:/tmp/pulse/:rw

# Input devices used for mouse and joypad support inside the container.
- /dev/input/:/dev/input/:ro
# Host udev data required for input devices
- /run/udev/data/:/run/udev/data/:ro

# Store flatpak var files in a volume.
- steam-headless-var-lib-flatpak:/var/lib/flatpak/:rw

volumes:
steam-headless-var-lib-flatpak:

networks:
external-macvlan:
external: true
name: ${NETWORK_NAME}
9 changes: 2 additions & 7 deletions docs/compose-files/docker-compose.privileged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ services:
hard: 524288

# NETWORK:
## NOTE: If we do not use the host network, then physical device input is not possible
## and your USB connected controllers will not work in steam games.
## NOTE: With this configuration, if we do not use the host network, then physical device input
## is not possible and your USB connected controllers will not work in steam games.
network_mode: host
hostname: ${NAME}
extra_hosts:
Expand Down Expand Up @@ -49,8 +49,3 @@ services:
# Input devices used for mouse and joypad support inside the container.
- /dev/input/:/dev/input/:ro

# Store flatpak var files in a volume.
- steam-headless-var-lib-flatpak:/var/lib/flatpak/:rw

volumes:
steam-headless-var-lib-flatpak:
57 changes: 2 additions & 55 deletions docs/docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,55 +41,6 @@ Create a Steam Headless `/opt/container-services/steam-headless/docker-compose.y
Populate this file with the contents of the default [Docker Compose File](./compose-files/docker-compose.default.yml).


## CONFIGURE HOST:

It is recommended that you configure this container to use a Macvlan network. If you know what you are doing, you can also use an IPvlan or Host, but I will not be covering that setup in this documentation.

To simplify the setup process and allow you to reuse the created Macvlan for other containers, we will create this Macvlan manually rather than have Docker compose handle it. If you know what you are doing with Docker compose and you would rather have the Macvlan managed there, feel free to do so. Otherwise run this command and carry on with the setup:

### 1) Discover your parent network:
To find the parent network device, run the command `ip address show`. Find the device that has the IP address of your Host server.
```
root@Tower:~# ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
link/ipip 0.0.0.0 brd 0.0.0.0
3: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc fq master br0 state UP group default qlen 1000
link/ether 7c:11:a9:b1:15:b9 brd ff:ff:ff:ff:ff:ff
4: eth0.1@eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0.1 state UP group default qlen 1000
link/ether 7c:11:a9:b1:15:b9 brd ff:ff:ff:ff:ff:ff
5: eth0.3@eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0.3 state UP group default qlen 1000
link/ether 7c:11:a9:b1:15:b9 brd ff:ff:ff:ff:ff:ff
6: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 7c:11:a9:b1:15:b9 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.43/24 brd 192.168.1.255 scope global dynamic noprefixroute br0
valid_lft 440sec preferred_lft 365sec
```
In this example output, I will select br0 as the parent network device which has the IP address of "192.168.1.43".

### 2) Create a macvlan Docker network
```
# Set the parent network device.
NETWORK_PARTENT=br0
# Name this whatever you like, but ensure you update the `.env` file below to match.
NETWORK_NAME=steam-headless-vlan
# Choose a network subnet and gateway that matches your host network
NETWORK_SUBNET=192.168.1.0/24
NETWORK_GATEWAY=192.168.1.1
# Execute the docker network create command
sudo docker network create -d macvlan \
--subnet=${NETWORK_SUBNET:?} \
--gateway=${NETWORK_GATEWAY:?} \
-o parent=${NETWORK_PARTENT:?} \
${NETWORK_NAME:?}
```


## CONFIGURE ENV:

Create a Steam Headless `/opt/container-services/steam-headless/.env` file with the contents found in this example [Environment File](./compose-files/.env).
Expand All @@ -105,9 +56,5 @@ sudo docker-compose up -d --force-recreate
```

After container executes successfully, navigate to your docker host URL in your browser on port 8083 and click connect.
http://<host-ip>:8083/
![img.png](../images/vnc_connect.png)

If using a `/mnt/games` volume mount, wait until Steam installs and executes, then restart the container. This step
is necessary to create the required steamapps folder in the /mnt/games volume after initial installation. If this
doesn't occur, you will receive a "disk write error" when trying to install to this location.
`http://<host-ip>:8083/`
![img.png](./images/web_connect.png)
File renamed without changes
Binary file added docs/images/web_connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Once your Flatpak refresh is complete, everything should work correctly and your

## An error occurred while installing <game>: "disk write error"

![img.png](../images/disk_write_error.png)
![img.png](./images/disk_write_error.png)

1) Stop the container
2) Verify your mounted /mnt/games volume is owned by the executing UID/GID, and 777 permissions are set.
Expand Down
Binary file removed images/vnc_connect.png
Binary file not shown.

0 comments on commit f4cad0a

Please sign in to comment.