I recently upgraded to a new system, and instead of running Arch Linux natively I've decided to run it inside VirtualBox on Windows 10. Below I note down the steps I took, which closely follow the excellent wiki pages of archlinux. But along the way, I also noted a few other steps steps I took to make this system very comfortable, which you'll have to figure out for yourself if you like them or not!
I couldn't find a section on the Arch wiki where these steps are listed, perhaps they are obvious, but since I think I know what I'm doing I'm just going off script here (what a great start!).
- Start VirtualBox and click
New - Name your machine, preferably with a descriptive but memorable name (e.g.,
exultant carpenter), select typeLinux, and versionArch Linux (64 bit)(unless you downloaded the 32 bit version. A note on this, I recall in the past that for some machines you may need to go inside your UEFI/BIOS firmware, and enable Intel VT-x to be able to run the 64 bit version, highly recommended!) - Next set your RAM. I have 16GB and I want to make this my main development environment, so I decide to set mine to 8192MB, but Arch Linux requires much less than that.
- Create a virtual hard disk now and select
VDIandDynamically allocatedon the next screens. - Select a reasonable disk size (e.g., 40GB). Note that all of those settings are not that important at the moment as they can be changed in the future
- Once this wizard completes, hit
settingsand make a few additional changes. Namely:System > Processor > 2 CPU,Display > Screen > Video Memory 128MB & Monitor Count 4 & Enable 3D(or whatever is the number of monitors that you have, hopefully >1 unless you sport a 4K monitor) - And finally go to
Storage > Storage Tree > Controller: IDE > Optical Drive + icon > Choose Diskand navigate to where the ISO file you downloaded previously is stored (I personally moved the ISO underC:\Users\USERNAME\VirtualBox VMs\archlinux-2015.11.01-dual. - Click ok and you are now ready to Start the VM
- Once started, select `Boot Arch Linux (x86_64)
We now want to install Arch Linux as guest to our Virtual Box, following the steps listed here.
- I skip over setting up my keyboard and my internet, because I'm happy with the keyboard default and my internet works (as is verified by typing
ping google.comorcurl google.com) - Start system clock with
timedatectl set-ntp true - This step is informational only: list block devices with
lsblk, you will seesdawith a size of XXG and typedisklisted as well assr0where the ISO. Our goal here is to makesdabootable but at this point its just an unmounted, unformatted block, which is pretty useless. So let's setup a partition insdausingparted - Type
parted /dev/sda, and once inside parted typemklabel msdosto setup a new MBR/msdos partition (why notmklabel gpt? this is because VirtualBox offers an BIOS system) - Next I follow the BIOS/MBR example. I run
mkpart primary ext4 0% 100%,set 1 boot on, andquit - Format the partition in ext4 with
mkfs.ext4 /dev/sda1and mount it withmount /dev/sda1 /mnt - I skip over changing the mirrors
- Install the base packages with
pacstrap -i /mnt base base-devel(if this is your first time using pacman, rejoice because it will be the main reason you will love Arch Linux! You will be prompted with a few confirmation screens, just keeping hitting enter until you downloads start (this may take a few minutes, depending on the speed of your internet connection). A quick note on the questions in Linux that end with[Y/n], these are usually pretty safe questions, so you don't actually need to typeYand can just hit enter. More discussion about this here for example. - Generate an fstab file using
genfstab -U /mnt > /mnt/etc/fstaband change root usingarch-chroot /mnt /bin/bash - To help your locale-aware programs and libraries render text, regional monetary values, time and date formats correctly, set your Locale I type the following (assuming US):
vi /etc/locale.gen, which will open the vi editor,/en_US.UTF-8, followed by the characterxto delete the leading#, which uncomments the appropriate line, and finally:wqwhich saves and quits the file - Use
tzselectto find your time zone, and typeln -s /usr/share/zoneinfo/Zone/SubZone /etc/localtimewhereZone/SubZoneis your selection. Since windows 10 is also installed on the machine, important to sethwclock --systohc --utc - Do not install microcode updates, as this is a virtual machine
- Install grub package with
pacman -S grub os-prober grub-install /dev/sdagrub-mkconfig –o /boot/grub/grub.cfg- Next pick a hostname to refer to your machine on the network, I pick
exultantcarpenter, and put this is a file as suchecho exultantcarpenter > /etc/hostname. Also add this hostname to/etc/hostsby adding it as an option beside localhost (the line should look like127.0.0.1 localhost.localdomain localhost exultantcarpenter, all separated by tabs. - Ensure that you machine will be able to connect to the internet when boot in the future, by running the following two commands. 1)
ls /sys/class/netwhich will output two words to the screen, for instanceenp0s8 lo. and 2)systemctl enable [email protected], where you replaceenp0s8with what your first command outputed. - Almost there! Next we set a password, unmount and reboot! Set a password with
passwd, exit chroot withexit, unmount withumount -R /mnt, and reboot withshutdown. Once the machine is off the virtual machine, return to VirtualBox, select the machine, and remove the drive (Settings > Storage > Storage Tree, select the ISO and click on the minus sign to remove) - Hit start again and you are done!
here.
At this point, you can take a break and come back later to continue the setup of all your favorite goodies for your brand new Arch Linux (xmonad, haskell, R, apache Spark, clojure).
Could not able to download arch linux iso file for virtualbox.