Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Johners

[GUIDE] Installing Arch Linux on a VMWare Virtual Machine

Recommended Posts

Posted · Original PosterOP

Introduction

 

Arch Linux is a distribution of Linux targetted at individuals who want a minimalistic environment upon which they can create their own computing environment. Due to a lack of a GUI-based installer, anybody wanting to use Arch Linux is expected to use a command-line interface to install the entire system. This comes on top of having to actually learn and understand how Arch Linux, and Linux in general, works. The beauty of Arch Linux is that it is a purely rolling release and will update as and when software gets updated.

 

This guide is for people who want to try Arch Linux but aren't willing to make the jump on their desktop or laptop. Before we begin the installation process, there are a few requirements that will need to be met before following this guide in full. Firstly, this guide is based around using a VMWare Virtual Machine. You can download VMWare Workstation Player, a free version of the paid VMWare Workstation software for both Windows and Linux. Secondly, this guide is intended for systems booting in UEFI mode rather than Legacy BIOS mode. This support documentation from VMWare will help you in getting your Virtual Machine to boot in UEFI mode.

 

Table of Contents

  1. Installation (Part 1)
  2. Installation (Part 2)
  3. Setting up a User Account
  4. Installing a GUI
  5. Installing Common Software

Everytime I hit my funny bone unexpectedly it's like my own personal Pearl Harbour.


Don't call it a grave, it's the future you chose.


Project JAPC Build Log

Link to post
Share on other sites
Posted · Original PosterOP

Installation (Part 1)

 

Before we can begin installing Arch Linux, we need to have a machine up and running. This guide is intended for use with a VMWare Virtual Machine but you can follow along for a VirtualBox VM or a physical desktop or laptop computer. Not everybody has a high-end computer but 2 CPU Cores with 2-4 GB of RAM and a 20 GB HDD is enough.

 

Once you have the latest Arch Linux ISO downloaded, 2016.04.01 at the time of writing, boot off of that media on your Virtual Machine. Please ensure you have the VM or device booting in UEFI mode. This can be tested via a command once the installation media is fully booted but you can see this in VMWare by seeing a gray VMWare logo with no extra text on screen when initially booting.

 

Testing for a UEFI Boot

 

After you have booted into the installation media, you will be presented with a command-line interface that you can start typing commands into. We can use this to check if we are booted in UEFI mode rather than Legacy BIOS mode.

ls /sys/firmware/efi/efivars

If running this command provides a populated output, then you are booted in UEFI mode and you can continue with the installation. If you aren't getting a populated output, go and check the link provided in original post to get VMWare Virtual Machines to boot in UEFI mode. If you are using VirtualBox or a physical device, then search for that information online.

 

Keyboard Layout

 

The next thing we are going to do is set the keymap. This is the how the operating system is able to the hardware signals sent by the keyboard into the same letter, number or symbol that is present on the physical keys. By default this is set to the US keyboard layout so that should be fine for a large number of users on this forum but if you have the UK keyboard layout like I do, then you just need to type in the following command.

loadkeys uk

You can test to see if the keyboard layout is correct by typing into the CLI. The US and UK layouts, as an example, are very similar with the only real difference being the locations of the " and the @ symbol.

 

Connecting to the Internet

 

By default, a Virtual Machine will be provided with a wired connection by VMWare. What is good about this is that the dhcpcd daemon starts at boot on the Arch Linux installation media so you should already be connected to the internet. You can test this by trying to ping a website such as Google.

ping -c 3 www.google.co.uk

The output from this command should be just be a response of the ping to the server. If the requests are timing out then you may need to start the dhcpcd daemon manually running this command.

systemctl start dhcpcd.service

After this try running the ping command again and you should now have a network connection. If you are installing on a device that only has a wireless connection, a laptop for example, follow this article on the Arch Wiki.

 

Update the System Clock

 

It will also be a good idea to ensure the system clock is accurate. Systemd, the init system used by Arch Linux, has a tool that will keep the system clock up-to-date. This can be enabled by running this command.

timedatectl set-net true

You can use the command 'timedatectl status' to check the status of the service.

 

Preparing the Storage Device

 

The final step before installing Arch Linux onto the Virtual Machine is to provide storage space for the operating system to be installed onto. There are a wealth of tools that can do this on the Arch Linux installation utility but we are going to use cfdisk. Before we can create any partitions on the drive, we need to identify the drive that we are going to the system onto. This can be done via a simple command.

lsblk

