Files
Ubuntu/🧩 Создание Golden-версии виртуальной машины (Ubuntu).md
T

112 lines
2.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 1. Обновление системы
```bash
sudo apt update
sudo apt upgrade -y
```
## 2. Настройка timezone
```bash
timedatectl
sudo timedatectl set-timezone Asia/Novosibirsk
timedatectl
```
## 3. Проверка сети
```bash
ip a
ip route
ping -c 3 8.8.8.8
ping -c 3 google.com
```
## 4. Установка SSH
```bash
systemctl status ssh
sudo apt install -y openssh-server
sudo systemctl enable --now ssh
systemctl status ssh
```
## 5. Установка QEMU Guest Agent
```bash
sudo apt install -y qemu-guest-agent
sudo systemctl enable --now qemu-guest-agent
systemctl status qemu-guest-agent
```
## 6. Установка базовых утилит
```bash
sudo apt install -y \
curl \
wget \
ca-certificates \
gnupg \
nfs-common \
btop \
ncdu \
tree \
mc \
tmux \
qrencode
```
## 7. Настройка tmux
```bash
printf "set-option -g prefix C-q\nset -g mouse on\n" >> ~/.tmux.conf
tmux source-file ~/.tmux.conf
```
## 8. Настройка swap
- Проверка наличия Swap файла
```bash
swapon --show
free -h
grep swap /etc/fstab
```
- Создание Swap файла, в случае его отсутствия
```bash
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
```
- Добавление в автозагрузку
```bash
sudo nano /etc/fstab
```
```append
/swap.img       none    swap    sw      0       0
```
## 9. Очистка системы
```bash
sudo apt autoremove -y
sudo apt clean
```
## 10. Создание группы apps
```bash
sudo groupadd apps
sudo usermod -aG apps $USER
```
## 11. Установка Docker
![[🚀 Установка Docker на Ubuntu]]
https://gitea.nasweb.ru/host/Ubuntu/src/branch/main/%F0%9F%9A%80%20%D0%A3%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0%20Docker%20%D0%BD%D0%B0%20Ubuntu.md
## 12. Добавление документации через SCP
```bash
scp -r docs/ username@server_ip:~
```
## 13. Перезагрузка
```bash
sudo reboot
```