This guide shows how to install Arch Linux on virtual box. In our last guide, we showed just how to install arch Linux as a main OS. We will do this as a step-by-step guide. Once more we would like to say that the most detailed guide is always the official. The guide you’re about to read though, is considered as simplified. The Desktop Environment we use is Gnome, but since it’s the last step of this guide, you can choose your own. Last thing before we start. When you see the commands, do start just blindly copy/paste them, but keep an eye in italic letters.
How to install arch Linux on virtual box – To follow this guide it is already considered that you’ve installed a virtual box.
We download the ArchLinux ISO file from here. It’s the official link. We choose whichever way fits best for us either its torrent, http or ftp.
We run VirtualBox and we set up our virtual Image with the following way
a) We choose “new” and we create and new VM in our VirtualBox
b) We choose to have enough RAM for our system(example: 2048mb)
c) We choose to create a new Disc, VDI as a file type, and we give whatever size we need . In this particulare case we choose 40gb capacity with a dynamic size
d) We click “create” and we open VMs settings that we just made. We choose as many cores as we want virtualbox to use(for example, if we have 4 cores, we choose all 4).
e) We then go to the display menu and we choose 3D acceleration(we’ll use that later for the gnome)
f) We chose our VM and we click on start. It will show a window for use to chose the ISO file we downloaded in the first step. After we choose this, it will show the boot screen of Arch Linux. We choose Boot(x86_64) in that case.
The rest of the commands are in the Wiki (link at the beginning of the article) so we’ll stop with screenshots and we’ll continue with commands. We must say that it is really important when it comes to installing in VirtualBox so we’ll not going to use any complicated partitioning or anything else non-useful so we can have a simple and working installation.
Partitioning. We only make one partition without swap, in MBR and we set it to boot from that.
# parted /dev/sda (parted) mklabel msdos (parted) mkpart primary ext4 1MiB 100% (parted) set 1 boot on (parted) quit # mkfs.ext4 /dev/sda1
We rename the list of mirrors that we’re not interested for and then we choose mirron in “your country” for a faster download. You can find the list here – be sure that you choose your country.
# cd /etc/pacman.d # mv mirrorlist mirrorlist-bk # nano mirrorlist We write one of the servers of the list. For example: Server = http://ftp.otenet.gr/linux/archlinux/$repo/os/$arch We press CTRL-X and we choose to save the file.
We mount the partition and we run the installation. We press enter or yes in every question that has to do with “downloading and install packages”.
# mount /dev/sda1 /mnt # pacstrap -i /mnt base base-devel
After all packages are installed, we create the fstab and then we open the OS to customize it. We choose as system language US with UTF-8.
# genfstab -U /mnt > /mnt/etc/fstab # arch-chroot /mnt /bin/bash # nano /etc/locale.gen
We search for the line: #en_US.UTF-8 UTF-8
We remove the comment (#) from the beginning of the line.
Control-X and we Save the file.
# locale-gen # nano /etc/locale.conf
We add the line: LANG=en_US.UTF-8
Control-X and we Save the file.
We set our timezone and the wew install GRUB
# ln -s /usr/share/zoneinfo/HERE INSERT YOUR CONTINTENT/YOUR CITY /etc/localtime # pacman -S grub os-prober # grub-install --recheck /dev/sda # grub-mkconfig -o /boot/grub/grub.cfg
We set VMs hostname
# echo arch-vm > /etc/hostname
We activate dhcp client so we can have access to internet when we boot
# ip link
We use te interface that is written in the 2nd result and we activate dhcp client
For example: if the result is 2: enp0s3 we write:
# systemctl enable dhcpcd@ enp0s3.service
We set password for the root user and we leave chroot
# passwd # exit
WE choose to remove the ISO from VirtualBox and we restart the system
As soon as our systems boots, it’s going to ask for username and pass. We give username as root and password, the pass we chose some steps ago.
We add our user(example: randomusername) and we make a password. We also give him sudo privileges
# useradd -m -G wheel -s /bin/bash randomusername # passwd randomusername # nano /etc/sudoers
We find the line that says:
#Uncomment to allow members of group wheel to execute any command
and we remove comment # from the start of the next line so it writes:
% wheel ALL=(ALL) ALL
Control-X and we choose to Save the file.
We change user from root to the user we just made and we prepare to install GUI
We install the graphical environment of our choice. For that tutorial we’ll use GNOME and we will use gd, as a Display Manager. We wait for the packages to be downloaded and installed. We activate the Display Manager for the next boot.
# sudo pacman -S gnome gdm # sudo systemctl enable gdm
An important step is to install the guest additions of VirtualBox and to create a file that declares the modules that will be loaded in boot.
# sudo pacman -S virtualbox-guest-utils # sudo nano /etc/modules-load.d/virtualbox.conf We add the following lines: vboxguest vboxsf vboxvideo Control-X and Save the file # reboot
Final: We’re ready to start with GUI and 3d acceleration.
You can also check out that video in case you need more help
comments powered by Disqus