Depending on the system you are installing this onto, you will get varied outputs. In the case of a Virtual Machine you should get the installation media and then the hard disk that was created for the VM during the setup process. This is an example output.

NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0    20G  0 disk
└─sda1            8:1    0    20G  0 part

You'll notice there is an sda and an sda1. sda is the storage device while sda1 is the first partition on that drive. If you are installing onto a freshly created Virtual Machine or a physical storage device with no partitions on it, then you should only see the sda.

 

Now that we have indentified the storage device, which will be sda in the case of the VMWare VM, we can begin creating the partitions by running this command.

cfdisk /dev/sda

Because this is a fresh storage volume, you'll be asked to select a partition table type. Due to this being a UEFI system, we will need to select GPT for the partition table. Once done you will then be provided with an interface that can be navigated with the arrow keys. The Up and Down keys are used to select partitions and free space while the Left and Right keys are used to highlight the option from the row at the bottom. Use the enter key to select that combination of partition/free space and option.

 

Creating the partitions can be done in a number of ways but for simplicity, a system with three partitions is enough. The first partition is for the EFI bootloader, the second is for the rest of the operating system and the third if for the SWAP space. You can use a SWAP file on Linux but traditionally systems will use a partition. In the case of a 20 GB storage device, you'd the partitions to be 0.5G, 17.5G and then 2G. You also need to set the types. With the /dev/sda1 being set as an EFI partition and then /dev/sda3 as a Linux Swap. Use the Left and Right arrow keys to select the write option and then use the quit option to go back to the normal CLI.

 

We can confirm that the partitions have been created by running lsblk again. This time the output should look similar to this.

NAME            MAJ:MIN RM   SIZE  RO TYPE MOUNTPOINT
sda               8:0    0    20G   0 disk
└─sda1            8:1    0    500M  0 part
└─sda2            8:1    0    17.5G 0 part
└─sda3            8:1    0    2G    0 part

Now we can format our partitions. The EFI partition needs to be FAT32 as that is specified within the UEFI standard for UEFI bootloaders. The main partition for all the system and user files is going to be ext4. The swap space will be formatted for swap and then enabled.

 

To create the EFI partition, run the following command.

mkfs.fat -F32 /dev/sda1

To make the ext4 partition for all the system files, run the following command.

mkfs.ext4 /dev/sda2

Finally, to create the swap. run the following commands.

mkswap /dev/sda3
swapon /dev/sda3

The final step before moving onto installing the system itself is to mount the partitions. This can be done by running the following commands.

mount /dev/sda2 /mnt
mkdir -p /mnt/boot
mount /dev/sda1 /mnt/boot

These commands mean that the 17.5G partition is mounted as the root for the file installation while the 0.5G EFI partition for the bootloader is mounted at /boot. This is needed for UEFI systems and we have to mount it at this stage so the installation goes correctly.

 

Continue onto Installation Part 2 to go through the installation process of the actual Arch Linux distribution onto the Virtual Machine or physical computer. If you have any questions, feel free to ask them below as a response.


Everytime I hit my funny bone unexpectedly it's like my own personal Pearl Harbour.


Don't call it a grave, it's the future you chose.


Project JAPC Build Log

Link to post
Share on other sites
Posted · Original PosterOP

Installation (Part 2)

 

Now that we have the system ready to install the base Arch Linux system, we are actually going to install the base set of packages.

 

Installing the Base System

 

Installing the base system and we'll be installing the base and base-devel packages so we can run any packages as well as build any package from the Arch User Repository (AUR) or directly from source code.

pacstrap -i /mnt base base-devel

This will fetch the latest versions of the packages from the Arch Linux repositories and install them onto your system. This should take 10-15 minutes if you have a reasonable internet connection. Once done all 180ish packages will be installed and you will be allowed to type another command into the CLI.

 

FStab Generation

 

Now we'll want to generate an fstab so the operating system will know how to mount our hard drive partitions once we boot. This can be done with the following command.

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

The file will now be saved be found in the /etc/fstab on the live system once the installation is done.

 

Change Root

 

This is where the fun begins. We will now enter our Arch Linux installation and begin to make changes to the install we will use once the work on the installation media is completed. We can gain access to the out actuall installation with the following command.

arch-chroot /mnt /bin/bash

You will see some changes to the CLI but this is fine as we are know in the root for our installation.

 

Locale Information

 

