Jump to content

[GUIDE] archlinux VM with EFI

1 post in this topic Last Reply

Recommended Posts

Posted (edited)



Here is my commands which i've now used 2 times to install archlinux as VM inside Unraid with EFI.


I'm using latest unraid version: 6.7.2 and it's intel system.


Tell me if there is any problems with it.

I've used archlinux-2019.04.01-x86_64.iso


Add VM --> Select Arch

Machine: i440fx-3.1


Primary vDisk Size: 20G




Connect to VM


ls /usr/share/kbd/keymaps/**/*.map.gz      #lists all keymaps

loadkeys fi                                               #your keymap fi/en/swe etc whatever you want

ls /sys/firmware/efi/efivars                       #checks if efi is enabled

ping google.com                                      #check that you have connection

timedatectl set-ntp true                          #sets ntp

fdisk -l                                                    #lists disks

fdisk /dev/vda                                           #open fdisk on your virtual drive

------------- fdisk /dev/vda ------------------

n >> enter >> enter >> enter >> +550M      #efi partition
n >> enter >> enter >> enter >> +18G         #linux partition 18G for 20GB vDisk 28G for 30GB vDisk etc
n >> enter >> enter >> enter >> enter        #swap partition, rest of disk as swap

w                                                             #writes changes


mkfs.fat -F32 /dev/vda1                             #formats efi partition
mkfs.ext4 /dev/vda2                                  #formats linux parition
mkswap /dev/vda3                                    #formats swap partition
swapon /dev/vda3                                     #sets swap partiton

mount /dev/vda2 /mnt                               #mounts linux partition to /mnt

mkdir /mnt/boot                                        #makes boot folder inside /mnt
mount /dev/vda1 /mnt/boot                       #mounts efi partition to /mnt/boot

pacstrap /mnt base                                  #installs arch to /mnt

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

arch-chroot /mnt                                      #changes root location to /mnt aka where just installed arch

timedatectl list-timezones                         #list available timezones

ln -sf /usr/share/zoneinfo/Europe/Helsinki /etc/localtime    #set your zone as default

hwclock --systohc                                    #sets hardware clock

locale-gen                                                #generates locales


nano /etc/locale.conf                                #open/create file
--------- /etc/locale.conf --------------
LANG=en_GB.UTF-8                                  #set your preferred language and press CTRL+X >> y >> enter


nano /etc/vconsole.conf                            #open/create file
------- /etc/vconsole.conf ----------
KEYMAP=fi                                               #sets keyboard layout, CTRL+X >> y >>  enter


nano /etc/hostname                                 #open/create file
-------- /etc/hostname ---------------
archlinux                                                #sets hostname for your machine, CTRL+X >> y >>  enter


nano /etc/hosts                                       #open/create file
------ /etc/hosts -----------------------           localhost
::1                    localhost            archlinux.workgroup    archlinux               #CTRL+X >> y >>  enter


mkinitcpio -p linux                                     #makes initframs

passwd                                                    #sets password for root

exit                                                          #exits /mnt root back to live

grub-install --target=x86_64-efi --efi-directory=/mnt/boot --boot-directory=/mnt/boot --bootloader-id=grub             #installs grub

arch-chroot /mnt                                     #back to /mnt root

pacman -S grub                                       #installs grub package to installation

grub-mkconfig -o /boot/grub/grub.cfg        #same as update-grub on ubuntu

exit                                                         #exits /mnt back to live

reboot -f                                                  #reboots system


dhcpcd                                                   #if you dont have network this gives it

ping google.com                                      #test connection


-------------- GUI installation start ---------------------

pacman -S lxde                                       #installs lxde (you can install whatever GUI you want)


#optional apps
pacman -S firefox                                   #installs firefox
pacman -S transmission-gtk                    #installs transmission GUI

systemctl enable lxdm                            #makes service to enable lxdm

nano /etc/lxdm/lxdm.conf                       #opens lxdm config
session=/usr/bin/startlxde                      #edit session to match as following (uncomment it)

reboot -f                                               

setxkbmap fi                                         #inside gui enviroment sets your keymapping

-------------- GUI installation end ---------------------

dhcpcd                                                 #if you dont have network

ip link                                                   #look for your network device name eth0 or ens3 in my case
systemctl enable dhcpcd@ens3           #creates startup service for ens3
ip link set ens3 up                                #sets ens3 up

pacman -Syy                                        #update package list
pacman -Su                                         #install updates


#optional: user creation for sudoing
useradd -m -s /bin/bash arch                 #creater new user, arch is username
passwd arch                                       #sets password for arch

pacman -S sudo                                  #installs sudo package

EDITOR=nano visudo                           #edit sudo config

arch ALL=(ALL) ALL                              #add this line with your username under root ALL=(ALL) ALL and CTRL+X >> y >>  enter


reboot -f                                               #reboot




Edited by twiikker

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.