Script for installing BlackArch in a VirtualBox

Update April 2023: script tested and fixed.

Due to the nature of my work, I often have to reinstall operating systems. And if with most OS everything is quite simple, then on Arch Linux/BlackArch it takes a prohibitively long time. Therefore, I decided to make a script for quickly deploying BlackArch in a virtual machine.

Start by downloading the Arch Linux image from the official site: https://archlinux.org/download/

Create a new virtual machine and start it, specify the Arch Linux ISO as the boot disk.

For the script to start working you need:

curl -O https://blackarch.ru/install_blackarch.sh
bash ./install_blackarch.sh

And then - just wait… The result of the script:

  • Arch Linux is installed and configured
  • installed display manager (GDM) + graphical desktop environment (Cinnamon)
  • installed the most necessary programs (browser, simple text editor, terminal, system monitor and others)
  • the script itself installs the guest add-ons and configures them properly
  • a regular user has been added, a password has been set for him
  • added BlackArch repository but the tools themselves are not installed

ATTENTION: run the script ONLY on a virtual machine!!! The script doesn't ask for anything, it just works. If you run it on a real computer, then with a probability of 100% it will overwrite one of your hard drives.

In short, you enter two commands, and after rebooting you get a completely installed and configured system.

Like any car without a steering wheel, the script has its own nuances. The script itself marks the hard disk partitions, so when creating a virtual machine, you need to select a virtual disk size of 100 gigabytes. It is important!

The script also does not ask for passwords and the name of an regular user – but this is generally not a problem, passwords are changed with commands (for root):

passwd

for a regular user:

passwd USERNAME

And you can easily create your user in a graphical environment.

The script was made exclusively for myself, so no wishes are accepted! The script already 100% meets my needs and I will not change anything in it. But if you yourself make the mods of the script and want to share them, then please, I will gladly publish them here. There may be a demand for mods that would ask about the disk partitioning, about the name of a regular user and his password, etc. There are no wishes/requirements for the code (I also write as I can), but a huge wish for the work algorithm – let the script ask about all the settings at the beginning of its work, and not during execution. For we would not sit for an hour and wait for the script to ask us something, but like this: the script asked everything at startup, remembered it, and then just works according to the specified settings.

Oh yeah, I almost forgot, the root credentials:

root:1

regular user credentials:

mial:2

Just in case, I set up the virtual machine like this (if you do the same, then everything should work 100% for you):

The amount of memory is insignificant, choose its size yourself:

The size of the hard disk is important, choose exactly 100 gigabytes:

Go to the virtual machine settings.

Very important: check the box “Enable EFI (special OSes only)” - otherwise it will not work.

Also check the “Enable PAE/NX” checkbox and add more kernels if desired.

Network settings (optional):

I'm using the Arch live image as a starting point:

We boot the live system.

We type two commands:

And after the reboot, we get a configured and completely ready-to-use system:

If you do not see the bottom panel after loading, then reboot again and after selecting a user, click the gear and select Cinnamon (Software Rendering):

You are not happy with Russian locale (system language)? It’s ok, just launch the command and reboot:

echo 'LANG=en_US.utf-8' | sudo tee /etc/locale.conf

You cannot use Full-screen Mode? Well, it is not fault of my script, but I’ll show how to fix it.

Switch off the guest machine. Go to the its settings “Display” → “Screen” → “Graphical Controller” and switch to “VBoxVGA”. It is said as not recommended, but it works.

Recommended for you:

One Comment to Script for installing BlackArch in a VirtualBox

  1. Alex says:

    The script has been updated – now it works again!

Leave a Reply

Your email address will not be published. Required fields are marked *