The locale defines which language our system will use as well as regional considerations such as currency demonintation. Uncomment the UTF-8 values you need /etc/locale.gen by removing the # symbol at the beginning of the line. You can access the locale.gen file with the following command.

nano /etc/locale.gen

It is recommended to uncomment en_US.UTF-8 and in my case I would also uncomment en_GN.UTF-8. Then press Control + X and then Y to save and close the file. You can then generate the locale files by running the following command.

locale-gen

We then need to create a file to set the default language of the system. In my case I would set en_GB.UTF-8 as the default and I uncommented the en_US option because some software, such as Steam, can complain when the US locale isn't available. Run the following command.

nano /etc/locale.conf

Now write the following line, which may vary depending on your default language, and then press Control + X and then Y to save.

LANG=en_GB.UTF-8

The final thing you may need to do is ensure the keyboard layout you set at the beginning of the installation is present at every boot on our live system once the installation is complete. Run the following command.

nano /etc/vconsole.conf

Then add the following line to the file.

KEYMAP=uk

Again this may vary depending on the keyboard layout you need but in the UK you would use this.

 

Time and Date

 

Now we will select a timezone and then set a symbolic link so the localtime is that of the timezone we selected. This can be done with the following commands.

tzselect
ln -s /usr/share/zoneinfo/Europe/London /etc/localtime

This is just an example. If you need to find out what your zone information would be, run the following the command to get a list of potential options.

timedatectl list-timezones

The final thing we will do here is set the hardware clock to the timezone we selected. This is done with the following command.

hwclock --systohc --utc

This will also set the hardware clock to UTC but the time and date will still be correct to that of your timezone.

 

Intel Microcode

 

Before we install the bootloader, it must be noted that users with an Intel CPU need to install the microcode package to ensure they have the latest microcode for their processor. This will fix any bugs with the firmware that runs within the CPU. This will be enabled in the next stage but the package can be installed by running the following command.

pacman -S intel-ucode

While we are running within a Virtual Machine and this isn't a requirement for these users, it was is worth pointing out for those following along with a laptop or desktop instead.

 

Installing a Bootloader

 

We will now install a bootloader so the operating system can actually boot once we have completed the installation. We could use something like grub which may be familiar with if you've used Ubuntu or Fedora in the past. However we are going to use systemd-boot which is basically Gummiboot but this is a part of systemd. To install systemd-boot, run the following command.

bootctl install

Now we have the bootloader installed, we need to configure it to actually boot our system. The first step is to change what the entry the bootloader looks for. This is done with the following command.

cd /boot/loader/loader.conf

Change the contents of the file so it reads like this. You can adjust the length of the timeout to suit your needs.

default  arch
timeout  10
editor   0

Now we need to create the arch entry so the bootloader will fully boot the system. Run the following command to open the file.

nano /boot/loader/entries/arch.conf

Then add the following to the contents of the file.

title          Arch Linux
linux          /vmlinuz-linux
initrd         /intel-ucode.img
initrd         /initramfs-linux.img
options        root=PARTUUID=14420948-2cea-4de7-b042-40f67c618660 rw

If you aren't an Intel CPU user, then don't add the intel-ucode line. The other thing to look out for is the PARTUUID. This is unique to each partition and you can find our the PARTUUID for /dev/sda2 using the following command.

ln -s /dev/disk/by-partuuid/

Write it down on a piece of paper or type it up on another program such as notepad so you can copy it over in one go without any errors.

 

Press Control + X and then Y to save the arch.conf. Your bootloader is now fully configured to boot your Arch Linux installation.

 

Configuring the Network

 

We're almost finished but we now need to configure the network so our hostname is fixed and communicated and so our device can actually connect to the internet. Run the following command to set the hostname.

nano /etc/hostname

We can then set the hostname to anything we like. As an example you could set it to the following.

Arch-Linux-Test

Then press Control + X and then Y to save the hostname file. This new hostname then needs to be appended to the localhost entries in /etc/hosts. You can access /etc/hosts with the following command.

nano /etc/hosts

The file will then look something like this once you have your hostname appended to it.

#
# /etc/hosts: static lookup table for host names
#

#<ip-address>	<hostname.domain.org>	<hostname>
127.0.0.1	localhost.localdomain	localhost	 Arch-Linux-Test
::1		localhost.localdomain	localhost	 Arch-Linux-Test

We then need to enable the network connection. For a virtual machine or a wired connection, run the following command.

systemctl enable dhcpcd.service

Your wired network connection is ready and you can now continue to the final stage.

 

Root Password

 

