Setting up Arch Linux (VMware) for Custom ROM building – Part 2: Installing the User Interface (UI)

So we finished installing the basic Arch installation in Part 1. As of now, you should have a login prompt whenever you start your VM instance. We can actually stop at this point and continue using the machine as bare bones as this and go on with building Android. But where’s the fun in that?

If you want to get a User Interface (UI) going on your Arch installation, read on.

Arch Linux with VMware utilities installed

Arch Linux with VMware utilities installed

Last update: July 14, 2017

If you are reading this part of the post, congratulations! You have decided to put a UI in your Arch installation and you have successfully installed Arch Linux! Good work!

Just a quick note, we will be installing XFCE4 in this tutorial. It is the Desktop Environment (DE) that I use and prefer due to its simplicity and its lightness. If you prefer to install a different DE or if this DE is not good enough for you, feel free to check the Arch Wiki.

With that out of the system, log in to your machine and lets start building!

Manage users

As you may have noticed, we are only using 1 account since we installed Arch Linux – the root / administrator account. For me, it is not a great idea to keep it this way. Yes, there are some distributions out there that uses root as a default account but I do not generally recommend it. For one, all your programs will run under root. And when a malicious program do run with root, your system and your private data will be out of the window for the grabs! So in this tutorial, let us create a new user and reserve the root account for root things.

To do this, type

useradd -m -g users -s /bin/bash yourdesiredusername

where yourdesiredusername is your new user account. We add -m so that it will create a separate home directory, -g to add it to users group and -s to run shell in /bin/bash directory.

Then type:

passwd yourdesiredusername

to set a password to the new account.

Give sudo rights to new account

Next step is we give user a sudo rights or a right to run a program or command with the rights of another user, which in our case the root account. However, the sudo program is not installed by default in the system. Therefore we need to install the sudo program first and enable the use of sudo for our new user.

Install sudo

To install sudo, type

pacman -S sudo

This will install sudo using our built-in package manager named pacman.

Arch Linux: pacman

Arch Linux: pacman

Enable the use of sudo

After installing the sudo program, we need to configure and enable our new user to use it. In order to do this, edit the file in /etc/sudoers by typing

nano /etc/sudoers

and add in the last line the following:

yourdesiredusername ALL=(ALL) NOPASSWD: ALL

where yourdesiredusername is the username of the new account. For more information on the documentation of sudo, head here.

Install essential tools

Now we will install the following packages:

net-tools

pkgfile

base-devel

by typing

pacman -S net-tools pkgfile base-devel

These will enable the use of other network configuration tools such as ifconfig. It will also install a metadata explorer and the dev tools required to build and compile packages. For more information on each package, you can run

pacman -Si packagename

where packagename is the name of the package you are installing.

Arch Linux: Installing essentials

Arch Linux: Installing essentials

Make a backup

Now we are nearing a stage where anything could go haywire. I suggest you first make a backup of your installation either by duplicating the whole VM folder (commonly found in Documents folder in Windows) or doing a snapshot (VMware workstation feature only).

Install the video driver

Now we need to install the video driver. We will be installing the VMware display driver (with the VMware utilities) so that we can resize the screen with the UI scaling automatically to it. However, for safety purposes, let us first install the basic display driver so that if anything goes wrong, we can still fire up the UI.

You can do this be typing

pacman -S xf86-video-vesa

Arch Linux: xf86-video-vesa

Arch Linux: xf86-video-vesa

Installing the desktop environment

Now, lets install the desktop environment of my choice – XFCE. However let us first install some packages before actually installing XFCE itself.

Install xorg and some fonts

Let us first install xorg (a display server) and some fonts by doing

pacman -S xorg-server ttf-dejavu ttf-droid ttf-inconsolata

If asked which providers to use for libgl, select libglvnd.

Arch Linux: libglvnd

Arch Linux: libglvnd

Install xfce (and some other stuff)

And now lets install xfce for by typing

pacman -S xfce4 xfce4-goodies

If you are asked for a selection, just press ENTER to go with the defaults. This will install a lot of things so if you don’t have that fast machine or internet connection, feel free to get some coffee.

Arch Linux: XFCE4 install

Arch Linux: XFCE4 install

At this point (after xfce was installed), you can install additional packages so that when we restart, you all have all the applications that you need. For me, I just need a browser so I’m typing

pacman -S firefox

Starting X

Now after everything is installed, we can now go and start our desktop environment. But first, switch to the non-root user by pressing

CTRL + ALT + F2

After logging in as a regular user, type

startxfce4

to start XFCE and bring a UI to our machine!

startx command not found!

If for some reason you could not start X, install the xorg-xinit package first by typing:

sudo pacman -S xorg-xinit

Arch Linux: startxfce4

Arch Linux: startxfce4

And now we have the UI! Select Use default config to start XFCE with default panel configuration.

XFCE4

XFCE4

As you can see below, we still have some work to do.

Arch Linux: XFCE4 desktop

Arch Linux: XFCE4 desktop

We are running on a default display driver (remember xf86-video-mesa?) and we still do not have VMware utilities installed. This means we could not do the usual resizing of our desktop environment. However, do not worry. We will fix that in a bit.

Installing VMware utilities

Now lets install those VMware additional utilities that will enable our desktop environment to resize automatically. To do this, fire up the terminal and type

sudo pacman -S xf86-video-vmware open-vm-tools

Arch Linux: Installing VMware utilities

Arch Linux: Installing VMware utilities

Enable VMware service

After installing the utilities, we must now enable the VMware service so that it will automatically start once we boot up the computer. To do this, type:

sudo systemctl enable vmtoolsd.service

Enable Copy and Paste

In addition, you must run the following command below so that copy and paste to and from the Arch Linux VM can be done. Type

sudo systemctl  enable vmware-vmblock-fuse.service

and install gtkmm package by typing

sudo pacman -S gtkmm

Test driving the VMware utilities installation

Now that we have VMware utilities installed, we can go ahead and test if it was properly configured and installed in our system. To do this, simply do a quick reboot or type

sudo shutdown -r now

in the terminal. Login with your non-root account and type startxfce4.

You may have noticed that we are typing startxfce4 again. Yes, we will be doing this everytime we boot up the machine. But don’t worry. We can do this little trick so that the system will automatically do this in the future.

You might also notice that we are logging in with a bare bones login screen. I prefer it this was since it is lighter but if you want a fancy one, feel free to install a display manager over here.

Now, after logging in, try to resize the VMware window. If the desktop resizes, give yourself a pat on the back. You have just successfully installed the VMware tools. Good job!

Arch Linux with VMware utilities installed

Arch Linux with VMware utilities installed

Congratulations!

You just successfully installed your Arch Linux with XFCE4 desktop environment in a VMware instance! Now what’s missing is preparing our machine for the Android custom ROM compilation environment. Cheers!

Stay tuned for Part 3!


Sources:

Thanks to these sources, I was able to get through Arch Linux installation:

 

Leave a Reply

Be the First to Comment!

Speak up you comment ninja! Let's talk. Leave a reply.

wpDiscuz
shares
%d bloggers like this: