Post

setup Arch on your Mac

Do you want to see this:

Arch and Mac

Follow this tutorial:

Lets use Notion-Ai to write some parts 👇 for me 😅

What is Arch Linux?

Arch Linux is an independently developed, x86-64 general-purpose GNU/Linux distribution that strives to provide the latest stable versions of most software by following a rolling-release model. It is a lightweight, versatile operating system that focuses on simplicity and customization, making it an ideal choice for users who want a highly customizable and easily maintainable system. Arch Linux is also known for its user-friendly package management system, Pacman, and its extensive collection of software packages, the Arch User Repository (AUR).

What is AUR (Arch User Repository)?

Arch User Repository (AUR) is an online repository of user-submitted packages for Arch Linux. It contains software packages not included in the official Arch Linux repositories, as well as packages that are pending release. AUR packages are built from source and must be manually installed. AUR packages can be found and installed using the Pacman package manager. The AUR is a great way to find and install software that is not included in the official Arch Linux repositories.

You understood till now that using AUR is amazing great and lightweight to install hacking tools (mostly for bug hunting) easily

How is it started?

I had used Linux (Arch BTW 😂) for 4 years and I decided to move forward macbook world as I realized that new Apple Silicon CPUs are extremely great. But I was nervous about Linux and the community which I got used to.

I moved and I bought a Macbook 2020 M1 (after researches, I got that M2 is NOT worth it)

Its a third day I have this device and I have to admit that I love it and its getting more

Back to the topic, I’ve couldn’t find any place better that AUR to install bug hunting tools easily, so from the first second of turning my macbook on, I was thinking about installing Linux on it (specifically Arch)

and here is how I did it and how you can do

Install UTM

install it from their official website, its free → https://getutm.app/

then:

gif

Browse Gallery → download the image you want → extract it (zip file) ⇒ you will get a .utm file

click on + buttom and click on Open...

Select the utm file you just extracted and you are done here

Decrease Ram in settings if you like, I set 512MB, that enough! There is an gif below which help you get familiar with setting part

Boot to linux

after turn this instance on change default root password and create another user and run update

1
passwd root
1
2
pacman -Syyu
pacman -S nano git wget

new user and assign a password to it

1
2
3
useradd -m -G sys,log,network,floppy,scanner,power,rfkill,users,video,storage,optical,lp,audio,wheel,adm -s /bin/bash USERNAME

passwd USERNAME

Run this lines

1
2
3
export VISUAL=nano
export EDITOR=nano
visudo /etc/sudoers

last line will open a file in nano (it should be installed)

uncomment this line : %wheel ALL=(ALL) ALL

How to setup SSH on Arch

install

1
pacman -S openssh

edit /etc/ssh/sshd_confignano /etc/ssh/sshd_config

1
2
3
4
5
6
7
8
9
# add this line:
AllowUsers    USERNAME

# for SSH-key
HostKey /etc/ssh/ssh_host_rsa_key

# uncomment and edit port
Port 22 -> 39901 # other port for more security but doesnt matter in local mode

enable and startsshd.service

1
2
3
4
5
systemctl enable --now sshd

# check the status
systemctl status sshd

Now, You have to use port-forwarding to connect to it

Setup Port Forwarding and make instance “headless”

Open Arch setting in UTM menu

If you want to run Arch without the Serial Window being opened, remove Serial in settings

Connect to it through Mac Terminal

1
ssh -p 2200 USERNAME@localhost

Trick: add an alias like this to your ~/.zshrcalias archrun="ssh -p 2200 alireza@localhost" then by typing archrun in your terminal, you can access your Arch 🙂

Enjoy

Thoughts on this setup

You can see in the first picture that onlu 70MB of assigned RAM has been used, so this Arch setup is extremily lightweight.

There is a Kali linux image in UTM Gallery as well but I’m not pretty sure that is it lightweight or not.

at least I know that it is not memory friendly:

Architecture: ARM64/x64
Memory: 4 GiB
Disk: 20 GiB
Display: VGA
SPICE tools: Installed

On the other hand, Using Arch User Repository is really helpful, You can install what you want and update them easily

That my thought, maybe someone else has different idea about workstation setup (like installing Debian which assumed to be more lightweight and stable

This post is licensed under CC BY 4.0 by the author.