The guide below shows how to configure a laptop to automatically boot and launch Pico 8. The laptop will shutdown when the SHUTDOWN command is issued in Pico 8 console.
- Laptop supporting Ubuntu 22.04 Server: x86/64 or arm32/64 (I used the Asus Vivobook Go 12.)
- Disk space required: 4GB (8GB is better)
- Pico 8 License
If Windows is installed use MMC / Disk Management to shrink the Windows partition. Install Ubuntu 22.04 Server (e.g. USB - press ESC or F2 to enter bios);
After booting the Ubuntu 22.04 Server Installer:
- Select Install Ubuntu Minimal
- If you want to keep Windows, make sure you are not overwriting the partition. Ubuntu will dual-boot if not installed on a full disk.
- During installation, configure the administrative user. You will use this to update Pico8, etc.
- You may want to install OpenSSH Server if you'd like to
sshto /scpfrom the Pico8 Laptop.
Either log-on to local console or, if OpenSSH was installed, remote in using ssh.
sudo apt install xinit xterm alsa-utils mingetty unzipThe p8 user will run Pico8. Auto-logon will be configured as well.
sudo useradd -m -s /bin/bash p8
sudo passwd p8
sudo usermod -aG sudo p8
sudo usermod -aG audio p8
alsamixersudo reboot nowTo test speakers use either of the following:
speaker-testalsabat-test
Press Ctrl+C to stop.
startx xterm
Move mouse to go over the terminal and press Ctrl+D to exit.
Taken from https://askubuntu.com/questions/168706/how-do-i-auto-login-as-root-into-the-tty-upon-boot:
sudo su
mkdir -p /etc/systemd/system/[email protected]
cat > /etc/systemd/system/getty\@tty1.service.d/override.conf <<- "_EOF_"
[Service]
ExecStart=
ExecStart=-/sbin/mingetty --autologin p8 --noclear tty1
_EOF_
systemctl enable [email protected]
Reset and test auto-logon:
reboot now
After reboot, p8 user should automatically log-in (no password required).
Important:
- To switch to another terminal/user at any point: Ctrl+Alt+F2 (or F3-F6).
- To terminate pico8 from another console:
sudo killall pico8
We will use Chromium to log-on to and download Pico8.
sudo snap install chromium
startx chromiumDownload your Linux purchased copy of Pico-8 from https://www.lexaloffle.com/. Match your CPU architecture (x64 is most common.)
Exit Chromium and search for your download:
find ~/snap | grep picoCopy the zip file to p8's home folder. Extract the linux pico-8 into ~/pico-8.
Note Press TAB to autocomplete file names. Folder names must match in order for auto-run to work.
cd ~
cp <location_of_pico8_zip> .
unzip pico-8<version>.zipNote to eliminate mature content, you need to pass -splore_filter 1
cd ~/pico-8
startx ./pico8 -fullscreen_mode 0 [-splore_filter 1]To exit Pico8, type SHUTDOWN.
You can also use nano or any other editor. At a minimum, fullscreen_method must be set to 0 for input to work in xinit/startx:
vim ~/.lexaloffle/pico-8/config.txt
Note Likely cause for fullscreen_method is that SDL2 requires a Window to work: (https://stackoverflow.com/questions/44777929/sdl2-keyboard-detection-doesnt-work)
cat > ~/.xinitrc <<- "_EOF_"
cd ~/pico-8
./pico8 -fullscreen_method 0 -splore_filter 1
shutdown now
_EOF_cat > ~/.bash_login <<- "_EOF_"
startx
_EOF_Restart the system:
sudo reboot nowThe system should now auto-boot Ubuntu, auto-login p8 and start Pico8.
When you SHUTDOWN pico8, your computer should also shutdown.
In case you need to make changes, at any time you can log-in with the administrator user you've configured during Ubuntu install to another console:
- Ctrl+Alt+F2 (to F6)
- Log-on with admin user
During boot, you will see a menu for GNU GRUB. Select Windows Boot Manager to go back to windows.
When you restart Windows, the menu goes back to Ubuntu default.
By default, GRUB will wait for 10 seconds for the user to make a selection. This is changing to 1 second. Note that 0 means default.
Use the Recovery step to log-on to another console.
sudo vim /etc/default/grubEdit the file to change GRUB_TIMEOUT=1
sudo update-grubFrom https://askubuntu.com/questions/10290/how-do-i-improve-boot-speed Use the following to identify long-running tasks during start-up.
systemd-analyze
systemd-analyze critical-chain
systemd-analyze blameA few services I have disabled. It's important to maintain the Internet, Wifi services to allow splore access.
sudo systemctl disable snapd.service --now
sudo systemctl disable snap.lxd.activate.service --now
sudo systemctl disable snapd.seeded.service --now
sudo systemctl disable cloud-init.service --now
sudo systemctl disable cloud-final.service --now
sudo systemctl disable cloud-init-local.service --now
sudo systemctl disable snapd.apparmor.service --now
sudo systemctl disable cloud-config.service --now
sudo systemctl mask systemd-networkd-wait-online.service