TP sysres IMA2a5 2020/2021 G9 : Différence entre versions
De Wiki d'activités IMA
(→Modification du fichier de configuration) |
(→Modification du fichier de configuration) |
||
| Ligne 73 : | Ligne 73 : | ||
lvcreate -L10240M -n NightHawk_home virtual; mke2fs -t ext4 /dev/virtual/NightHawk_home | lvcreate -L10240M -n NightHawk_home virtual; mke2fs -t ext4 /dev/virtual/NightHawk_home | ||
lvcreate -L10240M -n NightHawk_var virtual; mke2fs -t ext4 /dev/virtual/NightHawk_var | lvcreate -L10240M -n NightHawk_var virtual; mke2fs -t ext4 /dev/virtual/NightHawk_var | ||
| + | |||
| + | |||
| + | |||
| + | '''Modification du fichier de configuration pour monter les deux partion home , var comme disque dans la machine virtuelle''' | ||
| + | # Disk device(s). | ||
| + | # | ||
| + | root = '/dev/xvda2 ro' | ||
| + | home = '/dev/xvda3 ro' | ||
| + | var = '/dev/xvda4 ro' | ||
| + | disk = [ | ||
| + | 'phy:/dev/virtual/NightHawk_var,xvda4,w', | ||
| + | 'phy:/dev/virtual/NightHawk_home,xvda3,w', | ||
| + | 'file:/usr/local/xen/domains/NightHawk/disk.img,xvda2,w', | ||
| + | 'file:/usr/local/xen/domains/NightHawk/swap.img,xvda1,w', | ||
| + | ] | ||
| + | # | ||
Version du 17 octobre 2020 à 18:40
By Crispin DJAMBA
Sommaire
Présentation du projet
Le projet de Systèmes et Réseaux a pour but de nous donner les rudiments nécessaires pour :
- Assurer la redondance matérielle au sein d'une infrastructure réseau
- Gérer des partitions virtuelles
- Créer une machine virtuelle
- Installer un serveur web sécurisé et y déployer un site
- Attaquer un réseau Wifi
Installation de la machine virtuelle avec xen sur Capbreton
Installation de la machine virtuelle
ssh root@capbreton.polytech-lille.info
Création et lancement de la machine virtuelle
xen-create-image --hostname=NightHawk --ip=193.48.57.170 --gateway=193.48.57.163 --netmask=255.255.255.240 --dir=/usr/local/xen --dist=beowulf --password=glopglop
Modification du fichier de configuration
Le fichier de configuration (vim /etc/xen/NightHawk.cfg) a été modifié pour utiliser une RAM 1024 et le bridge IMA2a5.
Si le bridge n'est pas renseignée la VM ne démarrera pas.
#
# Configuration file for the Xen instance NightHawk, created
# by xen-tools 4.8 on Fri Sep 25 10:36:53 2020.
#
#
# Kernel + memory size
#
kernel = '/boot/vmlinuz-4.19.0-9-amd64'
extra = 'elevator=noop'
ramdisk = '/boot/initrd.img-4.19.0-9-amd64'
vcpus = '1'
memory = '1024'
#
# Disk device(s).
#
root = '/dev/xvda2 ro'
disk = [
'file:/usr/local/xen/domains/NightHawk/disk.img,xvda2,w',
'file:/usr/local/xen/domains/NightHawk/swap.img,xvda1,w',
]
#
# Physical volumes
#
#
# Hostname
#
name = 'NightHawk'
#
# Networking
#
vif = [ 'mac=00:16:3E:CC:33:F4 ,bridge=IMA2a5' ]
#
# Behaviour
#
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
Lecture du fichier de config et Lancement de la machine virtuelle
xl create /etc/xen/NightHawk.cfg xl console NightHawk
Connexion à la VM
login: root mdp : glopglop
Création de deux partitions virtuelles sur le volume virtual
lvcreate -L10240M -n NightHawk_home virtual; mke2fs -t ext4 /dev/virtual/NightHawk_home lvcreate -L10240M -n NightHawk_var virtual; mke2fs -t ext4 /dev/virtual/NightHawk_var
Modification du fichier de configuration pour monter les deux partion home , var comme disque dans la machine virtuelle
# Disk device(s).
#
root = '/dev/xvda2 ro'
home = '/dev/xvda3 ro'
var = '/dev/xvda4 ro'
disk = [
'phy:/dev/virtual/NightHawk_var,xvda4,w',
'phy:/dev/virtual/NightHawk_home,xvda3,w',
'file:/usr/local/xen/domains/NightHawk/disk.img,xvda2,w',
'file:/usr/local/xen/domains/NightHawk/swap.img,xvda1,w',
]
#