ctarbi.de - slackware64 13.37 from 2011 on qemu v8.1.3

How to install x86_64 (and x86 too) version of Slackware Linux version 13.37 from 2011.

Some tips below.

The slack64.sh that follows is a live literate program [1].

slack64.sh:

#!/bin/sh
# https://ctarbide.github.io/pages/2024/2024-02-05_12h00m11_hello-worlds/
# https://github.com/ctarbide/coolscripts/blob/master/bin/nofake-exec.nw
set -eu; set -- "${0}" --ba-- "${0}" "$@" --ea--
SH=${SH:-sh}; export SH
exec nofake-exec.sh --error -Rmain "$@" -- "${SH}" -eu
exit 1

This is a live literate program.

<<base image>>=
slack64-base.qcow2
@

<<backed image>>=
slack64.qcow2
@

<<base image size>>=
20G
@

stat's ctime is not portable/reliable, use mtime of a different file instead

<<base image created>>=
<<base image>>.created
@

<<iso installer>>=
slackware64-13.37-install-dvd.iso
@

<<main>>=
set -- "${1}" --ba-- "$@" --ea--
nofake-exec.sh --error -R'step 1 - create base image' "$@" -- "${SH}" -eu
nofake-exec.sh --error -R'step 2 - start installer' "$@" -- "${SH}" -eu
nofake-exec.sh --error -R'step 3 - create backed image' "$@" -- "${SH}" -eu
nofake-exec.sh --error -R'step 4 - first run' "$@" -- "${SH}" -eu
echo all done
@

<<step 1 - create base image>>=
if [ ! -f '<<base image>>' ]; then
    qemu-img create -f qcow2 '<<base image>>' '<<base image size>>'
    perl -le'print(q{mtime should be } . time)' > '<<base image created>>'
fi
@

boot installer dvd if base image was created 5 seconds ago

<<step 2 - start installer>>=
<<function time_delta>>
if [ "`time_delta '<<base image created>>'`" -le 5 ]; then
    qemu-system-x86_64 -m 4096 -enable-kvm \
        -monitor stdio \
        -hda '<<base image>>' \
        -cdrom '<<iso installer>>' \
        -boot d
fi
@

<<step 3 - create backed image>>=
if [ ! -f '<<backed image>>' ]; then
    chmod a-w '<<base image>>'
    qemu-img create -f qcow2 -o backing_file='<<base image>>' \
        -F qcow2 '<<backed image>>'
fi
@

hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport

<<user mode network with hostfw>>=
-netdev user,id=netid0,hostfwd=tcp::6422-:22 \
-device e1000,netdev=netid0
@

<<step 4 - first run>>=
qemu-system-x86_64 -m 4096 -enable-kvm \
    <<user mode network with hostfw>> \
    -monitor stdio \
    -hda '<<backed image>>'
@

<<function time_delta>>=
time_delta(){
    perl -sle'@s = stat $name; print time - $s[9]' -- -name="${1}"
}
@

<<tips>>=

### add a new "slack" user to the system

The command below suggests the appropriate groups:

    adduser slack

### ssh connection to guest from host using qemu's port forward

in host:

    TERM=screen ssh -p6422 slack@127.0.0.1

### ssh connection to guest from host using ssh port forward

in guest:

    ssh -R2223:127.0.0.1:22 hostuser@10.0.2.2 'while date; do sleep 30; done'

in host:

    TERM=screen ssh -p2223 slack@127.0.0.1

@

nofake -Rclean slack64.sh

<<clean>>=
rm -fv '<<base image>>' '<<base image created>>' '<<backed image>>'
@

[1]: literate program ready for execution, i.e. self-tangling

Screenshots

12-11-28

Choose sda2 for / (root) and sda1 for /boot, format both as ext4, install everything ("full" installation).

Installation will take some minutes, progress will be shown and these were the final dialogs:

12-19-21

12-20-12

12-20-22

12-20-52

12-21-02

12-21-32

12-22-16

12-22-29

12-22-41

12-23-25

12-24-21

12-24-45

12-25-24

12-25-56

12-59-14

13-00-18

Tips

add a new "slack" user to the system

The command below suggests the appropriate groups:

adduser slack

ssh connection to guest from host using qemu's port forward

in host:

TERM=screen ssh -p6422 slack@127.0.0.1

ssh connection to guest from host using ssh port forward

in guest:

ssh -R2223:127.0.0.1:22 hostuser@10.0.2.2 'while date; do sleep 30; done'

in host:

TERM=screen ssh -p2223 slack@127.0.0.1

Later on I made a 32-bit version too, instructions inside.

References

More details in the link below.

This page was last modified on February 17, 2024 at 14:24:13 UTC.