Create a new VM
Select UEFI boot > turn on the VM
Verify the boot mode
List the efivars directory with the following command:
# ls /sys/firmware/efi/efivars
Ensure the system has network interfaces enabled by checking with ip-link
# ip link
View basic information about the current operating system with
# fdisk -l
Make sure the system time is accurate with timedatectl
# timedatectl set-ntp true
The status of the service can be checked using timedatectl status
Create hard disk partitions
lsblk->view total hard disk space
Zoning:
cfdisk /dev/sda->type->gpt
New partitions:
First: EFI boot partition: 512M
Second: system partition: 18.5G
Third: linux swap partition: 1G
Change the partition types to EFI system; Linux root (X86-64); linux swap respectively
write->yes-><CR>->Quit
Modify the disk partition format:
mkfs.fat -F32 /dev/sda1 EFI boot disk format
mkfs.ext4 /dev/sda2 linux system primary partition format
mkswap /dev/sda3 system swap partition
A swapped space volume is created, enable it with swapon:
Enable the swap partition with swapon
Mount the partition
Mount the root volume to /mnt.
mount /dev/sda2 /mnt
Put the EFI file in the boot folder: pacsgen
mkdir -p /mnt/boot/EFI
mount /dev/sda1 /mut/boot/EFI
Install the necessary packages (install the system)
pacstrap /mnt base linux vim dhcpcd (linux-firmware required in physical machine)
Generate an fstab file
# genfstab -U /mnt >> /mnt/etc/fstab
Access to the newly installed system
# arch-chroot /mnt
Set the time zone
# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
Update the time zone:
# hwclock --systohc --utc
Geographic settings
# vim /etc/locale.gen
Uncomment #es_ES.UTF-8 UTF-8 (Spanish Spain)
#en_US.UTF-8 UTF-8 (English) before the #
setting:
# locale-gen
Use # locale -a to see the Arch system language
Set the system default language to Spanish:
# echo.UTF-8 > /etc/locale.conf
Network configuration, create hostname file
Change the hostname:
# echo Arch linux > /etc/hostname
Modify the hosts file: # vim /etc/hosts
# vim /etc/hosts
127.0.0.1 localhost
: : 1 localhost
127.0.1.1 Arch Linux.localdomain Arch linux
Root password settings
# passwd
Set up a non-root user:
# useradd -m -G wheel -s /bin/bash yuluo
Set a password: # pawsswd yuluo
# pawsswd yuluo
Check the network
# ping www.baidu.com
Press ctrl+c to stop
Install the bootloader
# pacman -S grub efibootmgr intel-ucode
Install grub on the UEFI boot partition:
# grub-install
Generate configuration file exit:
# grub-mkconfig -o /boot/grub/grub.cfg
Exit the system to the CD-ROM:
# exit
Configure the network
# vim /etc/rc.conf add interface=eth0
Save and exit; run dhcpcd
Exit mount point
# umount -R /mnt
The treatment of not being able to connect to the network after a reboot
# vim /etc/rc.conf
Add interface = eth0
Install sudo: pacman -S sudo
Open:
# visudo
Add sudo privileges to the regular user:
Add yuluo ALL=(ALL) ALL after root ALL=(ALL) ALL
Configure Arch Linux
# pacman -S man (software manual)
# pacman -S base-devel (base package)
Conclusion
Installing Arch Linux on VMware requires creating a new virtual machine, setting up partitions and file systems, configuring the system clock, installing essential packages, configuring the network, creating user accounts, and installing the bootloader to ensure proper system initialization and operation.