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.
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)
- NAT (Internet Access)
- USB: unticked that, don't need it
- DONE
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...
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
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
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
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.
- 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
or use
ip a