Installing Arch Linux inside a VM (KVM) on Debian

Starting points:

The steps I took:

1. Create new VM
In KVM Front End (2 cores, 3096MB, 30GB HDD), boot from the Arch Linux image (you need to download an ISO image for that)
2. Boot into Arch
set
3. Partition table:
$ parted /dev/sda mklabel gpt
$ parted /dev/sda
> mkpart primary 1MiB 2MiB
> set 1 bios_grub on
> mkpart primary 2MiB 100%
> q
4. Get the file system ready:
$ mkfs -t ext4 /dev/sda2
$ mount /dev/sda2 /mnt
5. Install the basics
$ pacstrap -i /mnt base
6. Generate fstab
$ genfstab -U -p /mnt >> /mnt/etc/fstab
7. Set locales and timezone
$ arch-chroot /mnt
$ nano /etc/locale.gen
Uncomment the line with your locales and save the file.
$ echo LANG=de_DE.UTF-8 > /etc/locale.conf
In my case I choose German.
$ export LANG=de_DE.UTF-8
$ locale-gen
$ nano /etc/vconsole.conf
KEYMAP=de-latin1
In my case I'm using German keyboard layout
$ ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
$ hwclock --systohc
8. Set password for root
$ passwd root
9. Install grub and os-prober
$ pacman -S grub os-prober
$ grub-install /dev/sda --target=i386-pc
$ grub-mkconfig -o /boot/grub/grub.cfg
9 Exit arch-chroot and restart
$ exit
$ shutdown -r now
10. Fix network
a) When I rebootet after the steps above taken, the network was broken - there was no network configuration within Arch. I'm using Virtual Network 'default': NAT and  rtl8139 as device model as my virtual network configuration (Hypervisor standard).
b) In order to figure out the IP address of the VM container so I can configure the ehternet settings, I had to start my other working VM: Ubuntu 17.10. Here, running ip addr will show the IP address (in my case 192.168.122.157/24). By running traceroute google.com I figured out which gateway IP to use (192.168.122.1 in my case).
c) With this information I went back to Arch VM and adjusted my network settings:
$ cp /etc/netctl/examples/ethernet-static /etc/netctl
$ nano /etc/netctl/ethernet-static
Interface=ens3
Address=('192.168.122.158/24' '192.168.122.255/24')
Gateway='192.168.122.1'
DNS=('8.8.8.8')
Save the file, quit nano.
$ ip link set dev ens3 down
$ netctl start ethernet-static
$ netctl enable ethernet-static
The network access should work now. Test with:
$ ping google.com

From here on, you can continue configuring your Arch as you wish. It's a good idea to create an another user first, add this user to sudoers and continue working as this user.

%d Bloggern gefällt das: