|
Size: 56
Comment:
|
Size: 3060
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 bullseye64 box (Virtualbox) with LVM support. == Install in VM == {{{#!highlight sh wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.7.0-amd64-netinst.iso # start Virtualbox # new # name: debianbullseye64 # linux debian 64 bit next # memory size 512 next # create virtual hard disk # create # vdi next # dynamic allocation next # 64 GB create # start # select startup disk # add # open choose debian-11.7.0-amd64-netinst.iso # start # graphical install # low memory mode # region europe # country portugal # keymap portuguese # hostname debian # domain name: <continue> # root password: vagrant # full name new user: vagrant # user name for account: vagrant # configure clock: Lisbon # partition disks, guided, setup lvm # select scsi3 sda 68.7 GB # partition scheme all files # write the changes and configure lvm? yes # amount of volume group 68.2 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 apt update apt upgrade }}} == Virtualbox guest additions == {{{#!highlight sh apt install dkms apt install build-essential apt install linux-headers-$(uname -r) # 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 vagrant ALL=(ALL) NOPASSWD: ALL # after saving in visudo 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 service ssh restart }}} == SSH insecure pair == {{{#!highlight sh mkdir ~/.ssh cd ~/.ssh wget https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/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 debianbullseye64 /tmp/package.box package.box mkdir /tmp/test cd /tmp/test vagrant box add --name my-debbox C:\temp\package.box vagrant init my-debbox vagrant up vagrant ssh # connect to the box df -h # /dev/mapper/debian--vg-root 62G 1.4G 58G 3% / cd /vagrant ls md5sum package.box # xxx package.box }}} |
Contents
VagrantDebianTrixie64Box
Steps to create vagrant Debian bullseye64 box (Virtualbox) with LVM support.
Install in VM
1 wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.7.0-amd64-netinst.iso
2 # start Virtualbox
3 # new
4 # name: debianbullseye64
5 # linux debian 64 bit next
6 # memory size 512 next
7 # create virtual hard disk
8 # create
9 # vdi next
10 # dynamic allocation next
11 # 64 GB create
12 # start
13 # select startup disk
14 # add
15 # open choose debian-11.7.0-amd64-netinst.iso
16 # start
17 # graphical install
18 # low memory mode
19 # region europe
20 # country portugal
21 # keymap portuguese
22 # hostname debian
23 # domain name: <continue>
24 # root password: vagrant
25 # full name new user: vagrant
26 # user name for account: vagrant
27 # configure clock: Lisbon
28 # partition disks, guided, setup lvm
29 # select scsi3 sda 68.7 GB
30 # partition scheme all files
31 # write the changes and configure lvm? yes
32 # amount of volume group 68.2 GB
33 # write the changes to disk? yes
34 # scan extra installation disk? no
35 # debian archive mirror country: portugal
36 # deb.debian.org
37 # proxy continue
38 # participate package usage survey? no
39 # ssh server, standard sys utilities , continue
40 # install GRUB loader in your primary drive ? yes
41 # /dev/sda
42 # installation complete, continue
43 # login with root:vagrant
44
Test network in VM and update VM
Virtualbox guest additions
vagrant sudoers
login with root:vagrant
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 debianbullseye64
3 /tmp/package.box
4 package.box
5
6 mkdir /tmp/test
7 cd /tmp/test
8 vagrant box add --name my-debbox C:\temp\package.box
9 vagrant init my-debbox
10 vagrant up
11 vagrant ssh # connect to the box
12 df -h
13 # /dev/mapper/debian--vg-root 62G 1.4G 58G 3% /
14 cd /vagrant
15 ls
16 md5sum package.box
17 # xxx package.box
18
