|
Size: 56
Comment:
|
← Revision 12 as of 2026-10-10 01:20:33 ⇥
Size: 3488
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| << TableOfContents(2) >> | <<TableOfContents(2)>> |
| Line 3: | Line 3: |
Steps to create vagrant Debian trixie 64 box (Virtualbox) with LVM support. == Install in VM == {{{#!highlight sh cd ~ wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-13.7.0-amd64-netinst.iso # start Virtualbox # new # name: debian-trixie-64 # linux debian 64 bit, unchecked proceed with unattended installation, next # memory size 512 (to show text installer in debian) next # create virtual hard disk # create # vdi next # dynamic allocation next # 64 GB create # start # select startup disk # add # open choose debian-13.7.0-amd64-netinst.iso # start # graphical install # entering low memory mode , continue # region europe # country portugal # keymap portuguese # hostname debian # domain name: <continue> # root password: vagrant # full name new user: vagrant # user name for account: vagrant # password for account: vagrant # configure clock: Lisbon # partition disks, guided, use entire disk and setup lvm # select scsi3 sda 68.7 GB # partition scheme all files # write the changes and configure lvm? yes # amount of volume group 67.7 GB # write the changes to disk? yes # scan extra installation disk? no # debian archive mirror country: portugal # deb.debian.org # proxy continue # participate package usage survey? no # ssh server, standard sys utilities , continue # install GRUB loader in your primary drive ? yes # /dev/sda # installation complete, continue # login with root:vagrant }}} == Test network in VM and update VM == {{{#!highlight sh ping www.google.com -c 3 apt update -y apt upgrade -y }}} == Virtualbox guest additions == {{{#!highlight sh apt install dkms -y apt install build-essential -y apt install linux-headers-$(uname -r) # In VirtualBox Menu "Devices" followed by "Install Guest Additions". mount /dev/cdrom /media/cdrom cd /media/cdrom sh ./VBoxLinuxAdditions.run reboot }}} == vagrant sudoers == login with root:vagrant {{{#!highlight sh /sbin/usermod -aG sudo vagrant visudo # edit sudoers , put line in the end of the file vagrant ALL=(ALL) NOPASSWD: ALL # after saving in visudo exit login vagrant:vagrant sudo bash # should not ask for password sudo -l -U vagrant # check sudo permissions for vagrant user exit }}} == UseDNS in SSH == {{{#!highlight sh sudo bash cd /etc/ssh vi sshd_config # disable line with "UseDNS" no service ssh restart }}} == SSH insecure pair == {{{#!highlight sh # as user vagrant mkdir ~/.ssh cd ~/.ssh wget https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub cat vagrant.pub mv vagrant.pub authorized_keys chmod 0600 authorized_keys chmod 0700 /home/vagrant/.ssh sudo shutdown -h now }}} == Virtualbox disable audio == setting vm , audio, disable == Virtualbox first network adapter a NAT one == settings vm, network 1, NAT == Create vagrant box == {{{#!highlight sh cd /tmp vagrant package --base debian-trixie-64 #/tmp/package.box #package.box mv package.box debian-trixie-64.box mkdir /tmp/test cd /tmp/test vagrant box add --name debian-trixie-64-box /tmp/debian-trixie-64.box vagrant init debian-trixie-64-box # vagrant init my-company-box file:///tmp/debian-trixie-64.box vagrant up vagrant ssh # connect to the box df -h # /dev/mapper/debian--vg-root 62G 1.4G 58G 3% / cd /vagrant ls # Vagrantfile }}} |
Contents
VagrantDebianTrixie64Box
Steps to create vagrant Debian trixie 64 box (Virtualbox) with LVM support.
Install in VM
1 cd ~
2 wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-13.7.0-amd64-netinst.iso
3 # start Virtualbox
4 # new
5 # name: debian-trixie-64
6 # linux debian 64 bit, unchecked proceed with unattended installation, next
7 # memory size 512 (to show text installer in debian) next
8 # create virtual hard disk
9 # create
10 # vdi next
11 # dynamic allocation next
12 # 64 GB create
13 # start
14 # select startup disk
15 # add
16 # open choose debian-13.7.0-amd64-netinst.iso
17 # start
18 # graphical install
19 # entering low memory mode , continue
20 # region europe
21 # country portugal
22 # keymap portuguese
23 # hostname debian
24 # domain name: <continue>
25 # root password: vagrant
26 # full name new user: vagrant
27 # user name for account: vagrant
28 # password for account: vagrant
29 # configure clock: Lisbon
30 # partition disks, guided, use entire disk and setup lvm
31 # select scsi3 sda 68.7 GB
32 # partition scheme all files
33 # write the changes and configure lvm? yes
34 # amount of volume group 67.7 GB
35 # write the changes to disk? yes
36 # scan extra installation disk? no
37 # debian archive mirror country: portugal
38 # deb.debian.org
39 # proxy continue
40 # participate package usage survey? no
41 # ssh server, standard sys utilities , continue
42 # install GRUB loader in your primary drive ? yes
43 # /dev/sda
44 # installation complete, continue
45 # login with root:vagrant
46
Test network in VM and update VM
Virtualbox guest additions
vagrant sudoers
login with root:vagrant
1 /sbin/usermod -aG sudo vagrant
2 visudo # edit sudoers , put line in the end of the file
3
4 vagrant ALL=(ALL) NOPASSWD: ALL
5 # after saving in visudo
6 exit
7 login vagrant:vagrant
8
9 sudo bash # should not ask for password
10 sudo -l -U vagrant # check sudo permissions for vagrant user
11 exit
UseDNS in SSH
SSH insecure pair
Virtualbox disable audio
setting vm , audio, disable
Virtualbox first network adapter a NAT one
settings vm, network 1, NAT
Create vagrant box
1 cd /tmp
2 vagrant package --base debian-trixie-64
3 #/tmp/package.box
4 #package.box
5 mv package.box debian-trixie-64.box
6
7 mkdir /tmp/test
8 cd /tmp/test
9 vagrant box add --name debian-trixie-64-box /tmp/debian-trixie-64.box
10 vagrant init debian-trixie-64-box
11 # vagrant init my-company-box file:///tmp/debian-trixie-64.box
12 vagrant up
13 vagrant ssh # connect to the box
14 df -h
15 # /dev/mapper/debian--vg-root 62G 1.4G 58G 3% /
16 cd /vagrant
17 ls
18 # Vagrantfile
19
