If you’re new to Tiny Core Linux, one of the first things you’ll notice is how lightweight it is. You may also have wondered if it could be used as a highly efficient server on low-power hardware.
Today, it’s still possible to boot this modern Linux OS on just 64MB RAM, or, 96MB RAM with a fully functional GUI:
Tiny Core Linux RAM Usage (Terminal)
Tiny Core Linux RAM Usage (GUI)
Running a modular OS like this as a server or desktop system leaves a lot of CPU, memory and storage to focus on your applications. Whilst I am also a Windows user, admin, and developer, the contrast between the default set of loaded processes in modern versions of Windows Server and Tiny Core Linux on a fresh installation is like night and day. Most of the processes in Windows are idle, but they can use significant memory, and if they’re not essential, it’s best not to have them present at all. It shouldn’t require gigabytes of RAM just to get the OS in a state where it can happily run a basic HTTP server.
Differences to Other Linux Distributions
There are a few differences from other Linux distributions to deal with when you first start using Tiny Core Linux. Here I’ll change some behaviour so it works like others, by:
- Preventing local auto-login of the
tc
account - Permanently setting the passwords for
root
andtc
accounts - Ensuring certain changes are persistent and can survive reboots
- Booting the device in text-only mode, even if you’ve chosen the default GUI (FLWM), which has no login banner by default
- Configuring the locale and keyboard language
- Changing the hostname from box
- Disabling DHCP and using a static IP address
Initially, we need to make some changes which require root access.
Switch to Root
To start, switch to the root user as you normally would, by typing:
sudo su
Update the Boot Options
Next, edit (using the vi editor if necessary), the file named:
/mnt/sda1/tce/boot/extlinux/extlinux.conf
Find the boot flags (the line that starts with APPEND quiet
), and add:
host=myhost noautologin text nodhcp lang=en kmap=qwerty/uk
To change the hostname, simply swap myhost
for the hostname you prefer.
If you want to continue to use DHCP, then remove nodhcp
. If you choose to use a static IP, you’ll need to add some lines to /opt/bootlocal.sh
, such as:
pkill udhcpc
ifconfig eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255 up
route add default gw 192.168.0.1
echo nameserver 192.168.0.1 >> /etc/resolv.conf
You can add other entries to this file too, such as enabling port forwarding, setting up iptables/ip6tables, configuring NTP, and more. Note that even if the file is saved, no changes are permanent unless the correct tool is used to back them up.
You’ll now be booting straight into text mode, but if you want to load and go to the desktop, that is as simple as typing this in the Terminal:
startx
Ensure User Changes Persist
We now need to ensure our changes survive reboots. Add the following to /opt/.filetool.lst (note, no leading slashes on each line):
etc/group
etc/passwd
etc/shadow
etc/sudoers
This will ensure those files are backed up later.
Now, stay in sudo mode, and change the passwords for tc
and root
:
passwd
passwd root
Save and Reboot
It’s important to ensure the system boots properly after a power outage. So, save all the changes and restart:
filetool.sh -b
reboot
The system should then come back up, prompting you to log in as any user, rather than forcing the tc
user to be logged in.
Notes on Accounts
It is fine to add new, restricted accounts after this in the normal Linux way, and the tc
account can have its password set, but it should never be deleted. This account is part of a special group that handles installation of software, and it needs be able to switch to superuser without prompts getting in its way. It may be prudent to treat it similar to the root
user, but only use it to handle installations.