The final stage is to set a password for the root account. This can be done with the following command.

passwd

Make sure to remember this password as we'll need this when we reboot into the Arch Linux installation we've spent some time setting up. You can now exit the arch-chroot, unmount the partitions and reboot your computer with the following commands.

exit
umount -R /mnt
reboot

If you have any questions feel free to ask them. You can now continue to the next stage.


Everytime I hit my funny bone unexpectedly it's like my own personal Pearl Harbour.


Don't call it a grave, it's the future you chose.


Project JAPC Build Log

Link to post
Share on other sites
Posted · Original PosterOP

Setting up a User Account

 

Now that our installation is complete and we've rebooted into our Arch Linux installation, we'll need to setup a normal user account to work from on a day-to-day basis. This will be done by logging into the root account using the username root and then the password we set at the end of the installation process.

 

Creating our User Account

 

Firstly we will create out user account by running the following command.

useradd -m -G wheel -s /bin/bash archlinux

This command will create a user account called 'archlinux' that is a member of the group 'wheel'. We can then set the password for this account by running the follow command.

passwd archlinux

We now have a normal user account to use on our system. It would be a good idea to give this account the ability to use sudo so you can do tasks that require root privileges.

 

Enabling Sudo

 

Now we are going to enable sudo for the account we've just created. We will do this by editing the sudoers file. This can be done with the following command.

EDITOR=nano visudo

We can do two things at this stage. We can enable sudo for the individual account we made or for the wheel group the account is in. As this is is a single account system, we'll enable it for the individual account. Find the line that reads "root ALL=(ALL) ALL" and add the following line below it.

archlinux   ALL=(ALL) ALL

Then press Control + X and then Y to save the sudoers file. At this stage you could reboot and use the system using the user account we've just created but there is one last thing we should do before rebooting.

 

Enable Multilib (64-bit only)

 

If you have installed Arch Linux onto a 64-bit system, which is likely, we will need to enable the multilib repository in order to install and use any 32-bit software. This is done by uncommenting the multilib entry in the pacman configuration file. You can access pacman.conf with the following command.

nano /etc/pacman.conf

The entry for multilib should read like this once uncommented.

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

Press Control + X and then Y to save the file and then run the following command to update the package list.

pacman -Syu

You have now completed this stage of the Arch Linux installation. We are almost at the end and now we just need to setup the installation so we can use it like a normal desktop operating system. Reboot and then login with your newly created user account.


Everytime I hit my funny bone unexpectedly it's like my own personal Pearl Harbour.


Don't call it a grave, it's the future you chose.


Project JAPC Build Log

Link to post
Share on other sites
Posted · Original PosterOP

Installing a GUI

 

Now that we have a base Arch Linux install with a user account ready, we need to install a GUI so it is usable. You can install a further range of CLI based tools if you wish but for the sake of traditional usability, this guide will install a GUI.

 

Installing Xorg

 

Before we can install our graphics drivers or a GUI, we need to install Xorg. Xorg is the display server that our graphical software will use to display the images onto the screen. This can be done by running the following command.

sudo pacman -S xorg-server xorg-server-utils

When asked to select between multiple options, stick with default recommendations by pressing enter.

 

Installing GPU and Input Drivers

 

This is where things vary a bit. There are drivers for VMWare devices that are based off of the VMWare Guest Package. Intel, AMD and NVidia have their own packages and laptop trackpads also require their own package to be installed. In the case of a VMWare Virtual Machine, you would run the following command.

sudo pacman -S open-vm-tools xf86-video-vmware xf86-input-vmmouse mesa-libgl lib32-mesa-libgl

This will install everything needed for our Virtual Machine to be fully supported by any GUI we installed.

 

Installing a Desktop Environment

 

There are a number of desktop environments and windows managers you can install on Arch Linux. The two most popular desktop enviroments are GNOME and KDE. Installing and enabling both is fairly simple. Run the following commands for GNOME.

sudo pacman -S gnome gnome-initial-setup gnome-software
sudo systemctl enable gdm

Run the following commands for KDE.

sudo pacman -S plasma kde-meta-kdeadmin kde-meta-kdebase
sudo systemctl enable sddm

Once installed you can either reboot and use your full desktop environment or continue to the final stage to install a number of codecs and software that will allow you to get straight to work on your install.


Everytime I hit my funny bone unexpectedly it's like my own personal Pearl Harbour.


Don't call it a grave, it's the future you chose.


Project JAPC Build Log

