Try fedora

Cover Image for Try fedora
Tomas
Tomas

Fedora Linux is my distribution of choice for creating modern development environment to test drive the latest open source tech. KVM virtualisation is a great way to test drive Fedora itself. There are multiple ways of installing fedora on a virtual machine, automated installation is performed using kickstart file. Below is minimum kickstart configuration for custom Fedora installation.

#version=DEVEL

# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'

# Use text mode install
text

# System language
lang en_US.UTF-8

# System timezone
timezone UTC --isUtc

# Network information
network  --hostname=fedora-min --bootproto=dhcp --device=link --activate

# Firewall configuration
firewall --enabled --service=ssh

# Do not configure the X Window System
skipx

# System services
services --enabled=sshd,chronyd

# Root password
rootpw --plaintext fedora

# Only use vda disk
ignoredisk --only-use=vda

# Partition clearing information
clearpart --all --initlabel --drives=vda

# System bootloader configuration
bootloader --location=mbr --boot-drive=vda --append="net.ifnames=0 biosdevname=0"

# Auto partition table
autopart --type=plain

# Use net install
url --url="https://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/"

# Enable repos
repo --name=os --baseurl="https://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/"
repo --name=updates --baseurl="https://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/Everything/$basearch/"

# Packages
%packages
@^custom-environment
%end

# halt after installation
halt

virt-install is libvirt wrapper supporting VM installations from different sources. Below is automated network based Fedora installation using a kickstart file.

virt-install \
--name f32-min \
--ram 2048 \
--os-type linux \
--os-variant fedora31 \
--graphics none \
--disk=./f32-min.vda.x86_64.qcow2,bus=virtio,format=qcow2,size=7 \
--location=https://download.fedoraproject.org/pub/fedora/linux/releases/32/Everything/x86_64/os \
--initrd-inject ./ks-min.cfg \
--extra-args="inst.ks=file:/ks-min.cfg console=ttyS0 net.ifnames=0 biosdevname=0"

After command executed kernel and ramdisk image are downloaded, and machine is started. Shortly after fedora installation image is downloaded and mounted. Kickstart file is injected and made available to booted system. Anaconda installer is started automatically as inst.ks boot option is set and installation completes without any prompts.

Installation log is available here. As kickstart file contains halt attribute, system halts after the installation. CTRL+] will exit the libvirt console and the machine can be managed via virsh. Halted machine can be powered down running virsh destroy f32-min and started again using virsh start f32-min --console

Log in using root user credentials from kickstart file and run some commands.

Fedora 32 (Thirty Two)
Kernel 5.6.8-300.fc32.x86_64 on an x86_64 (ttyS0)

fedora-min login: root
Password: 
[root@fedora-min ~]# uname -a
Linux fedora-min 5.6.8-300.fc32.x86_64 #1 SMP Wed Apr 29 19:01:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@fedora-min ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        978M     0  978M   0% /dev
tmpfs           990M     0  990M   0% /dev/shm
tmpfs           990M  604K  990M   1% /run
/dev/vda3       5.2G  959M  4.0G  20% /
tmpfs           990M  4.0K  990M   1% /tmp
/dev/vda1       976M  100M  809M  11% /boot
tmpfs           198M     0  198M   0% /run/user/0
[root@fedora-min ~]# nmcli c
NAME  UUID                                  TYPE      DEVICE 
eth0  5adf93ae-e7e9-4c6c-8b59-89811094da48  ethernet  eth0   
[root@fedora-min ~]# dnf update
Fedora 32 openh264 (From Cisco) - x86_64        2.0 kB/s | 5.1 kB     00:02    
Fedora Modular 32 - x86_64                      1.7 MB/s | 4.9 MB     00:02    
Fedora Modular 32 - x86_64 - Updates            1.1 MB/s | 1.4 MB     00:01    
Fedora 32 - x86_64 - Updates                    3.9 MB/s | 7.5 MB     00:01    
Fedora 32 - x86_64                              6.9 MB/s |  70 MB     00:10    
Dependencies resolved.
Nothing to do.
Complete!
[root@fedora-min ~]# poweroff

Getting started with virtualization is a good libvirt/KVM reference.

Fedora project documentation has information on commonly performed tasks on Fedora systems. https://docs.fedoraproject.org/en-US/fedora/f32/

back