Upload
sian-lerk-lau
View
365
Download
2
Embed Size (px)
DESCRIPTION
Step by step guide to set up Archlinux in Virtualbox.
Citation preview
Brown BagGuess what’s the topic? :D
2013-11-15
I’m introducing you how to build a….
SORT OF
Build [a lie]
[Set up] a Linux OS
Let’s look at some terms
● Distributions (Distros)● Package Managers
Distros
● Red Hat / Fedora● Debian / Ubuntu / Mint● and mooooooooore...
Package Manager
Handles dependenciesFormat usually are source or binary.
Source● portage - src
Binaries● apt - deb● yum - rpm● pacman - tar.gz● and moooooooore...
Build [a lie]
[Set up] a Linux OS
from scratch
Benefits?
What’s the benefits of setting up a linux OS from scratch?
Setting up a Linux OS from scratch often like building a houseOften it is very trivial a.k.a. mafan
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.
So.. How ah?[Set up] a Linux OS from scratch
in 10 steps +/-
A simple, lightweight distribution
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 +/-
0. Set Up VM
● Create a new VM● Attach ISO to the VM as storage● Start!
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
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
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
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
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
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