{"id":199,"date":"2026-09-24T14:41:35","date_gmt":"2026-09-24T09:11:35","guid":{"rendered":"https:\/\/www.sushantmondal.com\/blog\/?p=199"},"modified":"2026-09-24T14:41:35","modified_gmt":"2026-09-24T09:11:35","slug":"install-arch-linux-inside-a-vm-full-setup","status":"publish","type":"post","link":"https:\/\/www.sushantmondal.com\/blog\/2026\/09\/24\/install-arch-linux-inside-a-vm-full-setup\/","title":{"rendered":"Install Arch Linux inside a VM (full setup)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">My host system is running Fedora Linux 44:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sushant@home:~$ cat \/etc\/os-release\nNAME=\"Fedora Linux\"\nVERSION=\"44 (KDE Plasma Desktop Edition)\"\nRELEASE_TYPE=stable\nID=fedora\nVERSION_ID=44\nVERSION_CODENAME=\"\"\nPRETTY_NAME=\"Fedora Linux 44 (KDE Plasma Desktop Edition)\"\nANSI_COLOR=\"0;38;2;60;110;180\"\nLOGO=fedora-logo-icon\nCPE_NAME=\"cpe:\/o:fedoraproject:fedora:44\"\nDEFAULT_HOSTNAME=\"fedora\"\nHOME_URL=\"https:\/\/fedoraproject.org\/\"\nDOCUMENTATION_URL=\"https:\/\/docs.fedoraproject.org\/en-US\/fedora\/f44\/\"\nSUPPORT_URL=\"https:\/\/ask.fedoraproject.org\/\"\nBUG_REPORT_URL=\"https:\/\/bugzilla.redhat.com\/\"\nREDHAT_BUGZILLA_PRODUCT=\"Fedora\"\nREDHAT_BUGZILLA_PRODUCT_VERSION=44\nREDHAT_SUPPORT_PRODUCT=\"Fedora\"\nREDHAT_SUPPORT_PRODUCT_VERSION=44\nSUPPORT_END=2027-05-19\nVARIANT=\"KDE Plasma Desktop Edition\"\nVARIANT_ID=kde<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Arch torrent download and VirtualBox setup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For downloading Arch Linux, the preferred method is to use a torrent. I used <code>ktorrent<\/code> for this. Download the latest Arch Linux ISO&#8217;s torrent file from <a href=\"https:\/\/archlinux.org\/download\/\" target=\"_blank\" rel=\"noopener nofollow\">here<\/a>. Please keep your client open for some time after downloading the file to help the community more. Try to maintain a 2:1 (up:down) ratio to fulfill your duties towards the Arch Linux open-source community.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y ktorrent\nktorrent \/path\/to\/the\/arch\/.iso.torrent\/file<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Download the latest version of VirtualBox from <a href=\"https:\/\/www.virtualbox.org\/wiki\/Linux_Downloads\" target=\"_blank\" rel=\"noopener nofollow\">here<\/a> for your current host distribution. Then run this to install VirtualBox (replace <code>dnf<\/code> with your package manager):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y kernel kernel-devel\nsudo dnf install -y \/path\/to\/the\/vbox\/.rpm\/file<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new VM with the below config (approx.). Use the <code>.iso<\/code> image that was downloaded using the torrent:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"750\" src=\"https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/09\/virtualbox-arch-linux-vm-config-1024x750.png\" alt=\"\" class=\"wp-image-206\" srcset=\"https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/09\/virtualbox-arch-linux-vm-config-1024x750.png 1024w, https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/09\/virtualbox-arch-linux-vm-config-300x220.png 300w, https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/09\/virtualbox-arch-linux-vm-config-768x562.png 768w, https:\/\/www.sushantmondal.com\/blog\/wp-content\/uploads\/2026\/09\/virtualbox-arch-linux-vm-config.png 1045w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Install Arch<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Boot the VM with the Arch image loaded. You should get a live Arch installation environment. The prompt starts with something like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@archiso ~ #<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check OS release:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/os-release<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Identify the VM&#8217;s disk:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lsblk\nlsblk -f<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Set up the partition table<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Switch `sda` with the storage device you are creating the partition table for.\nfdisk \/dev\/sda<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Aim for this ideal partition table:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Use<\/th><th>Partition (<code>NAME<\/code>)<\/th><th>Mount point (<code>MOUNTPOINTS<\/code>)<\/th><th>Type (<code>FSTYPE<\/code>)<\/th><th>Size (<code>FSAVAIL<\/code>)<\/th><th>Command to create the partition (last sector)<\/th><\/tr><\/thead><tbody><tr><td>UEFI<\/td><td><code>\/dev\/sda1<\/code><\/td><td><code>\/mnt\/boot<\/code><\/td><td><code>vfat<\/code><\/td><td>1G<\/td><td><code>+1G<\/code><\/td><\/tr><tr><td>Swap<\/td><td><code>\/dev\/sda2<\/code><\/td><td><code>[SWAP]<\/code><\/td><td><code>swap<\/code><\/td><td>2G<\/td><td><code>+2G<\/code><\/td><\/tr><tr><td>Root<\/td><td><code>\/dev\/sda3<\/code><\/td><td><code>\/mnt<\/code><\/td><td><code>ext4<\/code><\/td><td>17G<\/td><td>[Press <code>&lt;RETURN><\/code>, default = remaining size]<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Tip: Create the partitions in the order listed above. Also, press <code>&lt;RETURN><\/code> everywhere to set them to their default values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I forgot to use <code>g<\/code> in the first-install phase. Do NOT repeat my mistake, because the <code>systemd-boot<\/code> bootloader requires a GPT partition table. Follow these keystrokes in order; change wherever necessary:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>g\nn\n1\n&lt;RETURN>\n+1G\nn\n2\n&lt;RETURN>\n+2G\nn\n3\n&lt;RETURN>\n&lt;RETURN>\nt\n1\n1\nt\n2\n19\np\nw<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Before using <code>w<\/code> to write the partition table to the disk (DANGER: it modifies the partition table of the disk live), ensure you have made the correct partition table (refer to the above table) using <code>p<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Format the partitions<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Use FAT32 for the EFI partition.\nmkfs.fat -F 32 -n EFI \/dev\/sda1\n\n# Assign swap.\nmkswap \/dev\/sda2\n\n# Use EXT4 for the root partition.\nmkfs.ext4 \/dev\/sda3<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Mount the file systems<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>mount \/dev\/sda3 \/mnt\nmount --mkdir \/dev\/sda1 \/mnt\/boot\nswapon \/dev\/sda2<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Verify the new partition table<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>lsblk -f<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Arch<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Requires an internet connection to the VM.\npacstrap -K \/mnt base linux linux-firmware<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Make the file systems persistent<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>genfstab -U \/mnt &gt;&gt; \/mnt\/etc\/fstab\n\n# Verify\ncat \/mnt\/etc\/fstab<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Chroot and complete the remaining VM setup (except the bootloader)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># This lets you boot into your computer without actually booting into it.\narch-chroot -S \/mnt\n\n# Time\nln -sf \/usr\/share\/zoneinfo\/Asia\/Kolkata \/etc\/localtime\nhwclock --systohc\n\n# Localization\necho \"LANG=en_US.UTF-8\" >> \/etc\/locale.conf\necho \"KEYMAP=us\" >> \/etc\/vconsole.conf\n\n# Network\necho \"arch-vm.sushantmondal.com\" >> \/etc\/hostname\n\n# Recreate `initramfs`.\nmkinitcpio -P\n\n# Set a password for `root`.\npasswd root<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><code>systemd-boot<\/code> bootloader<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Installation<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># Install the `systemd-boot` bootloader.\nbootctl install\n\n# Verify\nbootctl status<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Use a text editor like <code>vim<\/code> to edit the configuration files<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># Install the `vim` text editor.\npacman -S --noconfirm vim\n\n# Verify\nvim --version | head -n 1<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><code>loader.conf<\/code><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">When <code>systemd-boot<\/code> reaches the boot menu, it should use the <code>arch.conf<\/code> configuration file as the default boot entry.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim \/boot\/loader\/loader.conf\n\n# Enter the insert mode to start editing.\n&lt;ESC>\ni\n\n# Append this.\ndefault  arch.conf\ntimeout  4\nconsole-mode max\neditor   no\n\n# Save and exit `vim`.\n&lt;ESC>\n:wq\n&lt;RETURN>\n\n# Verify\ncat \/boot\/loader\/loader.conf<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><code>arch.conf<\/code><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>vim \/boot\/loader\/entries\/arch.conf\n\n# Enter the insert mode to start editing.\n&lt;ESC>\ni\n\n# Use this format.\ntitle   Arch Linux\nlinux   \/vmlinuz-linux\ninitrd  \/initramfs-linux.img\noptions root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw\n\n# The easier method to replace the UUID is given below.\n\n# Write only this inside `vim`:\ntitle   Arch Linux\nlinux   \/vmlinuz-linux\ninitrd  \/initramfs-linux.img\noptions root=UUID=\n\n# Save and exit `vim`.\n&lt;ESC>\n:wq\n&lt;RETURN>\n\n# Append the root's UUID with rw dynamically directly from the shell.\necho \"$(blkid -s UUID -o value \/dev\/sda3) rw\" >> \/boot\/loader\/entries\/arch.conf\n\n# You need to manually remove the newline between `options root=UUID=` and the UUID. Use `vim` and do it.\n\n# Verify\ncat \/boot\/loader\/entries\/arch.conf<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Verify whether the configuration files were correctly implemented<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>bootctl list\nls -l \/boot\/EFI\/BOOT\/BOOTX64.EFI<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Exit the chroot and shut down your system<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>exit\n\n# Unmount recursively.\numount -R \/mnt\n\nshutdown<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Eject the <code>.iso<\/code> virtual disk from the VirtualBox interface before booting into the system again<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open <strong>Oracle VirtualBox Manager<\/strong>.<\/li>\n\n\n\n<li>Click on the <strong>Machines icon<\/strong> (left panel).<\/li>\n\n\n\n<li>Select the VM running <strong>Arch Linux<\/strong>.<\/li>\n\n\n\n<li>Click on the <strong>Settings icon<\/strong> in the top ribbon.<\/li>\n\n\n\n<li>Switch to <strong>Expert<\/strong> mode.<\/li>\n\n\n\n<li>Go to the <strong>Storage<\/strong> tab.<\/li>\n\n\n\n<li>Select the Arch Linux <code>.iso<\/code> image file under <strong>Controller: IDE<\/strong>.<\/li>\n\n\n\n<li>In the Optical Drive option, click on the <strong>blue CD icon<\/strong> on the right.<\/li>\n\n\n\n<li>Select the <strong>Remove Disk from Virtual Drive<\/strong> option from the dropdown.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Bibliography<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/wiki.archlinux.org\/title\/Installation_guide\">https:\/\/wiki.archlinux.org\/title\/Installation_guide<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/wiki.archlinux.org\/title\/Systemd-boot\">https:\/\/wiki.archlinux.org\/title\/Systemd-boot<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>My host system is running Fedora Linux 44: Arch torrent download and VirtualBox setup For downloading Arch Linux, the preferred method is to use a torrent. I used ktorrent for this. Download the latest Arch Linux ISO&#8217;s torrent file from here. Please keep your client open for some time after downloading the file to help [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[5],"tags":[38,40,37,39,41],"class_list":["post-199","post","type-post","status-publish","format-standard","hentry","category-server-hosting","tag-arch-linux","tag-install","tag-linux","tag-virtualbox","tag-vm"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts\/199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/comments?post=199"}],"version-history":[{"count":46,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts\/199\/revisions"}],"predecessor-version":[{"id":247,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/posts\/199\/revisions\/247"}],"wp:attachment":[{"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/media?parent=199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/categories?post=199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sushantmondal.com\/blog\/wp-json\/wp\/v2\/tags?post=199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}