= VagrantSlack6415Box = <> Steps to create a Slackware64 15 vagrant box with LVM support. == Get ISO and install == {{{#!highlight sh cd ~ wget https://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/slackware-iso/slackware64-15.0-iso/slackware64-15.0-install-dvd.iso # start virtualbox # new, name: slackware64-15 # linux other linux 64-bit , next # 512 RAM, next # Create a virtual hard disk now, create, VDI, next, dynamically allocated, next, 64GB, create # start VM # choose slackware64-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 # t 2 L 8e # p # w # LVM stuff pvcreate /dev/sda2 vgcreate sysvg /dev/sda2 lvcreate -L 62G -n root sysvg pvscan setup # target # /dev/sysvg/root select # quick format, ok ext 4 # select other linux partition /dev/sda1 # quick format, ext4 # mount point /boot # fstab # /dev/sysvg/root for the root directory (/) # /dev/sda1 for /boot # mount point /boot # install from slackware cd or dvd # auto # package A # full # configure the system, yes # make usb flash boot: skip ok # install lilo, simple # lilo standard # optional # select lilo dstination MBR # gpm configuration: no # services crond messagebus syslog # custom screen fonts no # hw clock set to utc no # europe/lisbon # nvi classic BSD utf8 # set root passw vagrant # exit shell chroot /mnt $( /usr/share/mkinitrd/mkinitrd_command_generator.sh -r ) # /boot/initrd.gz cat /etc/lilo.conf | grep -v "#" vi /etc/lilo.conf # comment root # root= image = /boot/vmlinuz-generic timeout=50 initrd=/boot/initrd.gz label=Linuxtest lilo exit reboot }}} == Test installation and install extra packages == {{{#!highlight sh # login root:vagrant df -h # used 1.4G # error while loading libunistring.so.2 mount DVD slack iso virtualbox mount /dev/sr0 /mnt/dvd cd /mnt/dvd/slackware64/ installpkg l/libunis*txz installpkg k/kernel-source*txz installpkg d/make-4.3*txz installpkg d/gcc-11.2*txz installpkg d/perl-5*txz installpkg d/guile-3*txz installpkg l/gc-8*txz installpkg d/binutils*txz installpkg ap/slackpkg-15*.txz installpkg l/ncurses-6*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 ap/sudo-*.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 cd / umount /mnt/dvd reboot # login root:vagrant ping -c3 www.sapo.pt ping 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 adduser vagrant # com pwd vagrant groupadd sudo usermod -aG sudo vagrant visudo vagrant ALL=(ALL) NOPASSWD: ALL exit login vagrant:vagrant sudo bash # should not ask for password exit }}} == UseDNS in SSH == {{{#!highlight sh sudo bash cd /etc/ssh vi sshd_config # disable line with "UseDNS" no /etc/rc.d/rc.sshd restart }}} == SSH insecure pair in vagrant == {{{#!highlight sh mkdir ~/.ssh cd ~/.ssh wget --no-check-certificate https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub mv vagrant.pub authorized_keys chmod 0600 authorized_keys chmod 0700 /home/vagrant/.ssh 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 slackware64-15 ls # package.box vagrant box add --name slack64-15-box /tmp\package.box vagrant init slack64-15-box vagrant up vagrant ssh df -h # /dev/mapper/sysvg-root 61G 3.0G 55G 6% / md5sum /vagrant/package.box xxxxx /vagrant/package.box }}} == Update Slackware 64 == {{{#!highlight sh vagrant ssh sudo bash cd /tmp 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 wget --no-check-certificate https://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/slackware64-15.0/slackware64/n/ca-certificates-20211216-noarch-1.txz /sbin/installpkg ca-certificates-20211216-noarch-1.txz /sbin/installpkg openssl-1.1.1m-x86_64-1.txz /usr/sbin/update-ca-certificates --fresh echo "https://mirror.slackbuilds.org/slackware/slackware64-15.0/" >> /etc/slackpkg/mirrors wget https://ftp.rnl.tecnico.ulisboa.pt/pub/slackware/slackware64-15.0/slackware64/n/gnupg-1.4.23-x86_64-4.txz /sbin/installpkg gnupg-1.4.23-x86_64-4.txz /usr/sbin/slackpkg update gpg /usr/sbin/slackpkg update /usr/sbin/slackpkg upgrade-all }}}