MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap
Revision 21 as of 2026-10-24 14:50:07
  • Slackware
  • VagrantSlack3215Box

Contents

  1. VagrantSlack3215Box
    1. Get ISO and install
    2. Test installation and install extra packages
    3. Install guest additions
    4. vagrant sudoers
    5. UseDNS in SSH
    6. SSH insecure pair in vagrant
    7. Disable audio in Virtualbox
    8. Set first network adapter as a NAT one
    9. Remove optical devices
    10. Create vagrant box
    11. Update Slackware 64

VagrantSlack3215Box

Steps to create a Slackware 15 (32-bit) vagrant box with LVM support.

Get ISO and install

   1 cd ~
   2 https://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/slackware-iso/slackware-15.0-iso/slackware-15.0-install-dvd.iso
   3 sudo modprobe -r kvm_intel
   4 virtualbox &
   5 # start virtualbox 
   6 # new, name: slackware32-15
   7 # linux, other linux,  other linux(32-bit) , next 
   8 # 512 RAM, next 
   9 # Create a virtual hard disk now, create, VDI, next,  dynamically allocated, next,  64GB, create 
  10 # start VM 
  11 # choose slackware-15.0-install-dvd.iso
  12 # start 
  13 # boot: <enter>
  14 # 1, select keyboard 
  15 # qwerty/pt.map 
  16 # 1 <enter>
  17 # login as root 
  18 # create 2 partitions ...
  19 fdisk /dev/sda 
  20 # n p 1 default 2048 +512M
  21 # n p 2 default 1050624 +63G
  22 # select Linux LVM
  23 # t 2 L 8e 
  24 # p
  25 # w
  26 # LVM stuff 
  27 pvcreate /dev/sda2
  28 vgcreate sysvg /dev/sda2
  29 lvcreate -L 62G -n root sysvg
  30 pvscan 
  31 setup 
  32 # go to target # /dev/sysvg/root select 
  33 # quick format, ok ext 4
  34 # select other linux partition /dev/sda1 
  35 # quick format, ext4 
  36 # select mount point for /dev/sda1 mount point /boot 
  37 # fstab 
  38 # /dev/sysvg/root for the root directory (/) 
  39 # /dev/sda1 for /boot 
  40 # mount point /boot 
  41 # install from slackware cd or dvd 
  42 # scanning for cd or dvd: auto 
  43 # only select package A and AP
  44 # full 
  45 # configure the system, yes 
  46 # make usb flash boot: skip ok 
  47 # install lilo, simple 
  48 # configure lilo: lilo standard 
  49 # optional lilo:  <blank> 
  50 # select lilo destination MBR 
  51 # GPM configuration: no 
  52 # select services: crond messagebus syslog 
  53 # custom screen fonts no 
  54 # hw clock set to utc no 
  55 # timezone configuration: europe/lisbon 
  56 # nvi classic BSD utf8 
  57 # set root password: vagrant 
  58 # exit setup, go to shell 
  59 
  60 chroot /mnt # it is probably the LVM volume !
  61 #$( /usr/share/mkinitrd/mkinitrd_command_generator.sh -r )
  62 KERNEL_VER=$(ls /lib/modules | head -n 1)
  63 echo $KERNEL_VER
  64 # get file system
  65 mkinitrd -c -k $KERNEL_VER -f ext4 -r /dev/sysvg/root -m dm-mod:ata_piix:ahci:libata:sd_mod -L
  66 
  67 # /boot/initrd.gz 
  68 cat /etc/lilo.conf | grep -v "#"
  69 
  70 nano /etc/lilo.conf
  71 append=" "
  72 boot = /dev/sda
  73 compact 
  74 
  75 prompt
  76 timeout = 50
  77 change-rules
  78   reset
  79 vga = normal
  80 image = /boot/vmlinuz-generic
  81   label = LinuxTest
  82   initrd = /boot/initrd.gz
  83   read-only
  84  
  85 lilo
  86 exit 
  87 
  88 vgscan --mknodes
  89 vgchange -ay
  90 mount /dev/sysvg/root /mnt
  91 mount /dev/sda1 /mnt/boot
  92 mount -o bind /dev /mnt/dev
  93 mount -o bind /proc /mnt/proc
  94 mount -o bind /sys /mnt/sys
  95 
  96 chroot /mnt /bin/bash
  97 # in chroot
  98 mount /dev/sr0 /mnt
  99 upgradepkg --reinstall /mnt/slackware/a/kernel-modules-5.15.19*.txz
 100 ls -l /lib/modules/5.15.19/kernel/fs/ext4/
 101 
 102 KERNEL_VER=$(ls /lib/modules | head -n 1)
 103 echo $KERNEL_VER
 104 mkinitrd -c -k $KERNEL_VER -f ext4 -r /dev/sysvg/root -m dm-mod:ext4 -L
 105 
 106 #Several modules added after mkinitrd
 107 #jdb2 mbcache ext4 dm-bufio dm-snapshot
 108 
 109 nano /etc/lilo.conf
 110 append=" "
 111 boot = /dev/sda
 112 compact 
 113 
 114 prompt
 115 timeout = 50
 116 change-rules
 117   reset
 118 vga = normal
 119 image = /boot/vmlinuz-generic
 120   label = LinuxTest
 121   initrd = /boot/initrd.gz
 122   read-only
 123 
 124 exit 
 125 
 126 lilo -r /mnt
 127 exit
 128 reboot 

