|
Size: 6906
Comment:
|
Size: 6918
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 226: | Line 226: |
| #UseDNS no |
Contents
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 # 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 virtual the ISO for slack
43 reboot
44
45 # login root:vagrant
46 ping -c 3 www.sapo.pt
Install guest additions
vagrant sudoers
login with root:vagrant
UseDNS in SSH
SSH insecure pair in vagrant
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
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
