Slackware doesn’t defaultly support virtio, so if you’re running Slackware in a virtualized environment you’re going to need to give it a little push to get it to boot after install. First let’s get the obvious solution out there:
Obvious solution: Don’t use Slackware. (duh)
In the particular case a customer insists he needs it so here we go.
After install there is no boot loader installed (which is lilo for Slackware… super retro). The reason no boot loader is installed is because it attempts to install the boot loader to /dev/sda which doesn’t exist. So no big deal. Boot up using the install CD and just hit enter at every prompt until you have to enter a username and enter root.
The partition /dev/vda2 is our / in this example. Once booted we’re going to need to get this thing running on the root for the newly installed system. We do that like this:
# mkdir /mnt/sysimage
# mount /dev/vda2 /mnt/sysimage
# mount -t proc proc /mnt/sysimage/proc/
# mount -t sysfs sys /mnt/sysimage/sys/
# mount -o bind /dev /mnt/sysimage/dev/
# chroot /mnt/sysimage
We’re going to need to change the boot line in /etc/lilo.conf:
Before: boot = /dev/sda
After: boot = /dev/vda
Now there’s a problem. If we try to install lilo we get this error:
# /sbin/lilo
Fatal: Linux experimental device 0xfc00 needs to be defined.
It has no idea what this new type of device is. So we have to tell it some info that it can’t assume on its own. Add this line to /etc/lilo.conf:
disk = /dev/vda bios=0x80 max-partitions=7
I put it right before the boot line but I don’t think it matters. Alright so go ahead and install lilo to the disk.
# /sbin/lilo
It should succeed now, possibly with a few errors. If you try to reboot now it will find the boot loader and start booting the system. The problem however is that it doesn’t know anything about the virtio device so it won’t be able to mount the system. We need to give it a ramdisk. Generate one with the following commands:
# /usr/share/mkinitrd/mkinitrd_command_generator.sh >> /buildramdisk.sh
# sh /buildramdisk.sh
Ok, now we have a ramdisk. Next we have to tell lilo to use it by adding the following line to /etc/lilo.conf:
initrd = /boot/initrd.gz
I put it below the image line but I don’t think it matters. If we had built the ramdisk before install lilo again we could have saved us this trouble but we do have to install it again because we changed its config:
/sbin/lilo
Boot it up and you should be good to go.