Wednesday, 24 August 2016

Simple-ish Arch setup for VirtualBox

This is a work in progress. There's probably a simple command for making Arch remember that I only ever want to use a UK keyboard, but I've been tinkering with this for too long now.

If you want to use SSH to access the guest from the host, add a Host-Only Ethernet Adapter in your VirtualBox settings.

loadkeys uk
parted /dev/sda
# When in parted
mklabel  msdos
mkpart  primary  ext4  0%  100%
set 1 boot on
quit
# Then
mkfs.ext4 /dev/sda1
mount  /dev/sda1  /mnt
# Edit /etc/pacman.d/mirrorlist to select mirror.
pacstrap /mnt base
genfstab -p /mnt >> /mnt/etc/fstab
arch-chroot /mnt
passwd
ln -s /usr/share/zoneinfo/Europe/Dublin/ /etc/localtime

printf “arch1\n” > /etc/hostname

pacman -S grub

grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

exit
reboot
# Then enable networking
systemctl enable dhcpcd.service
systemctl start dhcpcd.service

# Install stuff

pacman -S --noconfirm linux-headers xorg xorg-server mate mate-extra lxdm pkgfile base-devel virtualbox-guest-iso wget openssh

# Enable display manager and ssh daemon
systemctl enable lxdm.service
systemctl enable sshd.socket
reboot

# I know there must be a way of reducing the number of reboots
mkdir -p /media/iso
mount -o loop /usr/lib/virtualbox/additions/VBoxGuestAdditions.iso /media/iso
/media/iso/autorun.sh 
# Now add a user and log in as them...
useradd -m -G wheel -s /bin/bash mikey
passwd mikey

# ... so we can install yaourt (not allowed do this as su) ...
mkdir yaourt
cd yaourt
wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=package-query
mv PKGBUILD?h=package-query PKGBUILD
makepkg -s
sudo pacman -U package-query-1.8-2-x86_64.pkg.tar.xz 
ls
rm -rf *
ls
wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=yaourt
mv PKGBUILD\?h\=yaourt PKGBUILD
ls
makepkg
sudo pacman -U yaourt-1.8.1-1-any.pkg.tar.xz 
cd ..
rm -rf yaourt/
# ... so we can install Google Chrome
echo 1|yaourt --noconfirm google-chrome

No comments:

Post a Comment