Link to post
Share on other sites
Posted · Original PosterOP

Installing Common Software

 

We've come to the final stage of the our Arch Linux installation guide in which we will install common pieces of software such as Firefox, LibreOffice and all the codecs we need. There are a number of software we could install but you don't need to install all of them.

 

Mozilla Firefox

 

Firefox is a free and open source web browser that is commonly used world wide. You can use this on Windows, OS X or Android so chacnes are you may already be using it. You can install Firefox with the following command.

sudo pacman -S firefox

 

Mozilla Thunderbird

 

Thunderbird is a free and open source mail client made by the same people take make Firefox. It is a good alternative to Outlook on the desktop and can be installed with the following command.

sudo pacman -S thunderbird

 

FileZilla

 

FileZilla is an FTP client used to access FTP, FTPS and SFTP servers. It may be useful to some of you here and it can be installed with the following command.

sudo pacman -S filezilla

 

LibreOffice

 

LibreOffice is a free and open source office suite that was forked from OpenOffice around 5 years ago. It has replaced OpenOffice as the go-to free office suite if you don't want to buy or use Microsoft Office. It can be installed with the following command.

sudo pacman -S libreoffice-fresh

 

VLC

 

VLC is a multiplatform media player that is widely used due to the amount of codecs it can support out of the box. It can be installed with the following command.

sudo pacman -S vlc

 

Rhythmbox

 

Rhythmbox is an audio playback and management application made the GNOME team. It can be installed with the following command.

sudo pacman -S rhythmbox

 

Steam

 

Steam is that game platform that the vast majority of PC Gamers use to buy and play their games from. You can install it with this command.

sudo pacman -S steam

 

Codecs

 

Finally we have codecs. Installing a web browser or media player will install some of these codecs but there are a few that we can install manually to add even more codec support to our applications. Run this command.

sudo pacman -S gst-libav gst-plugins-bad gst-plugins-base gst-plugins-good gst-plugins-ugly flac

 

Flash Player

 

If you want to install Flash Player, the old NPAPI version that is no longer updated by Adobe, then you can do so with the following command.

sudo pacman -S flashplugin

 

Java

 

If you need Java, say to play Minecraft on the desktop, run the following command.

sudo pacman -S jre8-openjdk

If you want to play RuneScape in the browser, you'll need to install this extra package.

sudo pacman -S icedtea-web

Everytime I hit my funny bone unexpectedly it's like my own personal Pearl Harbour.


Don't call it a grave, it's the future you chose.


Project JAPC Build Log

Link to post
Share on other sites

I remember when we had to install ARCH Onto looneys server in a big hangouts call.

 

https://www.wps.com/linux

 

A great alternative to libre office which is much more like its microsoft counter part.


My current build - Ever Changing.

Number 1 On LTT LGA 1150 CPU Cinebench R15

http://hwbot.org/users/TheGamingBarrel

Link to post
Share on other sites

When needing to quickly install in a VM, I usually don't bother about stuff such as partitioning, swap, timezone, locale, users, etc. Minimum needed -

 

mkfs.btrfs /dev/sda
mount /dev/sda /mnt
pacstrap /mnt base grub btrfs-progs
genfstab /mnt >> /mnt/etc/fstab
arch-chroot /mnt
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

exit
reboot

 

Link to post
Share on other sites

Warning: Total beginner here. I once did some programming and want to get back into things... so jumping into an Arch Linux install is step one. I'm installing this as a VMWare image on my MacBookPro. Seemed like I was on my way but I hit a snag...

 

I followed all these steps till I got to writing the bootloader with 'bootctl install'. I receive the following error message:

File system "/boot" wrong type for an EFI System Partition (ESP).

 

What can I do to diagnose the problem? Any tips on getting the bootloader installed?

Link to post
Share on other sites
On 9/10/2016 at 9:52 PM, bpdronkers said:

Warning: Total beginner here. I once did some programming and want to get back into things... so jumping into an Arch Linux install is step one. I'm installing this as a VMWare image on my MacBookPro. Seemed like I was on my way but I hit a snag...

 

I followed all these steps till I got to writing the bootloader with 'bootctl install'. I receive the following error message:

File system "/boot" wrong type for an EFI System Partition (ESP).

 

What can I do to diagnose the problem? Any tips on getting the bootloader installed?

The VM is not in EFI mode, VMware doesn't have a GUI for enabling EFI so I suggest you use VirtualBox unless you aren't worried about editing files.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×