Skip to content

Instantly share code, notes, and snippets.

@ReturnRei
Last active July 29, 2023 20:58
Show Gist options
  • Save ReturnRei/1f30b44e2aaaabe1045599562d5bc838 to your computer and use it in GitHub Desktop.
Save ReturnRei/1f30b44e2aaaabe1045599562d5bc838 to your computer and use it in GitHub Desktop.
Install Arch / EndeavourOS Mac M1 Parallels
This gist is provided as an addition to my youtube video
https://www.youtube.com/watch?v=dKvetujHjYQ&t=737s
## Useful links
https://wiki.archlinux.org/title/Install_Arch_Linux_from_existing_Linux#Using_a_chroot_environment
https://archlinuxarm.org/platforms/armv8/generic
https://www.reddit.com/r/archlinux/comments/6kwt61/systemd_doesnt_create_machineid_during/
https://arm.endeavouros.com/endeavouros-arm-install/
## Get into chroot
mount --bind /mnt /mnt && cd /mnt && rm /mnt/etc/resolv.conf && cp /etc/resolv.conf etc && mount -t proc /proc proc && mount --make-rslave --rbind /sys sys && mount --make-rslave --rbind /dev dev && mount --make-rslave --rbind /run run
chroot /mnt /bin/bash
## Commands for install
pacman -Syu base linux linux-firmware vim arch-install-scripts efibootmgr networkmanager network-manager-applet dialog os-prober mtools dosfstools base-devel linux-headers
dbus-uuidgen > /etc/machine-id ## Fix for missing machine-id
genfstab / >> /etc/fstab ## Check your fstab after issuing this command to make sure there aren't other partitions
ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime ## This is if you're located in Europe with Paris's timezone
hwclock --systohc
vim /etc/locale.gen ## Select your locales
locale-gen
echo "LANG=en_US.UTF-8" >> /etc/locale.conf ##Assuming you want this locale
echo "arch" >> /etc/hostname
vim /etc/hosts ip hostname ## Here we use vim to modify the hosts file
bootctl --path=/boot install ## Here we begin setting up systemd-boot
systemctl enable NetworkManager
## For endeavourOS
git clone https://github.com/endeavouros-arm/install-script.git
### Configs
/boot/loader/loader.conf
timeout 3
#console-mode keep
default arch-*
--/entries.arch.conf
title arch
linux /Image
initrd /initramfs-linux.img
options root=/dev/sdb2 rw
@GreenglassT
Copy link

I got it from ArchLinuxARM. However it was the Raspberry Pi 4 .iso. Not sure if that effects its compatibility with Parallels. I figured since it was for ARMv8 it would work, but I couldn't figure out the steps to really get it working.

@ReturnRei
Copy link
Author

@GreenglassT Could be due to raspberry's bootloader uboot, whatever, happy you found a way which worked ;)

@poetaman
Copy link

poetaman commented Dec 12, 2021

@ReturnRei FreeBSD 14.0-CURRENT works in parallels on Apple M1! get the -disc1.iso file from https://download.freebsd.org/ftp/snapshots/arm64/aarch64/ISO-IMAGES/14.0/. And its like a piece of cake, no complications to get it up and running. Just follow the instructions from https://docs.freebsd.org/en/books/handbook/virtualization/#virtualization-guest-parallelsdesktop.

Screen Shot 2021-12-12 at 3 35 59 PM

Btw, can a user start with another distro instead of Debian to transition to Arch?

@ReturnRei
Copy link
Author

@reportaman Nice to see that little devil in neofetch, will give it a try
Yes the only important thing is to have the package bsdtar, other than that you should be fine

@poetaman
Copy link

poetaman commented Dec 16, 2021

@ReturnRei How does one backup Arch installed by your method? As you see, ncdu shows the size of Arch is just 6.8MB. Which means that .pvm file is not self contained for backups. Also, does one need to have HDD-2 still linked to Debian linux after installing Arch or can it be unlinked? I wonder if running Arch And Debian together would run the risk of Debian corrupting Arch's HDD.

Screen Shot 2021-12-15 at 5 23 47 PM

@mybigman
Copy link

bootctl --path=/boot install fails

Failed to open file system "/dev/block/8:1": No such file or directory

@ReturnRei
Copy link
Author

@mybigman is a device mounted into /boot ?

@mybigman
Copy link

mybigman commented Dec 24, 2021

yes it is...

as a work around i had to do this...

mkdir -p /dev/block
ln -s /dev/sda1 /dev/block/8:1

be nice if i didnt have to but cant find to the root cause.

@l0g4n0830
Copy link

I did everything according to the guide and when i reboot and try to boot into arch is says:
EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
EFI stub: Loaded initrd from command line option
EFI stub: Exiting boot services

@ReturnRei
Copy link
Author

@l0g4n0830 There's a moment in the video where it's not really clear I'm adding the previously modified disk image into the new arch VM. Do you have two disk images in your arch VM the second being the one we played with on debian?

@l0g4n0830
Copy link

Yeah im doing the same and then booting from that disk that is supposed to be the configured one
Screen Shot 2022-04-02 at 5 46 07 PM
,

this is what i see first and then throws the error, im doing everything just like you but the only things that comes out different is the bootctl command, instead of throwing a file into /boot/ like it does with you it creates something on /etc:
Screen Shot 2022-04-02 at 5 37 40 PM

@l0g4n0830
Copy link

im using a parrot for that first step and configuration but have also tried other distributions and does the same, can it be the reason for the error? because i can't think of anything else

