Easily install Arch Linux in VirtualBox

Adapted from a forum post by antechdesigns at discourse.bigdaddylinux.com

Download archlinux and boot up Virtualbox with the archlinux.iso selected:

You should see something like this:

PARTITION & FORMAT THE DRIVE

The hardest part of any archlinux install is setting up your hard disks. Since this is a virtualbox we only have one disk to deal with.

You can check this with lsblk

sda 8:0 0 15.4G 0 disk is the one one we created when setting up virtualbox. Let’s use that disk to install archlinux:

cfdisk /dev/sda and select dos

Use the arrow keys to navigate cfdisk. Using the free space select: New

Here we will use the whole disk, 15.4G in my case. Press enter.

Select [ Primary ] and press Enter.

Select [ Bootable ] and press Enter.

Select [ Write ] and press Enter.

Type yes and press Enter.

Now you can quit out of cfdisk.

As you can see on disk sda we have are partition we just created, sda1.

From here on in it’s just a case of editing, creating files.

TIP: Saving files with nano:
ctrl+x then y then enter

MOUNT THE FILESYSTEM

mkfs.ext4 /dev/sda1

mount /dev/sda1 /mnt

INSTALL ARCH LINUX BASE PACKAGES

pacstrap -i /mnt base base-devel

CONFIGURE FSTAB AND CHROOT /MNT

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

cat /mnt/etc/fstab

arch-chroot /mnt

CONFIGURE LANGUAGE AND LOCATION

nano /etc/locale.gen

uncomment your locale (i.e.): en_GB.UTF-8 UTF8

locale-gen

SET YOUR TIME ZONE

ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime

hwclock --systohc --utc

CONFIGURE THE REPOSITORY

nano /etc/pacman.conf

Uncomment the lines:

[multilib]
include = /etc/pacman.d/mirrorlist

pacman -Sy check multilib is working

SET HOSTNAME & NETWORK

echo yourhostname > /etc/hostname

nano /etc/hosts

127.0.0.1 localhost
::1 localhost
127.0.1.1 yourhostname.localdomain yourhostname

SET ROOT PASSWORD AND CREATE NEW USER

passwd

useradd -m -g users -G wheel -s /bin/bash yourname

passwd yourname

ALLOW THE USERS IN WHEEL GROUP TO BE ABLE TO PREFORM ADMINISTRATIVE TASKS WITH SUDO

EDITOR=nano visudo

Uncomment the line: %wheel ALL=(ALL) ALL

INSTALL AND CONFIGURE BOOTLOADER

mkinitcpio -p linux

pacman -S grub

grub-install /dev/sda

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

UNMOUNT THE PARTITIONS AND REBOOT

exit

umount -R /mnt

reboot

CHECK YOUR INSTALL

Select Boot existing OS

see if you can log in with your user name and password you created

SUCCESS !! ????

…to be continued

Comments

Notable Replies

  1. Very nice. Much better than the installation docs on the wiki.

  2. It was better when they had the beginners guide as you could pretty much just use the examples in the guide and not have to jump around to different pages like now.

    Anyway, great guide.

Continue the discussion at discourse.bigdaddylinux.com

4 more replies

Participants

Recent Posts

Recent Comments

Post comments are integrated with our Discourse forum. Each posts links to the specific discussion thread or you can visit the forum directly at https://discourse.bigdaddylinux.com/