How to Get Started with Tiny Core Linux

Tutorial Nov 23, 2020

TinyCoreLinux is a super lightweight, highly modular Linux system which holds a lot of potential. With an iso file size of 14MB, TinyCoreLinux will catch just about anyone's attention.

It's best to read the core concepts of this project to get some basic understanding of how TinyCoreLinux behaves, and the philosophy behind its petiteness. As a newbie trying this out, I hope this guide will help other newcomers to TinyCoreLinux.

What we’ll be doing:

  • Install TinyCoreLinux (in Virtualbox)
  • Set a local static IP
  • Make it SSH ready

Ingredients required:

  • Virtualbox (version 6.1 was used while writing this guide)
  • TinyCoreLinux ISO (core version 11.1 was used while writing this guide)
  • Internet connection

Note: you will need an active internet connection during the installation of TinyCoreLinux

GETTING STARTED

Before creating and booting up the Virtual Machine with the downloaded ISO, we will first create a new virtual network adapter. Why? For conveniently setting up our static IP later. For this, launch the  "Host Network Manager" from the File menu of Virtualbox VM Manager and create a new "Host-Only Ethernet Adapter" with DHCP disabled.

Virtualbox Host Network Manager

Now we can create a new Virtual Machine with the VM creation wizard. Set Type as “Linux” and Version as “Other Linux (64-bit)”, give it a name, and proceed with the default settings for the rest of the VM creation process.

After creating the Virtual Machine, access its settings and connect the virtual network adapter we just created.

VM Settings

INSTALLING TINYCORELINUX

Now we can start the Virtual Machine with the downloaded ISO. It wont take that long for you to reach the [email protected]:~$ prompt. Run the following commands to start the installation process.

tce-load –wi tc-install
sudo tc-install.sh

Now, follow the onscreen prompts. First, choose 'c' to install from the cdrom,

Core Installation.

Install from [R]unning OS, from booted [C]drom, from [I]so file, or from [N]et.
(r/c/i/n): c

Choose 'f' for Frugal,

Select install type for /mnt/sr0/boot/core.gz

Frugal
* Use for frugal hard drive installation.
Note: You will be prompted for disk/partition and formatting options.

HDD
* Use for pendrives. Your BIOS must support USB-HDD booting.
* A single FAT partition will be made.
Note: Requires dosfstools extension.
Warning: This is a whole drive installation!

Zip
* Use for pendrives. Drive will be formatted into two FAT partitions.
* One small one for USB_ZIP boot compatability, and used to hold Tiny Core
* The remaining will be used for backup & extensions.
Note: Requirees dosfstools and perl extensions.
Warning: This is a whole drive installation!

Select Install type [F]rugal, [H]DD, [Z]ip. (f/h/z): f

Choose '1' to use the whole disk space.

Select Target for Installation of core

	1. Whole Disk
	2. Partition

Enter selection (1 - 2 ) or (q)uit: 1

Choose 'y' to install the bootloader, and when asked to allow installation of extensions press the enter key .

Would you like to install a bootloader?
Most people should answer yes unless they are trying to embed Core
into a different Linux distribution with an existing bootloader.

Enter selection ( y, n ) or (q)uit: y
Install Extensions from this TCE/CDE Directory: 

Choose "3" for ext4 formatting sda, and type in the boot options when you are asked to.

Select Formatting Option for sda

	1. ext2
	2. ext3
	3. ext4
	4. vfat

Enter selection ( 1 - 4 ) or (q)uit: 3
Enter space seperated boot options:
Example: vga=normal syslog showapps waitusb=5
user=penguin host=antarctica vga=normal showapps opt=sda1 home=sda1 waitusb=5

Last chance to exit before destroying all data on sda
Continue (y/..)? y

Wait a few seconds till TinyCoreLinux gets installed. You will know it's done when you see the "Press Enter key to continue." message. Now you can remove the disk from the virtual drive and reboot the virtual machine by running:

sudo reboot

SETTING UP A STATIC IP

Create the file /opt/eth1.sh

sudo vi /opt/eth1.sh

Note: if you are not comfortable with the vi text editor and is more of nano person, run the command tce-load -wi nano to download and install nano.

#!/bin/sh

sleep 10

# kill dhcp client for eth1
if [ -f /var/run/udhcpc.eth1.pid ]
then
    kill `cat /var/run/udhcpc.eth1.pid`
fi

# configure interface eth1
ifconfig eth1 192.168.10.11 netmask 255.255.255.0 broadcast 192.168.10.255 up

Note: those are not regular single quotes around cat /var/run/udhcpc.eth1.pid. they are backticks/backquotes (the key to the left of “1” on the keyboard)

Next, open /opt/bootlocal.sh for editing.

sudo vi /opt/bootlocal.sh

Add the following line to it, so that /opt/eth1.sh will run on system startup

#!/bin/sh
# put other system startup commands here

/opt/eth1.sh &

Set permission of /opt/eth1.sh to 775

sudo chmod 775 /opt/eth1.sh

INSTALL AND SET UP OPENSSH

First of all, we need to set a password for the current user.

sudo passwd penguin

Download and install openssh with the command:

tce-load –wi openssh

Open /opt/.filetool.lst for editing:

sudo vi /opt/.filetool.lst

Add the following lines to it:

opt
home
/etc/shadow
/usr/local/etc/ssh

Note: Remove the first two lines (opt and home) from this file. Why? Because,with our current boot options, both /opt and /home are already persistent (file changes persist after system reboots). There is no need to include them in the list.

Start openssh for the first time to generate the required public/private key pairs and all that good stuff.

sudo /usr/local/etc/init.d/openssh start

Open /opt/bootlocal.sh for editing.

sudo vi /opt/bootlocal.sh

Add the following line to it so that openssh can run on system startup

#!/bin/sh
# put other system startup commands here

/opt/eth1.sh &
/usr/local/etc/init.d/openssh start &

Run the following command to make the changes to the files and folders listed in /opt/.filetool.lst persist after system reboot.

filetool.sh -b

And finally, we can do a reboot.

sudo reboot

If everything went smoothly, we won’t need to struggle with typing into the VM anymore. we can use ssh to feed our little OS in a more productive way.

ssh [email protected]

Tags

Lime

Simple, like quantum physics.