<> = VagrantSlack3215Box = Steps to create a Slackware 15 (32-bit) vagrant box with LVM support. == Get ISO and install == {{{#!highlight sh cd ~ https://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/slackware-iso/slackware-15.0-iso/slackware-15.0-install-dvd.iso sudo modprobe -r kvm_intel virtualbox & # start virtualbox # new, name: slackware32-15 # linux, other linux, other linux(32-bit) , next # 512 RAM, next # Create a virtual hard disk now, create, VDI, next, dynamically allocated, next, 64GB, create # start VM # choose slackware-15.0-install-dvd.iso # start # boot: # 1, select keyboard # qwerty/pt.map # 1 # login as root # create 2 partitions ... fdisk /dev/sda # n p 1 default 2048 +512M # n p 2 default 1050624 +63G # select Linux LVM # t 2 L 8e # p # w # LVM stuff pvcreate /dev/sda2 vgcreate sysvg /dev/sda2 lvcreate -L 62G -n root sysvg pvscan setup # go to target # select /dev/sysvg/root # quick format, ok ext 4 # select other linux partition /dev/sda1 # quick format, ext4 # select mount point for /dev/sda1 mount point /boot # fstab # /dev/sysvg/root for the root directory (/) # /dev/sda1 for /boot # mount point /boot # install from slackware cd or dvd # scanning for cd or dvd: auto # only select serie A # full # configure the system, yes # make usb flash boot: skip ok # install lilo, simple # configure lilo: lilo standard # optional lilo: # Select lilo destination: MBR # GPM configuration: no # select services: rc.crond rc.messagebus rc.syslog # custom screen fonts no # hw clock set to utc no # timezone configuration: europe/lisbon # Choose default ex/vi: vim # set root password: vagrant # exit setup, go to shell vgscan --mknodes vgchange -ay mount /dev/sysvg/root /mnt mount /dev/sda1 /mnt/boot mount -o bind /dev /mnt/dev mount -o bind /proc /mnt/proc mount -o bind /sys /mnt/sys chroot /mnt /bin/bash # in chroot # make sure the Slack ISO is chosen in virtualbox mount /dev/sr0 /mnt upgradepkg --reinstall /mnt/slackware/a/kernel-modules-5.15.19*.txz ls -l /lib/modules/5.15.19/kernel/fs/ext4/ KERNEL_VER=$(ls /lib/modules | head -n 1) echo $KERNEL_VER mkinitrd -c -k $KERNEL_VER -f ext4 -r /dev/sysvg/root -m dm-mod:ext4 -L #Several modules added after mkinitrd #jdb2 mbcache ext4 dm-bufio dm-snapshot vi /etc/lilo.conf append=" " boot = /dev/sda compact prompt timeout = 50 change-rules reset vga = normal image = /boot/vmlinuz-generic label = LinuxTest initrd = /boot/initrd.gz read-only exit lilo -r /mnt exit # unomount DVD in virtualbox reboot }}} == Test installation and install extra packages == {{{#!highlight sh # login root:vagrant df -h # used 1.5G # mount DVD slack iso virtualbox mount /dev/sr0 /mnt/dvd cd /mnt/dvd/slackware/ installpkg k/kernel-source*txz installpkg l/libunis*txz installpkg l/gc-8*txz installpkg l/ncurses-6*txz installpkg d/make*txz installpkg d/gcc-11.2*txz installpkg d/perl-5*txz installpkg d/guile-3*txz installpkg d/binutils*txz installpkg ap/slackpkg-15*.txz installpkg ap/sudo-*.txz installpkg n/network-scripts-15.0-noarch-18.txz installpkg n/net-tools-20181103_0eebece-x86_64-3.txz installpkg n/dhcp-4.4.2_P1-x86_64-1.txz installpkg n/iproute2*.txz installpkg n/libmnl-1*.txz installpkg n/dhcpcd-9*txz installpkg n/iputils-*.txz installpkg n/openssh-*.txz installpkg n/wget-1*.txz installpkg n/ca-certificates-2021*.txz installpkg n/openssl-1*.txz installpkg n/gnupg-1.4.23-x86_64-4.txz vi /etc/rc.d/rc.inet1.conf USE_DHCP[0]="yes" /etc/rc.d/rc.inet1 # run command, it should get an ip ping -c 3 www.google.com # should get replies cd / umount /mnt/dvd # remove in virtualbox the ISO for slack reboot # login root:vagrant ping -c 3 www.sapo.pt }}} == Install guest additions == {{{#!highlight sh umount /mnt/dvd # Menu "Devices" followed by "Insert guest additions cd image ". mount /dev/sr0 /mnt/dvd cd /mnt/dvd ./VBoxLinuxAdditions.run # unmount cd image in Virtualbox reboot # login and reboot again }}} == vagrant sudoers == login with root:vagrant {{{#!highlight sh df -h # 3.0 GB at / adduser vagrant # with pwd vagrant groupadd sudo usermod -aG sudo vagrant visudo # insert after root user line vagrant ALL=(ALL) NOPASSWD: ALL exit login vagrant:vagrant sudo bash # should not ask for password exit }}} == UseDNS in SSH == {{{#!highlight sh sudo bash vi /etc/ssh/sshd_config # disable line with "UseDNS" no #UseDNS no /etc/rc.d/rc.sshd restart # run command exit }}} == SSH insecure pair in vagrant == {{{#!highlight sh # in /home/vagrant folder as vagrant user cd /home/vagrant mkdir ~/.ssh cd ~/.ssh wget -k https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub mv vagrant.pub authorized_keys chmod 0600 authorized_keys chmod 0700 /home/vagrant/.ssh sudo /sbin/shutdown -h now }}} == Disable audio in Virtualbox == Virtualbox, vm settings, audio, disable == Set first network adapter as a NAT one == Virtualbox, settings vm, adapter 1, NAT == Remove optical devices == Virtualbox, settings, storage, remove mounted optical drives == Create vagrant box == {{{#!highlight sh cd /tmp vagrant package --base slackware32-15 ls -lah *box # package.box 1.8 G vagrant box add --name slack32-15-box /tmp/package.box --force rm Vagrantfile vagrant init slack32-15-box vagrant up vagrant ssh df -h # /dev/sysvg/root 61G 3.0G 55G 6% / exit cp package.box ~/vagrant-boxes/slack32-15.box cd ~/vagrant-boxes/ git add . git commit -m "Added slackware 15 32 bit" git pull origin git push origin md5sum /vagrant/package.box xxxxx /vagrant/package.box cd /tmp/ mkdir -p slack32-15 cd slack32-15 vagrant box remove slack32-15-box vagrant box list curl -L -o slack32-15.box "https://github.com/vborrego/vagrant-boxes/raw/refs/heads/main/slack32-15.box?download=" vagrant box list vagrant box add --name slack32-15 slack32-15.box vagrant init slack32-15 cat Vagrantfile | grep -v "#" vagrant up echo "hello" > hello.txt vagrant ssh }}} == Update Slackware == {{{#!highlight sh vagrant ssh sudo bash sudo bash export SLACK_MIRROR="https://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/slackware-15.0" /usr/sbin/slackpkg update gpg /usr/sbin/slackpkg update /usr/sbin/slackpkg upgrade-all # unselect all related with kernel exit exit vagrant reload }}}