KVM // install slackware from rescue/install system

descr

this applies to both kvm guest and bare-metal

guest skeleton

this is for preparing bare-metal install, as we would otherwise simply bootstrap slackware

guest=slackconsole

mkdir -p /data/guests/$guest/
cd /data/guests/$guest/

#virsh destroy $guest
#virsh undefine $guest

with VNC up and point to CDROM

virt-install --name $guest --vcpus 1 --ram 512 \
    --disk path=/data/guests/$guest/$guest.qcow2,size=25,bus=virtio \
    --network bridge=virbr0,model=virtio \
    --graphics vnc --accelerate \
    --console pty,target_type=serial \
    --os-variant slackware15.0 \
    --cdrom /data/ISO-IMAGES/slackware/slackware64-15.0-install-dvd.iso

    # --osinfo detect=on,require=off

–or– through PXE

virt-install --osinfo list | grep slackware

virt-install --name $guest --vcpus 1 --ram 512 \
    --disk path=/data/guests/$guest/$guest.qcow2,size=25,bus=virtio \
    --network bridge=virbr0,model=virtio \
    --graphics vnc --accelerate \
    --console pty,target_type=serial \
    --os-variant slackware15.0 \
    --pxe

reach the vga console

xtightvncviewer localhost:5900

prepare the network with –either– dhcp

dhcpcd

–or– manually

ifconfig eth0 192.168.122.9 netmask 255.255.255.0
route add default gw 192.168.122.1
vi /etc/resolv.conf

nameserver 208.67.222.222

and check

ping -c3 opendns.com

prepare the disk (be it vdisk or bare-metal volume) and filesystem

cfdisk /dev/vda

(dos)
vda1 bootable   Linux       24G
vda2        Linux swap  1G

bootstrap from install medium

here comes the slackstrap+slackconf system instead of the casual setup menu

mkswap /dev/vda2
mkfs.ext4 /dev/vda1

grab the scripts

wget http://pub.nethence.com/bin/slackstart/slackstart.conf
wget http://pub.nethence.com/bin/slackstart/slackstrap.bash
wget http://pub.nethence.com/bin/slackstart/slackconf.bash
chmod +x slackstrap.bash slackconf.bash

proceed (http is fine enough for internal network, we don’t have ca bundles anyhow within the slackware install medium)

mkdir lala/
mount /dev/vda1 lala/

vi slackstart.conf # change mirror
source slackstart.conf
curl -I $mirror

    time ./slackstrap.bash lala

# 1m11

don’t forget to add a kernel and some boot-blocks

    time ./slackstrap.bash lala kernel

note in case you don’t have enough space into the RAMDISK (the kernel-firmware package is huge), the trick is to us the target storage itself as for temporary package archives

cd lala/
    time ../slackstrap.bash . kernel
cd ../

make it bootable

tune the system and enable LILO (since we are on the system console, we do have the same disk drive name as the target system, which is not the case when we boostrap an image from elsewhere)

    vi slackstart.conf

    tz=Europe/Moscow
    fs=ext4
    vpartition=/dev/vda1
    serial=ttyS0
    swap=1
    boot=lilo

cat /etc/fstab
ls -lF lala/sbin/lilo
    ./slackconf.bash $guest lala

note in case this is a KVM guest, the script also works around the default slackware kernel that is not entirely virtio-aware, by defining disk and max-partitions

ready to go

umount -R lala/
sync
reboot

troubleshooting

while running lilo

Fatal: Linux experimental device ... needs to be defined

==> define disk and max-partitions as shown above

resources

http://johnrey.es/index.php/2015/10/15/slackwarevirtio-no-boot-loader-installedfatal-linux-experimental-device-0xfc00-needs-to-be-defined/


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Licensed under MIT