I set up the base system components of Arch on a VM recently, here are the notes on one of the many ways of doing this.
So bear in mind that these notes in places are relative to me.
Download Here: Arch Linux Source Download Page
1 – Initial Shell Prompt
After being presented with a shell prompt where you are automatically logged in as root. Begin by setting the keyboard language to your relevant country.
The shell in use is Zsh.
Show the possible keyboard layouts available with this command.
To set it use
loadkeys plus your keyboard layout choice:
The dhcpcd network daemon starts automatically during boot, and it will attempt to start a wired connection by default.
ping to check connectivity.
In a Virtual Machine that shares the host’s network connection, the
ping should be successful as long as the host itself is connected and working, when using a bridged hardware network setting. If not this then… improvise.
2 – Partitioning
This will list all devices connected to your system along with their partition schemes, including those used to host and boot live Arch installation media (e.g. a USB drive). Not all devices listed will, therefore, be viable or appropriate mediums for installation. To filter out inappropriate results, use this
Devices (e.g. hard drives) will be listed as sdx, where x is a lower-case letter starting from a for the first device (sda), b for the second device (sdb), and so on. For the VM only one device is available (sda) which is the allocated host hard drive space.
Open the device (host HDD) that the partition table is to be created with and create a new MBR/msdos partition table for BIOS systems. All done using the following command:
Here I’m making two partitions in total for the VM. The first with line
1 and second with line
You can run the earlier
grep pattern again to see the newly created partitions.
parted instead to see the partition table.
3 – Filesystems
The boot filesystem is formatted and placed on the first partition created (smaller of the two) with:
The root filesystem is formatted on the other main partition now via:
4 – Mounting
This will mount the main partition:
Make a boot directory in
/mnt/ which is now mapped/mounted to
Mount the boot partition to the newly created boot sub-directory in the main root partition.
5 – Mirrors & System Packages
Begin by appending the system’s mirrorlist file name with .orig and the
rankmirrors on the aforementioned file with the
-n parameter to find and redirect the fastest 6 mirrors into a new mirrorlist file.
Note: This takes several minutes to process and complete, have faith and wait…
After this use
pacman to update and sync the systems package listings.
“Whenever you change your mirrorlist, refresh all package lists with pacman, to ensure that the package lists are updated consistently.”
Next install all the system’s base packages. Time to download packages will vary on your internet connection and the respective mirrors.
-i parameter to this command enables a prompt for every package to be installed during the process, if preferred.
Copy the mirrorlist(s) from earlier over also.
6 – fstab
Here generate fstab like so in this directory:
7 – chroot
chroot into a bash shell in
8 – hostname
hostname to today’s date, or whatever you prefer.
9 – localtime
localtime to London’s current time (obviously change this in relation to your own timezone.)
10 – locale
Locales define which language the system uses and other regional considerations like currency denomination, numerology and character sets.
vi do this:
Uncomment the relevant language you wish to use (UTF-8 support recommended).
Then generate the locales.
/etc/locale.conf file does not exist by default. Create it, where
LANG refers to the first uncommented entry in
/etc/locale.gen from earlier.
See the next command for an example:
Lastly export the chosen locale.
11 – passwd
Change the root user’s password for the VM.
12 – GRUB Bootloader
Here installation with GRUB and MBR/msdos is demonstrated.
grub package and then run
grub-install to install the bootloader:
/dev/sdato reflect the drive you installed Arch on if needed. Do not append a partition number, and do not replace it with “sdax” either.
Next automatically generate the main grub config file.
13 – unmount & reboot
Exit from the chrooted shell environment:
While partitions are unmounted automatically by systemd on shutdown, you may do so manually with the next command as a safety measure.
Finally if using a CD image you may have to remove it from your VM manager software, before rebooting.
“Your new Arch Linux base system is now a functional GNU/Linux environment ready to be built into whatever you wish or require.”