Test installation and install extra packages

   1 # login root:vagrant 
   2 df -h # used 1.4G 
   3 # mount DVD slack iso virtualbox 
   4 mount /dev/sr0 /mnt/dvd 
   5 cd /mnt/dvd/slackware/
   6 installpkg k/kernel-source*txz 
   7 
   8 installpkg l/libunis*txz 
   9 installpkg l/gc-8*txz 
  10 installpkg l/ncurses-6*txz
  11 
  12 installpkg d/make*txz 
  13 installpkg d/gcc-11.2*txz 
  14 installpkg d/perl-5*txz 
  15 installpkg d/guile-3*txz 
  16 installpkg d/binutils*txz 
  17 
  18 installpkg ap/slackpkg-15*.txz 
  19 installpkg ap/sudo-*.txz
  20 
  21 installpkg n/network-scripts-15.0-noarch-18.txz
  22 installpkg n/net-tools-20181103_0eebece-x86_64-3.txz
  23 installpkg n/dhcp-4.4.2_P1-x86_64-1.txz
  24 installpkg n/iproute2*.txz
  25 installpkg n/libmnl-1*.txz
  26 installpkg n/dhcpcd-9*txz
  27 installpkg n/iputils-*.txz
  28 installpkg n/openssh-*.txz
  29 installpkg n/wget-1*.txz
  30 installpkg n/ca-certificates-2021*.txz
  31 installpkg n/openssl-1*.txz
  32 installpkg n/gnupg-1.4.23-x86_64-4.txz
  33 
  34 vi /etc/rc.d/rc.inet1.conf 
  35 USE_DHCP[0]="yes" 
  36 
  37 /etc/rc.d/rc.inet1 
  38 cd / 
  39 umount /mnt/dvd  
  40 reboot 
  41 
  42 # login root:vagrant 
  43 ping -c3 www.sapo.pt 
  44 ping www.sapo.pt 

Install guest additions

   1 umount /mnt/dvd 
   2 # Menu "Devices" followed by "Insert guest additions cd image ". 
   3 mount /dev/sr0 /mnt/dvd
   4 cd /mnt/dvd 
   5 ./VBoxLinuxAdditions.run 
   6 # unmount cd image in Virtualbox
   7 reboot 
   8 # login and reboot again 
   9 

vagrant sudoers

login with root:vagrant

   1 adduser vagrant # com pwd vagrant 
   2 groupadd sudo 
   3 
   4 usermod -aG sudo vagrant 
   5 visudo
   6 
   7 vagrant ALL=(ALL) NOPASSWD: ALL
   8 
   9 exit 
  10 login vagrant:vagrant 
  11 
  12 sudo bash # should not ask for password 
  13 exit 

UseDNS in SSH

   1 sudo bash 
   2 cd /etc/ssh 
   3 vi sshd_config 
   4 # disable line with "UseDNS" no 
   5 /etc/rc.d/rc.sshd restart 

SSH insecure pair in vagrant

   1 mkdir ~/.ssh 
   2 cd ~/.ssh 
   3 wget --no-check-certificate https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub
   4 mv vagrant.pub authorized_keys
   5 chmod 0600 authorized_keys 
   6 chmod 0700 /home/vagrant/.ssh 
   7 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

   1 cd /tmp 
   2 vagrant package --base slackware64-15
   3 ls
   4 # package.box
   5 vagrant box add --name slack64-15-box /tmp\package.box
   6 vagrant init slack64-15-box
   7 vagrant up
   8 vagrant ssh
   9 df -h
  10 # /dev/mapper/sysvg-root   61G  3.0G   55G   6% /
  11 md5sum /vagrant/package.box
  12 xxxxx  /vagrant/package.box

Update Slackware 64

   1 vagrant ssh 
   2 sudo bash 
   3 cd /tmp 
   4 wget --no-check-certificate  https://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/slackware64-15.0/slackware64/n/openssl-1.1.1m-x86_64-1.txz
   5 wget --no-check-certificate  https://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/slackware64-15.0/slackware64/n/ca-certificates-20211216-noarch-1.txz
   6 /sbin/installpkg ca-certificates-20211216-noarch-1.txz
   7 /sbin/installpkg openssl-1.1.1m-x86_64-1.txz
   8 /usr/sbin/update-ca-certificates --fresh
   9 echo "https://mirror.slackbuilds.org/slackware/slackware64-15.0/" >>  /etc/slackpkg/mirrors
  10 wget  https://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/slackware64-15.0/slackware64/n/gnupg-1.4.23-x86_64-4.txz
  11 /sbin/installpkg gnupg-1.4.23-x86_64-4.txz
  12 /usr/sbin/slackpkg update gpg 
  13 /usr/sbin/slackpkg update
  14 /usr/sbin/slackpkg upgrade-all
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01