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 51 as of 2026-10-24 20:23:31
  • 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

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 
  33 # go to target 
  34 # select /dev/sysvg/root 
  35 # quick format, ok ext 4
  36 # select other linux partition /dev/sda1 
  37 # quick format, ext4 
  38 # select mount point for /dev/sda1 mount point /boot 
  39 # fstab 
  40 # /dev/sysvg/root for the root directory (/) 
  41 # /dev/sda1 for /boot 
  42 # mount point /boot 
  43 # install from slackware cd or dvd 
  44 # scanning for cd or dvd: auto 
  45 # only select serie A 
  46 # full 
  47 # configure the system, yes 
  48 # make usb flash boot: skip ok 
  49 # install lilo, simple 
  50 # configure lilo: lilo standard 
  51 # optional lilo:  <blank> 
  52 # Select lilo destination: MBR 
  53 # GPM configuration: no 
  54 # select services: rc.crond rc.messagebus rc.syslog 
  55 # custom screen fonts no 
  56 # hw clock set to utc no 
  57 # timezone configuration: europe/lisbon 
  58 # Choose default ex/vi: vim
  59 # set root password: vagrant 
  60 # exit setup, go to shell 
  61 
  62 vgscan --mknodes
  63 vgchange -ay
  64 mount /dev/sysvg/root /mnt
  65 mount /dev/sda1 /mnt/boot
  66 
  67 mount -o bind /dev /mnt/dev
  68 mount -o bind /proc /mnt/proc
  69 mount -o bind /sys /mnt/sys
  70 
  71 chroot /mnt /bin/bash
  72 # in chroot
  73 # make sure the Slack ISO is chosen in virtualbox
  74 mount /dev/sr0 /mnt
  75 upgradepkg --reinstall /mnt/slackware/a/kernel-modules-5.15.19*.txz
  76 ls -l /lib/modules/5.15.19/kernel/fs/ext4/
  77 
  78 KERNEL_VER=$(ls /lib/modules | head -n 1)
  79 echo $KERNEL_VER
  80 mkinitrd -c -k $KERNEL_VER -f ext4 -r /dev/sysvg/root -m dm-mod:ext4 -L
  81 
  82 #Several modules added after mkinitrd
  83 #jdb2 mbcache ext4 dm-bufio dm-snapshot
  84 
  85 vi /etc/lilo.conf
  86 append=" "
  87 boot = /dev/sda
  88 compact 
  89 
  90 prompt
  91 timeout = 50
  92 change-rules
  93   reset
  94 vga = normal
  95 image = /boot/vmlinuz-generic
  96   label = LinuxTest
  97   initrd = /boot/initrd.gz
  98   read-only
  99 
 100 exit 
 101 
 102 lilo -r /mnt
 103 exit
 104 # unomount DVD in virtualbox 
 105 reboot 

Test installation and install extra packages

   1 # login root:vagrant 
   2 df -h # used 1.5G
   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  # run command, it should get an ip
  38 ping -c 3 www.google.com # should get replies
  39 
  40 cd / 
  41 umount /mnt/dvd  
  42 # remove in virtualbox the ISO for slack
  43 reboot 
  44 
  45 # login root:vagrant 
  46 ping -c 3 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 df -h # 3.0 GB at /
   2 adduser vagrant # with pwd vagrant 
   3 groupadd sudo 
   4 
   5 usermod -aG sudo vagrant 
   6 visudo # insert after root user line
   7 
   8 vagrant ALL=(ALL) NOPASSWD: ALL
   9 
  10 exit 
  11 login vagrant:vagrant 
  12 
  13 sudo bash # should not ask for password 
  14 exit 

UseDNS in SSH

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

SSH insecure pair in vagrant

   1 # in /home/vagrant folder as vagrant user
   2 cd /home/vagrant
   3 mkdir ~/.ssh 
   4 cd ~/.ssh 
   5 wget -k https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub
   6 mv vagrant.pub authorized_keys
   7 chmod 0600 authorized_keys 
   8 chmod 0700 /home/vagrant/.ssh 
   9 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

   1 cd /tmp 
   2 vagrant package --base slackware32-15
   3 ls -lah *box
   4 # package.box
   5 vagrant box add --name slack32-15-box /tmp/package.box
   6 vagrant init slack32-15-box
   7 vagrant up
   8 vagrant ssh
   9 df -h
  10 # /dev/sysvg/root   61G  3.7G   54G   7% /
  11 md5sum /vagrant/package.box
  12 xxxxx  /vagrant/package.box

Update Slackware

   1 vagrant ssh 
   2 sudo bash 
   3 
   4 /sbin/removepkg zsh xorriso xfsdump xfsprogs  vorbis-tools usbutils unarj neofetch mariadb lxc mpg123  floppy gpm   floppy dvd+rw-tools  alsa-utils cdparanoia cdrdao cdrtools cups cups-filters  joe jove jed  amp dash dosfstools enscript flac genpower  ghostscript ghostscript-fonts gphoto2 gutenprint hplip isapnptools itstool jfsutils ksh93 lhasa madplay   mc minicom moc most mt-st mtx normalize ntfs-3g   opus-tools pamixer pciutils pcmciautils qpdf radeontool   reiserfsprogs rpm rpm2tgz sc sc-im seejpg soma sox squashfs terminus vbetool   kernel-generic-smp kernel-modules-smp   nvme-cli  efibootmgr efivar acct at bc bpe diffstat diffutils dmidecode groff htop libx86  linuxdoc-tools lm_sensors lsof man-db man-pages powertop rzip screen sqlite sysstat  texinfo tmux usbmuxd  ghostscript-fonts  ghostscript-fonts-std  btrfs-progs  elilo  terminus-font  squashfs-tools  a2ps  dc3dd ddrescue dmapi   f2fs-tools inxi ispell   exfatprogs   kernel-huge   kernel-huge-smp   sdparm seejpeg sdparm undervolt  lsscsi elvis vim  hdparm  kernel-source
   5 
   6 cd /var/log/packages
   7 grep -i -H "package location" *  | grep "\/ap\/"
   8 #nano-6.0-i586-1:PACKAGE LOCATION: /var/log/mount/slackware/ap/nano-6.0-i586-1.txz
   9 #vim-8.2.4256-i586-1:PACKAGE LOCATION: /var/log/mount/slackware/ap/vim-8.2.4256-i586-1.txz
  10 
  11 exit
  12 # check running VM name in virtualbox to use in --base
  13 vagrant package --base tmp_default_1792863453005_55244 
  14 # vagrant package # create package.box after /sbin/removepkg
  15 

   1 export SLACK_MIRROR="https://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/slackware-15.0"
   2 cd /tmp 
   3 wget -k $SLACK_MIRROR/slackware/n/openssl-1.1.1m-i586-1.txz
   4 wget -k $SLACK_MIRROR/slackware/n/ca-certificates-20211216-noarch-1.txz
   5 /sbin/installpkg ca-certificates-20211216-noarch-1.txz
   6 /sbin/installpkg openssl-1.1.1m-i586-1.txz
   7 /usr/sbin/update-ca-certificates --fresh
   8 
   9 echo "$SLACK_MIRROR/" >>  /etc/slackpkg/mirrors
  10 
  11 wget  $SLACK_MIRROR/slackware/n/gnupg-1.4.23-i586-4.txz
  12 /sbin/installpkg gnupg-1.4.23-i586-4.txz
  13 /usr/sbin/slackpkg update gpg 
  14 /usr/sbin/slackpkg update
  15 /usr/sbin/slackpkg upgrade-all
  16 exit
  17 exit 
  18 vagrant reload 
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01