Last active
March 2, 2021 22:19
-
-
Save gerryjenkinslb/71b35b2a36b1045767d2375c816d60d2 to your computer and use it in GitHub Desktop.
Formula for Arch/Xcfe4 install in Virtualbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See Medium Article to go along with this gist at: https://gerry-jenkins.medium.com/installing-archlinux-in-virtualbox-beats-dual-boot-for-work-eb4c5cf2fed7 or at my site: http://gjenkinsedu.com/post/2021-01-13_installing-linux-in-virtualbox-best-dual-boot-for-real-work/ | |
# ArchForVBFormula, | |
## VirtualBox Setup | |
- Arch Linux 64 bit | |
- Memory: 2G to recommended half of total | |
- Drive: VDI dynamic at least 30G for working system | |
- Processor cores: recommend half of total | |
- Display: max out the amount of display memory | |
- Network: Bridged Adapter for SSH into | |
- Arch iso for CD/DVD Drive | |
## Setup script, comments indicate some options | |
# Startup ISO image: | |
# if your keyboard is not US | |
localectl list-keymaps | grep -i de # grep a language code df fr | |
loadkeys fr-latin1 # replace fr-latin1 with your keyboard code found in previous command | |
# Optional: if you want to complete process with SSH | |
passwd # to set password to use with ssh root@ip-address | |
# do a "ip a" command to find out ip address -- see video | |
# you can now ssh to root@youripaddr to enter all the command of install. | |
# for example ssh [email protected] -- use your ip address from ip a command | |
## partition, build, and add fstab | |
fdisk /dev/sda # do the following commands to set up 1 big partitican with no boot or swap. | |
n # hit enter for each step to create 1 partician for whole drive | |
w # write out new partician | |
mkfs.ext4 /dev/sda1 # format for linux ext4 type system | |
mount /dev/sda1 /mnt # mount for access | |
pacstrap /mnt base base-devel linux linux-headers # build system, takes a while | |
genfstab -U /mnt >> /mnt/etc/fstab # save fstab to automount main partician | |
arch-chroot /mnt # switch to running as if on new guest, prompt will change to [root@archiso /] adding [ /] | |
# at this point you are running as if you were root on the new disk | |
pacman -Syy vim nano # install one or two terminal editors to use, and update repositories | |
timedatectl list-timezones | grep Los # find out your timezone, here I search for Los Angeles | |
ln -sf /usr/share/zoneinfo/Americ>/Los_Angeles /etc/localtime # substitute your country and city | |
hwclock --systohc # use hardware clock provided by vbox | |
nano /etc/locale.gen # edit locale gen file | |
# uncomment YOUR locale (en_US.UTF-8 UTF-8 and en_US ISO-8859-1) for english_US users | |
locale-gen # generates new locale for system | |
echo LANG=en_US.UTF-8 > /etc/locale.conf # USE your local in place of en_US.UTF-8 | |
echo KEYMAP=us >> /etc/vconsole.conf | |
nano /etc/hostname # add the following to file, you can make up your own name | |
archvbox | |
nano /etc/hosts # add the following to file, note your host name from above is used on last line | |
127.0.0.1 localhost | |
::1 localhost | |
127.0.1.1 archvbox.localdomain archvbox | |
pacman sudo reflector openssh syslinux virtualbox-guest-utils # install some needed system stuff | |
syslinux-install_update -iam # install the boot loader (it installs within the root system) | |
# note, since we have a simple virutal disk, we can use a simpler alternative to grub/efi boot loaders | |
# called the syslinux boot loader, it is actually inststalled in the main partition | |
nano /boot/syslinux/syslinux.cfg # change all sda3 to sda1 (two places) and save | |
# create user, replace gjenkins with your choice of username on next three steps | |
useradd -mG wheel gjenkins # give them right to sudo | |
passwd gjenkins # setup up passwrod, it will prompt you twice | |
EDITOR=nano visudo # complete setup of sudo to allow you to sudo when you login | |
# find comment ## uncomment to allow members of group wheel to execute any command | |
# uncomment next line to start the the % so it looks like | |
%wheel ALL=(ALL) ALL | |
# enable netorking is simpler on vbox | |
pacman -S dhcpcd | |
systemctl enable dhcpcd | |
exit # leave archroot and go back to live CD prompt | |
umount -a # unmount all | |
shutdown now # shutdown guest and you will go back to VirtualBox settings | |
# in VBox settings > storage remove disk from CD | |
# restart image | |
systemctl start dhcpcd | |
sudo pacman -S xorg xorg-xinit | |
sudo pacman -S lightdm lightdm-gtk-greeter | |
sudo pacman -S xfce4 xfce4-goodies # this line you can substitute other desktop envoronments | |
systemctl enable lightdm.service | |
reboot now | |
# Login with lightdm | |
# ref https://wiki.archlinux.org/index.php/xfce for more information on using xcfe4 in arch linux | |
# Setup VirtualBox Guest Editions for sharing files, clipboard, and better screen handling | |
sudo pacman -S virtualbox-guest-utils | |
# Setup swap file Optional: (from: https://wiki.archlinux.org/index.php/swap#Manually) | |
sudo dd if=/dev/zero of=/swapfile bs=1M count=2048 status=progress # 2G swap | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
# sudo edit /etc/fstab | |
add line: | |
/swapfile none swap defaults 0 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment