-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVM-script.sh
More file actions
executable file
·58 lines (45 loc) · 2.92 KB
/
VM-script.sh
File metadata and controls
executable file
·58 lines (45 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#! /usr/bin/bash
#################################################################################################
# #
# Nombre: WM-script.sh #
# #
# Descripción: el script descarga una iso de Arch linux (64 bits) y la usa para crear #
# una máquina virtual. #
# #
# Fecha: 30/09/2021. #
# #
# Autor: @Axzel {alejo13580@gmail.com} #
# Estudiante: Alejandro Cardona Mosquera - 2022499 #
# Autor: @Akira {daniel.cuaical@correounivalle.edu.co} #
# Estudiante: Daniel Felipe Vélez C. - 1924306 #
# #
#################################################################################################
# Verificar si existe el .iso de ArchLinux.
if [ ! -f ./archlinux.iso ]; then
# Descarga de la ISO.
wget http://mirrors.udenar.edu.co/archlinux/iso/2021.09.01/archlinux-2021.09.01-x86_64.iso -O archlinux.iso
fi
# Definición e inicialización de la variable WM. Esta será usada para referenciar nuestra máquina.
VM='Arch-Linux-64bits'
# Creación de un disco dínamico de 20 GiB
VBoxManage createhd --filename $VM.vdi --size 20480
# Creación de la máquina virtual.
VBoxManage createvm --name $VM --ostype "ArchLinux_64" --register
# Se agrega un controlador SATA con el controlador del disco adjunto.
VBoxManage storagectl $VM --name "SATA Controller" --add sata --controller IntelAHCI
VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium $VM.vdi
# Adición de controlador de disco para instalar SO.
VBoxManage storagectl $VM --name "IDE Controller" --add ide
VBoxManage storageattach $VM --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium archlinux.iso
# Configuración general del sistema.
#
#
VBoxManage modifyvm $VM --ioapic on
# Configuración de booteo de la BIOS.
VBoxManage modifyvm $VM --boot1 dvd --boot2 disk --boot3 none --boot4 none
# Configuración de la tarjera y adaptadores de Red.
VBoxManage modifyvm $VM --nic1 bridged --bridgeadapter1 wlp1s0 # otros: eno1
# Memoria RAM y memoria de vídeo.
VBoxManage modifyvm $VM --memory 1024 --vram 64
# Comando de arranque.
# VBoxHeadless -s $VM