среда, 13 ноября 2019 г.

lxd debian 10

Installing GNOME Desktop Environment on Debian 10 Minimal Server
LXC

$ lxc launch images:debian/10 deb10
#$ lxc config set debian security.privileged true
#$ lxc restart deb10
$ lxc exec deb10 /bin/bash
## passwd
# adduser user
# usermod -aG sudo user
# apt update
## apt upgrade
# apt install qemu-user-static -y
# apt install mc samba sudo ssh wget -y
# dpkg-reconfigure locales
## Выбираем ru_RU.UTF-8
# locale -a  
## timedatectl set-timezone Europe/Moscow
# dpkg-reconfigure tzdata
# apt install keyboard-configuration
## dpkg-reconfigure keyboard-configuration
# apt install tasksel
# tasksel --list-tasks 
# tasksel install desktop gnome-desktop
# apt install xrdp
# systemctl enable xrdp
# reboot 

$ lxc list

Подключимся к контейнеру по ssh

Настроим в контейнере lxc

$ ip a
eth0@if19 192.168.0.207

$ sudo apt install nano
$ sudo apt-get install lxc libvirt0 libpam-cgfs bridge-utils
$ sudo nano /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback

##Bridge  Name ###
auto br0

# Bridge setup
iface br0 inet static
   bridge_ports eth0
       address 192.168.0.207
       broadcast 192.168.0.255
       netmask 255.255.255.0
       gateway 192.168.0.1
   bridge_stp off
   bridge_fd 9

Сохранить.

$ sudo reboot

Открыть файл
$ sudo nano /etc/default/lxc-net

USE_LXC_BRIDGE="false"

Сохранить.

$ sudo nano /etc/lxc/default.conf

Заменить:

lxc.net.0.type = empty

На:


lxc.net.type = veth
lxc.net.link = br0
lxc.net.flags = up
lxc.net.hwaddr = 00:16:3e:xx:xx:xx



lxc.network.type = veth
lxc.network.link = br0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx

Сохранить.
$ sudo nano /etc/dnsmasq.d/lxc

bind-interfaces
except-interface=br0

Сохранить.





Комментариев нет:

Отправить комментарий