Tricks Of The Trades

Arch Linux VM Main System Installation

This is a continuation of the previous post on installing the base components of Arch.

Except for this time I’m detailing the next steps of setting up the main system environment.

1 – Initial Login

Log into the system we created in the previous post this time on the actual file-system we generated (i.e. without the boot media), using the one and only root account currently in existence. Test to see if you have a working internet connection again by using Ping.

[alert-announce]

  1. $ ping -c 5 www.google.co.uk
  2. $ ping -c 5 8.8.8.8

[/alert-announce]

If you get ping: unknown host www.google.co.uk or connect: Network is unreachable for either of these commands then you need to do the rest of this step (1).

If everything looks fine and you are sending plus receiving through ping with a working internet connection, then move on to step 2 instead.

Find your Ethernet interface name (virtual VM shared host connection interface in this case) using:

[alert-announce]

  1. $ ip link

[/alert-announce]

If you are unsure of the name, your Ethernet interface you are looking for is likely to start with the letter “e”, and unlikely to be “lo” or start with the letter “w”.

arch linux setup

In my case, my interface was named “eno167777736”. So I’ll use that as the example here.

Next, make sure the interface is up and running with this command syntax:

[alert-announce]

  1. $ ip link set eno16777736 up

[/alert-announce]

Substituting the interface name ID with your own.

Then start and enable dhcpcd.service with systemctl.

[alert-announce]

  1. $ systemctl enable dhcpcd.service
  2. $ systemctl start dhcpcd.service

[/alert-announce]

Attempt a ping once again and this time it should succeed, with the internet connection working correctly.

If despite this there’s no change, try the previous commands again, but this time specifying the interface name in the command like this:

[alert-announce]

  1. $ systemctl enable [email protected]
  2. $ systemctl enable [email protected]

[/alert-announce]

If still, no joy here are some resources that might prove useful. Remember these links are not in the context of a VM installation, however.

2 – pacman.conf

If using a 64-bit system begin editing the /etc/pacman.conf with nano.

If not using a 64 bit system then move onto Step 3 now.

[alert-announce]

  1. $ vi /etc/pacman.conf

[/alert-announce]

Now uncomment the two following lines in this file:

[alert-announce]

  1. [multilib]
  2. Include = /etc/pacman.d/mirrorlist

[/alert-announce]

After doing this write/save to the file and exit it.

When back at the shell prompt sync and refresh repositories with pacman by running:

[alert-announce]

  1. $ pacman -Sy

[/alert-announce]

3 – User Creation

Make another user account here so root isn’t the default account in use all the time (bad practice to do so), whilst at the same time adding it to some groups.

Note: There are no spaces present between the groups listed in this next command.

[alert-announce]

  1. $ useradd -m -g users -G wheel,storage,power,sys,adm -s /bin/bash scarlz

[/alert-announce]

Set the password for the new user that has just been created.

[alert-announce]

  1. $ passwd scarlz

[/alert-announce]

Install sudo with pacman if it did not install as part of your previous base Arch set-up.

[alert-announce]

  1. $ pacman -S sudo

[/alert-announce]

If you ever want to see a list of packages related to a search term, you could type the following command, where the package name specified at the end is the “search term”.

[alert-announce]

  1. $ pacman -Ss sudo

[/alert-announce]

Now sudo is installed on the system we need to enable it for users belonging to the wheel group in the sudoers file to gain privileges.

[alert-announce]

  1. $ EDITOR=vi visudo

[/alert-announce]

Find the “user privilege specification” section and uncomment the following line so it looks like this:

[alert-announce]

  1. %wheel ALL=(ALL) ALL

[/alert-announce]

After doing so hit CTRL+X then y and then ENTER.

I’m also going to install bash-completion here to help out before moving onto the next step.

[alert-announce]

  1. $ pacman -S bash-completion

[/alert-announce]

4 – VMware Tools

I’m using Vmware as my virtualisation software in this instance, so here’s how to install the official VMware tools.

[alert-announce]

  1. $ pacman -S base-devel net-tools linux-headers

[/alert-announce]

Press ENTER for the default All if prompted by the base-devel package.

Some Xorg Vmware related dependencies.

[alert-announce]

  1. $ pacman -S xf86-input-vmmouse xf86-video-vmware mesa

[/alert-announce]

Then, create bogus initialization directories for the installer:

[alert-announce]

  1. $ for x in {0..6}; do mkdir -p /etc/init.d/rc$x.d; done

[/alert-announce]

The VMware installer then needs to be mounted in our Arch system:

[alert-announce]

  1. $ mount /dev/cdrom /mnt

[/alert-announce]

If you have errors here make sure your VMware software (Workstation in my case) has the latest tools downloaded and updated, and try running VMware “as an Administrator” if using Windows.

After this is successfully mounted extract it to /root .

[alert-announce]

  1. $ tar xf /mnt/VMwareTools*.tar.gz -C /root

[/alert-announce]

Run the perl script to install the extracted VMware tools.

[alert-announce]

  1. $ tar xf /mnt/VMwareTools*.tar.gz -C /root

[/alert-announce]

$ perl /root/vmware-tools-distrib/vmware-install.pl

You can safely ignore the following build failures:

  • VMNEXT 3 virtual network card
  • “Warning: This script could not find mkinitrd or update-initramfs and cannot remake the initrd file!”

Reboot the Virtual Machine:

[alert-announce]

  1. $ systemctl reboot

[/alert-announce]

Log in and start VMware Tools:

[alert-announce]

  1. $ /etc/init.d/rc6.d/K99vmware-tools start

[/alert-announce]

5 – Xorg

“Xorg is the public, open-source implementation of the X window system version 11. Since Xorg is the most popular choice among Linux users, its ubiquity has led to making it an ever-present requisite for GUI applications, resulting in massive adoption from most distributions.”

Now comes the part where we are going to install X server.

Note: To use Xorg in a Virtual Machine, a minimum of 32MB VGA memory is needed.

Install Xorg and some of its companion packages using pacman once again like so:

[alert-announce]

  1. $ pacman -S xorg-server xorg-xinit xorg-server-utils

[/alert-announce]

Finally, in this section install the default X environment to ensure that all the x-org components we’ve installed prior to this are functioning correctly.

[alert-announce]

  1. $ pacman -S xorg-twm xorg-xclock xterm

[/alert-announce]

Type startx to run the X environment.

[alert-announce]

  1. $ startx

[/alert-announce]

arch linux setup guide

Display & Window Manager

Another forthcoming post will go into depth on how to install a tiling window manager (bspwm) and configure .xinitrc to serve as a display manager. With the exception of this being done in the context of a live system, and not a VM.

Alternatively, find and research another window manager/desktop environment from the Arch-wiki to setup and install.

Write A Comment