Top Banner
Brown Bag Guess what’s the topic? :D 2013-11-15
21

Install Archlinux in 10 Steps (Sort of) :)

Jan 25, 2015

Download

Technology

Sian Lerk Lau

Step by step guide to set up Archlinux in Virtualbox.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Install Archlinux in 10 Steps (Sort of) :)

Brown BagGuess what’s the topic? :D

2013-11-15

Page 2: Install Archlinux in 10 Steps (Sort of) :)

I’m introducing you how to build a….

Page 3: Install Archlinux in 10 Steps (Sort of) :)

SORT OF

Page 4: Install Archlinux in 10 Steps (Sort of) :)

Build [a lie]

[Set up] a Linux OS

Page 5: Install Archlinux in 10 Steps (Sort of) :)

Let’s look at some terms

● Distributions (Distros)● Package Managers

Page 6: Install Archlinux in 10 Steps (Sort of) :)

Distros

● Red Hat / Fedora● Debian / Ubuntu / Mint● and mooooooooore...

Page 7: Install Archlinux in 10 Steps (Sort of) :)

Package Manager

Handles dependenciesFormat usually are source or binary.

Source● portage - src

Binaries● apt - deb● yum - rpm● pacman - tar.gz● and moooooooore...

Page 8: Install Archlinux in 10 Steps (Sort of) :)

Build [a lie]

[Set up] a Linux OS

from scratch

Page 9: Install Archlinux in 10 Steps (Sort of) :)

Benefits?

What’s the benefits of setting up a linux OS from scratch?

Page 10: Install Archlinux in 10 Steps (Sort of) :)

Setting up a Linux OS from scratch often like building a houseOften it is very trivial a.k.a. mafan

Page 11: Install Archlinux in 10 Steps (Sort of) :)

So instead of building one, we often choose to purchase one.We choose to install a Linux OS with packages pre-installed.

Often it is a bloated, gluten OS.

Page 12: Install Archlinux in 10 Steps (Sort of) :)

So.. How ah?[Set up] a Linux OS from scratch

in 10 steps +/-

Page 13: Install Archlinux in 10 Steps (Sort of) :)

A simple, lightweight distribution

Page 14: Install Archlinux in 10 Steps (Sort of) :)

Let’s do it!1. Storage

○ Partition○ Format○ Mount

2. OS○ Base system○ File system table○ Initial Ramdisk Env○ Initial configurations○ Boot loader

3. Moooooore○ New user account○ Windows (not that WindowsTM)

in 10 steps +/-

Page 15: Install Archlinux in 10 Steps (Sort of) :)

0. Set Up VM

● Create a new VM● Attach ISO to the VM as storage● Start!

Page 16: Install Archlinux in 10 Steps (Sort of) :)

1. StoragePartition$ cfdisk <Storage-Device-Name>

Format $ mkfs.ext4 <Storage-Partition-Name>

$ mkswap <Storage-Partition-Name>

Mount$ mount <From> <To>

$ swapon <Storage-Partition-Name>

More: https://wiki.archlinux.org/index.php/Partitioning

$ cfdisk /dev/sda

$ mkfs.ext4 /dev/sda1

$ mkswap /dev/sda2

$ mount /dev/sda1 /mnt

$ swapon /dev/sda2

Page 17: Install Archlinux in 10 Steps (Sort of) :)

2. OS (Part 1 of 3)

Base System$ pacstrap -i <OS-Drive> base

File system table$ genfstab -U -p <OS-Drive> >> <OS-Drive>/etc/fstab

“Enter the OS”$ arch-chroot <OS-Drive>

Initial Ramdisk Environment$ mkinitcpio -p linuxfstab: https://wiki.archlinux.org/index.php/Fstabchroot: https://wiki.archlinux.org/index.php/Chrootinitrd: https://wiki.archlinux.org/index.php/mkinitcpio

$ pacstrap -i /mnt base

$ genfstab -U -p /mnt >> /mnt/etc/fstab

$ arch-chroot /mnt

$ mkinitcpio -p linux

Page 18: Install Archlinux in 10 Steps (Sort of) :)

2. OS (Part 2 of 3)

Initial configurations# Set timezone

$ ln -s /usr/share/zoneinfo/<Continent>/<City>

# Set clock

$ hwclock --systohc --utc

# Set hostname

$ echo archieVM > /etc/hostname

# Enable dhcp client

$ systemctl enable dhcpcd

# Set password for root

$ passwd

$ ln -s /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime

$ hwclock --systohc --utc

$ $ echo archieVM > /etc/hostname

$ systemctl enable dhcpcd

$ passwd

Page 19: Install Archlinux in 10 Steps (Sort of) :)

2. OS (Part 3 of 3)

Boot loader$ pacman -S <package>

$ grub-install --target=<architecture> --recheck <Storage-Device-Name>

$ grub-mkconfig -o <grub-config-location>

Restart!$ exit

$ reboot

fstab: https://wiki.archlinux.org/index.php/Fstabinitrd: https://wiki.archlinux.org/index.php/mkinitcpio

$ pacman -S grub

$ grub-install --target=i386-pc --recheck /dev/sda

$ grub-mkconfig -o /boot/grub/grub.cfg

$ exit

$ reboot

Page 20: Install Archlinux in 10 Steps (Sort of) :)

3. More (Part 1 of 2)

Create new user account$ useradd -m -G <other-groups> <username>

$ passwd <username>

Windows $ pacman -S xorg-server xorg-server-utils xorg-xinit mesa xf86-video-vesa alsa-utils mesa-libgl

$ pacman -S openbox

Restart$ rebootX-Windows: http://en.wikipedia.org/wiki/X_Window_SystemOpenbox: https://wiki.archlinux.org/index.php/Openbox

$ useradd -m -G users sianlerk

$ passwd sianlerk

$ pacman -S xorg-server xorg-server-utils xorg-xinit mesa xf86-video-vesa alsa-utils mesa-libgl

$ pacman -S openbox

$ reboot

Page 21: Install Archlinux in 10 Steps (Sort of) :)

3. More (Part 2 of 2)

Windows <logged in as non-root>

$ echo exec openbox-session > ~/.xinitrc

$ startx

<logged in as sianlerk>

$ echo exec openbox-session > ~/.xinitrc

$ startx