diff --git a/09-create-base-image/solutions/LiudmilaSafonova/README.md b/09-create-base-image/solutions/LiudmilaSafonova/README.md new file mode 100644 index 0000000..2350248 --- /dev/null +++ b/09-create-base-image/solutions/LiudmilaSafonova/README.md @@ -0,0 +1,65 @@ +# Case solution +For this case I made a new Ubuntu VM with access to the Internet. + +## Base +### **1. Set up infrastructure for creating and running virtual machines** +Firstly, I installed packages for working with VMs on linux (where Linux acts as a hypervisor): + +``` +sudo apt update +sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients virtinst bridge-utils +``` +I also ensured that the user could run commands without constant use of sudo command +image + +At first, unfortunately, my VM was not supporting nested virtualization, which is critical for KVM. I modified the VM configuration parameters to enable virtualization support. +image + +I added parameters to VMs config and ended up having VM suppurting virtualization +Снимок экрана 2026-03-24 225808 +Снимок экрана 2026-03-24 230025 +Снимок экрана 2026-03-24 231918 +image +module kvm was successfilly installed +image + +The kvm module was successfully installed and verified. I also downloaded the Astra Linux SE 1.7.6 ISO. +### **2. Create a virtual machine and install necessary packages** +Installing the VM using `virt-install` command: +``` +sudo virt-install \ + --name astra_vm \ + --ram 2048 \ + --vcpus 2 \ + --os-variant debian10 \ + --network network=default \ + --graphics vnc,listen=0.0.0.0 \ + --cdrom ~/Downloads/installation-1.7.6.11-26.08.24_17.26.iso \ + --disk path=/home/ludk/astra_disk.qcow2,size=12,format=qcow2,sparse=true \ + --check all=off \ + --filesystem /home/ludk/astra_share,astra_common,type=mount,accessmode=passthrough + +``` + +Then set OS and via ssh got into astra from Ubuntu VM +image +installed `docker.io` and `debootstrap` + +### **3. Create a Docker image in .tar format using debootstrap** +I configured an isolated `chroot` environment with basic packages (`ncurses-term`, `nano`, `locales`) +image + +made `.tar` with flag `-p` to preserve original permissions for all directories +``` +sudo tar -cpzf ~/astra-base.tar.gz . +``` +using `scp` copied `.tar` file to original Ubuntu VM +image +and than +image +`debootstrap` worked well +image + +### Conclusion +I was happy to know that this custom-made image weights significantly less, than the original OS. While working on this case, I had to rebuild several times my Ubuntu VM Hard Disk, reinstall Astra Linux from .iso, because 8 GB wasn't enough at first. And after all manipulations docker container is only 224 MB!! +image