Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TheNicholasNick/9171333 to your computer and use it in GitHub Desktop.
Save TheNicholasNick/9171333 to your computer and use it in GitHub Desktop.
Simple to the point no fluff install Arch Linux Guest on VirtualBox

Install Arch Linux Guest on VirtualBox

Updated: 13 Oct 2017
Original: https://gist.github.com/SoreGums/9171333

Simple to the point no fluff install Arch Linux on VirtualBox (5.1.28 r117968)
I don't explain much - if you want explanations hit up the Wiki or Josh Braun's blog.
I used Josh's guide and the Wiki to come up with the below.

I'm on Windows and use PuTTY

This guide only covers the minimum to get a working Arch Linux guest on VirtualBox.

Configure VirtualBox VM

I don't know what the best settings are, this is what I picked

  • Arch Linux (64bit)
    • host: Windows 10 x64 w/ 64GBRAM, Core i7-6820HK
  • Pointing Device: PS/2Mouse
  • Base Memory: 4096MB
  • Processor: 3
  • Video: 128MB
  • 40GB Fixed VDI
    • I use PrimoCache with 8GB RAM cache & 128GB SSD L2 cache to 2TB Mechanical HDD. Therefore fixed size is faster, especially if creating linked-clones.
  • Network
    • NAT (Internet Access)
      • Adapter Type: Paravirtualized Network (virtio-net)
    • Host-Only (Access VM without port forwarding)
      • Adapter Type: Paravirtualized Network (virtio-net)
  • USB: unticked that, don't need it
  • DONE
    Configuration Details
    Runtime Information

Install Arch

You're going to need the ISO so go get that - this is a link to the mirrorlist updater, handy for the step later. The ISO I used is located at mirror/iso/2017.10.01/archlinux-2017.10.01-x86_64.iso

Right so boot from the ISO and pick x86_64.
You're at the prompt, let's get copy paste working.

systemctl start sshd
passwd
ip a

Now I have access to copy/paste.
because I'm able to ssh in via PuTTY...

Mirrors

Set the mirrors to use from mirrorlist generator

cd /etc/pacman.d/
mv mirrorlist mirrorlist.old
nano /etc/pacman.d/mirrorlist
>>> paste in your list from before, make sure you remove comments of the mirrors you want to use

Partition, Format and mount

fdisk /dev/sda
>> +2MB(Linux), +250MB (Linux), rest (LVM 8e)
mkfs -t ext2 /dev/sda2
vgcreate vg /dev/sda3
lvcreate -L 4G -n swap vg
lvcreate -L 20G -n root vg
mkfs -t ext4 /dev/vg/root
mkswap /dev/vg/swap
swapon /dev/vg/swap
mount /dev/vg/root /mnt
mkdir /mnt/boot
mount /dev/sda2 /mnt/boot

Install

cd /
pacstrap /mnt base base-devel

Wait a long time or short time depending on your connection/system...

12 Dec 2016 run on Win10x64 Laptop w/ PrimoCache (RAM > SSD > HDD)
pacstrap /mnt base base-devel  30.32s user 3.60s system 12% cpu 4:36.22 total

13 Oct 2017 run on Win10x64 Laptop w/ PrimoCache (RAM > SSD > HDD)
pacstrap /mnt base base-devel  37.40s user 4.77s system 15% cpu 4:41.03 total

Finishing up to Reboot

Remember this guide is no frills, these are the minimum commands to run.

genfstab -p /mnt >> /mnt/etc/fstab
cat /mnt/etc/fstab
arch-chroot /mnt /bin/bash
nano /etc/locale.gen
locale-gen
echo LANG=en_AU.UTF-8 > /etc/locale.conf
rm /etc/localtime
ln -s /usr/share/zoneinfo/Australia/Perth /etc/localtime
date
hwclock --systohc --utc
echo arch > /etc/hostname
systemctl enable dhcpcd.service
passwd
pacman -S grub openssh intel-ucode
systemctl enable sshd.service
nano /etc/ssh/sshd_config
>>>> PermitRootLogin yes
nano /etc/mkinitcpio.conf
>>>> HOOKS="....ock lvm2 file..."
pacman -S lvm2
nano /etc/default/grub
>>>> GRUB_TIMEOUT=1
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
exit
umount -R /mnt
shutdown -h now

>>> remove the cd
>>> start vm
>>> restart ssh session
pacman -S virtualbox-guest-modules-arch
reboot
>>> restart ssh session
pacman -Syu

All done.
You'll notice that Arch Linux is a speed demon to restart, it is almost instant, by the time you get your bearings the prompt is flashing reading to login again.

That's it you're on your own now.

Notes

  • Need syslog? Install it
    • pacman -S syslog-ng
  • Create a snapshot on the shutdown vm before doing anything else, this way creating linked clones is cleaner

Add Cinnamon Desktop Experience

Updated: 15 Oct 2017
Original: https://gist.github.com/SoreGums/9171333

Thanks to Erik, I had a go at getting it working from the Arch Wiki, however that misses some things and following it as a n00b doesn't get a working Cinnamon Desktop.

Continuing on from above

Add a regular user

useradd -m -G wheel arch
nano /etc/sudoers
>>>> (uncomment) %wheel ALL=(ALL) NOPASSWD: ALL
su arch
cd

Xserver setup

sudo pacman -S xorg-server xorg-apps xorg-xinit xorg-twm xterm --noconfirm --needed

Install Packer for AUR make/build

sudo pacman -S --noconfirm --needed grep sed bash curl pacman jshon expac wget
mkdir /tmp/packer
wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=packer
mv PKGBUILD\?h\=packer /tmp/packer/PKGBUILD
cd /tmp/packer
makepkg -i /tmp/packer --noconfirm
cd
[ -d /tmp/packer ] && rm -rf /tmp/packer

Install Cinnamon

mdm-display-manager needs libwebkit (webkitgtk2) which needs to be manually compiled as well and takes a while

packer -S --noconfirm --noedit cinnamon
sudo pacman -S  --noconfirm --needed gtk2 ruby gperf gobject-introspection
packer -S --noconfirm --noedit webkitgtk2
packer -S --noconfirm --noedit mdm-display-manager
sudo systemctl enable mdm.service
sudo reboot

Should be rebooted into Cinnamon now

more things to come, saving and heading to bed

@PhilT
Copy link

PhilT commented Oct 2, 2015

or use ip a

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