@SatoriHoshiAiko
Copy link

SatoriHoshiAiko commented Apr 16, 2022

Hi @ReturnRei

I am having difficulty when rebooting into the new system.

I have both an "Other Linux" on my first boot order, and then added the second hdd created in debian, everything is exact with the video unless I made a mistake, third attempt here with reboot into arch failing.

The kernel boot is exiting and after pulling open the journal, I am locating that the Failure is in sys-kernel-tracing.mount:

Untitled

Is it possible that the "Other Linux" Kernel is no longer good for this?

I should mention that the .tar I used was downloaded from Arch Linux website (https://archlinuxarm.org/about/downloads) by hand as the .tar. I then manually chmod 777 ./ in the arch directory created in the guide and drag and dropped this distrobution into the arch directory created in home.

In short I bypassed the wget method of retrieving my arch tar, although I don't see that my version is any different, unless the choice of download location has affected my install. Is it perhaps that my distrobution of Arch Linux is different than the one you used in the video? Something is not matching up and I am getting it to boot and am well past any other issues.

I did notice that I did not get an rng device under the "default xxxxxxxxxxxxxx-*" in the loader.conf. For me this was blank, and it was also not a present device when I was passing the step of the systemd boot and running the ls /boot/ command. There is a comment that since this is a virtual machine, we are skipping this as the default device anyway, but for me it wasn't present in the first place. I feel like the water is warmer here, and that perhaps this is backtracking all the way into how parallels draws a systemd boot.

I am just trying to locate what else has changed with your guide and perhaps anything that has been updated.

I didn't SSH into debian, I did the whole creation of the /dev/sdb partitions, unpacking and downloading and then creating a bootable arch install by using debian within parallels and then using the terminal. I don't think this should matter whether I SSH or just use terminal opening debian in parallels.

In the vim /boot/loader/entries/arch.conf we created, I was unsure if the options entry was a:

options -tab- root=/dev/sdb2 -tab- rw
-OR-
options -tab- root=/dev/sdb2 space rw

I opted for the latter and am hoping I don't have a syntax error in doing so.

Ask me any other questions maybe you can locate where I am doing something odd. In short the kernel won't load with an exit status, and I can't locate the issue. I searched around and this is happening with ftrace.

I am not an advanced linux user but intermediate becoming advanced, so I don't locate things as readily as one might hope.

Thank-you when you have the opportunity to look into this.

~Satori Hoshi-Aiko

@ReturnRei
Copy link
Author

Hey there @SatoriHoshiAiko , is the version you installed from the download directory "ArchLinuxARM-aarch64-latest.tar.gz" also called ARMv8 AArch64 Multi-platform?
Also I'm not that knowledgeable on the exact whys but it seems to me that you didn't use BSDTAR and you should've
https://archlinuxarm.org/platforms/armv8/generic check here, it will tell you to use it to preserve several properties
Also if you want to debug your install check the messages in your journal (what comes after your screenshot)
If I were you I would start over using bsdtar, if it doesn't work hit me up and I'll try to replicate

PS: (Other linux as in what you see in parallels is not the kernel, the kernel is the package "linux" you install on arch)
PS2: chmod 777 is bad practice, generally avoid doing it

@SatoriHoshiAiko
Copy link

SatoriHoshiAiko commented Apr 16, 2022

Yes it is ArchLinuxARM-aarch64-latest.tar (not a .gz) - The multi-platform version as mentioned.

I used bsdtar but perhaps I am not setting the commands fully, I used debian bullseye to unpack this and set up the hdd for arch with your video. bsdtar is not its own package and refered by libtools-archive. But this does do bsdtar command once installed.

I am going to try to wget the generic distrobution you have in the link, and see if I have any better luck.

It would seem to me that the systemd boot is running tracing which is itself a debug mode on boot. It is definitely well baked into the kernel. Let me try a different version of ArchARM and see if I have any luck. Generic will hopefully work on another attempt.

Thanks for the recommendations.

@ReturnRei
Copy link
Author

ReturnRei commented Apr 17, 2022

https://gist.github.com/SatoriHoshiAiko If it doesn't work I'll make a fresh install for myself so just tell me !

@SatoriHoshiAiko
Copy link

Hey, although it is local to Parallels on M1, I found a good image to work with here:

pkgbuild.com/~tpowa/parallels/5.16.x/

I should recommend for you also? The best way to build ArchArm aarch64 images I believe is now archboot.

You should look at the git repository. It might simplify your guide for custom installations for many platforms, and you might have a more straightforward video.

I used the image by tpowa, and quickly booted into parallels right away with aarch64 arm. From there running the endeavouros install-scripts (also a git repository) was a quick install of endeavour os.

Final remaining step for myself is installing black arch tools over endeavour os, I updated pacman keyrings to populate archlinux archlinuxarm endeavouros blackarch.

Some manual dependencies to sort mostly python python2 ruby qt4 mingw-w64 sslyze responder donut john solidity libboost gnuradio gcc-multilib lib32-utils.

Then I should have a full EndeavourOS/BlackArch over Aarch64 ARM in Parallels on Mac M1 Mini.

I would do a YouTube myself but the download on BlackArch takes forever as it is 29GB. Oh well.

For sure consider looking at archboot. It could be a life changer for others moving forward.

tpowa made parallels incredibly easy with his image, but a Return Rei version may turn out better ;)

Cheers,

~SatoriHoshiAiko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment