Configure-Ubuntu
Install Ubuntu Server
Download an ISO, use Rufus to install it to a flash drive (over 4gb probably)- install to a target machine.
1. credentials:
- user: admin
- password: *********
2. update packages when logging in. This will all require an internet connection.
sudo apt update && apt upgrade
install I3wm (Minimal Window Manager)
-
sudo apt install i3
- install xorg (for x-windows session environment.)
sudo apt install xorg
- Then we need to tell X to use I3wm:
echo "exec i3" >> ~/.xinitrc
- your xinitrc is also the file we’ll configure later.
- then we run an x session:
startx
- This will open our x session, which will run I3wm.
- Do you want to generate a config?
- defaults to
/home/dev/.config/i3/config
- for your default modifier, i suggest “Win” (your super key)
- defaults to
Great! you have ubuntu running, you have I3wm managing your windows. some quick shortcuts:
Key | Action |
---|---|
Super + Enter | Open Terminal |
Super + D | launch an application |
Super + F | Full screen switch |
Super + Shift + Q | Close a window (super important to remember this one when testing.) |
Super + shift + E | Exit I3 session. this is super useful since you’ll make the game boot on start- if you ever need to close the game to configure the OS, you may want to quit the game, then quit the i3 session. |
By default, I3WM has many shortcuts for windowmanagement. This makes sense because it’s primary purpose is to be a configurable window manager. In our case, we want to configure it to remove stuff, so that it appears to just be a game running with no GUI or anything else.
/etc/profile configuration (Start X/I3 when logging in)
You’ll find that when the computer reboots, your x session doesn’t magically start, you have to run it every time it boots. We will add a script that executes our X session when we log into TTY1 (default)
- Open our user profile:
/etc/profile
file-sudo nano /etc/profile
- And Add this snippet to the end of it:
<syntaxhighlight lang="bash">
if "$(tty)" == '/dev/tty1' ; then exec startx fi
</syntaxhighlight>
This will start our X session when tty1 logs in. This doesn’t enable autologin yet.
Users- Admin / Player
When our computer starts, we don’t want the player to be running in an administrative mode. We will want to create a “Player” user which only has permission to run our build. #todo: ADD DOCUMENTATION.
Getting your game running
There are some basic things to do when setting up the game, and when you add new builds to your machine. You need to make it part of a specific user group (for security!) and make it playable.
- Extract Game to a location
- #todo Extrapolate on where the build should go
- take a note of the location of your game.
- Add build to correct user group.
- #todo Extrapolate on adding to specific groups
- Make the build playable
- cd (change directory) to the folder where you placed the build.
- EG:
cd ~/Downloads/
- EG:
sudo chmod +x BUILDNAME.x86_64
chmod +x
is the same as right clicking on your file and setting “Allow executing as a program”
- cd (change directory) to the folder where you placed the build.
- Run the build to test that it works:
./BUILDNAME.x86_64
Run the game when we Login (Modifying XinitRC)
if you remember from above, xinitrc (X init file) is what we use to run i3. It is also what we’ll use to run our program.
- Open Our XinitRC file again
- your xinitrc file is usually in your home directory. (
cd ~/
) sudo nano .xinitrc
- your xinitrc file is usually in your home directory. (
- Add functions to run your game
exec i3 # this was already here if you followed the instructions above. & sleep 1 # adds a second between loading I3 with the game exec /URL/TO/BUILD.x86_64 #example: exec ~/Build/MyGame.x86_64
- The full URL is mandatory here- remember where you unzipped it.
- Save (Ctrl + S), Exit (Ctrl + X)
This will now be run when when your session starts. note that pressing Super+Shift+Q will not only close the game- it will also close the session.
Please Note!
You may want to do this part last since it means you can’t log in and modify stuff very easily. If you have already done this, another way to access your profile is by logging into TTY2+. This means pressing “Ctrl + Alt + F2/3/…” will allow you to switch to another terminal. Since our Xsession only starts on TTY1, we can safely work in another session without loading I3 or our build.
automatically Log in when computer starts.
This is important since you don’t expect a login screen when a computer starts. It can be a little more involved than it seems. Since we’re running Ubuntu Server, we don’t have a “display manager”- so we can’t just configure one. We’ll have to do it with SystemD:
To add a New Login Service
sudo systemctl edit getty@tty1.service
- This will automatically create a service file and open it in an editor (nano)
- add:
[Service] ExecStart= ExecStart=-/sbin/agetty --noissue --autologin myusername %I 38400 linux Type=idle
Make sure to Change $username to your username! (Eg: ‘Player’, if you’ve added a player account. otherwise, just the username you’ve been using.) 1. Save (Ctrl + S), Exit (Ctrl + x)
- Enable Start of the service
systemctl enable getty@tty1.service
Please Note!
Since you are now creating a loop: Computer On -> Login to Session -> Run I3 -> Run Game, when you Quit I3, you’ll be brought back to the “login” screen, however that will in turn Autologin once again. See the above note about changing to a different terminal (TTY2 for example) in order to make changes.
Remove the I3 Bar at the bottom.
Optionally, if you don’t want to see the Status bar at the bottom of the screen for the exactly 1 second that it shows between logging in and running the game, you can configure I3 to hide it.
- Open the I3 Config
sudo nano .config/i3/config
- This is our i3 Configuration. There are many options we can do here- and if you’re interested, i encourage you to read more about configuring I3 to change the default keybinds, etc.
- Add the Code for removing the Bar
- At the Bottom, locate the script that says:
bar { status_command i3status}
- replace it with:
- At the Bottom, locate the script that says:
bar { mode invisible }
If you reload I3, or restart, you’ll see that the bar doesn’t show up now.