You are on page 1of 6

SUBIDA DE NOTA SOR José Manuel Garrido Perejón 2º SMR

Creación de máquina virtual de


Ubuntu Server con Preseed

Para ello debemos tener instalado packer el cual hemos usado en la


actividad anterior.
El proceso es muy parecido, pero con varias diferencias.
Para empezar, debemos de crear en una carpeta. En mi caso la
carpeta se llama packer-1-2.
Dentro de esta misma carpeta creamos otra llamada http. Dentro de
esta, creamos el siguiente archivo con la extensión .cfg
### fuente: https://help.ubuntu.com/lts/installation-guide/example-preseed.txt

### Localization

d-i debian-installer/locale string es_ES

### Keyboard selection.

# Disable automatic (interactive) keymap detection.

d-i console-setup/ask_detect boolean false

d-i keyboard-configuration/modelcode string pc105

d-i keyboard-configuration/xkb-keymap select es

### Network configuration

d-i netcfg/choose_interface select auto

# To set a different link detection timeout (default is 3 seconds).

# Values are interpreted as seconds.

d-i netcfg/link_wait_timeout string 10

# If you have a slow dhcp server and the installer times out waiting for

# it, this might be useful.

d-i netcfg/dhcp_timeout string 60

d-i netcfg/dhcpv6_timeout string 60

# If you want to force a hostname, regardless of what either the DHCP

# server returns or what the reverse DNS entry for the IP is, uncomment

# and adjust the following line.

d-i netcfg/hostname string ubuntu

# Disable that annoying WEP key dialog.

d-i netcfg/wireless_wep string

1
SUBIDA DE NOTA SOR José Manuel Garrido Perejón 2º SMR

### Account setup

# To create a normal user account.

d-i passwd/user-fullname string mclibre.org

d-i passwd/username string mclibre

# Normal user's password, either in clear text

d-i passwd/user-password password mclibre

d-i passwd/user-password-again password mclibre

# The installer will warn about weak passwords. If you are sure you know

# what you're doing and want to override it, uncomment this.

d-i user-setup/allow-password-weak boolean true

### Clock and time zone setup

# Controls whether or not the hardware clock is set to UTC.

d-i clock-setup/utc boolean true

# You may set this to any valid setting for $TZ; see the contents of

# /usr/share/zoneinfo/ for valid values.

d-i time/zone string Europe/Madrid

# Controls whether to use NTP to set the clock during the install

d-i clock-setup/ntp boolean true

### Partitioning

d-i partman-auto/method string lvm

d-i partman-lvm/device_remove_lvm boolean true

d-i partman-md/device_remove_md boolean true

d-i partman-lvm/confirm boolean true

d-i partman-lvm/confirm_nooverwrite boolean true

# For LVM partitioning, you can select how much of the volume group to use

# for logical volumes.

d-i partman-auto-lvm/guided_size string max

# You can choose one of the three predefined partitioning recipes:

# - atomic: all files in one partition

# - home: separate /home partition

# - multi: separate /home, /var, and /tmp partitions

d-i partman-auto/choose_recipe select atomic

# This makes partman automatically partition without confirmation, provided

# that you told it what to do using one of the methods above.

d-i partman-partitioning/confirm_write_new_label boolean true

d-i partman/choose_partition select finish

2
SUBIDA DE NOTA SOR José Manuel Garrido Perejón 2º SMR

d-i partman/confirm boolean true

d-i partman/confirm_nooverwrite boolean true

### Base system installation

### Apt setup

# You can choose to install restricted and universe software, or to install

# software from the backports repository.

#d-i apt-setup/restricted boolean true

d-i apt-setup/universe boolean true

#d-i apt-setup/backports boolean true

# Uncomment this if you don't want to use a network mirror.

# d-i apt-setup/use_mirror boolean false

d-i mirror/http/proxy string

### Package selection

tasksel tasksel/first multiselect ubuntu-server

#tasksel tasksel/first multiselect ubuntu-desktop

#tasksel tasksel/first multiselect lamp-server, print-server

#tasksel tasksel/first multiselect kubuntu-desktop

# Individual additional packages to install

d-i pkgsel/include string openssh-server build-essential

# Whether to upgrade packages after debootstrap.

# Allowed values: none, safe-upgrade, full-upgrade

d-i pkgsel/upgrade select none

# Barto. para descargar el soporte completo del idioma

# https://askubuntu.com/questions/129651/how-do-i-configure-a-preseed-to-skip-the-language-support-question

d-i pkgsel/install-language-support boolean true

# Policy for applying updates. May be "none" (no automatic updates),

# "unattended-upgrades" (install security updates automatically), or

# "landscape" (manage system with Landscape).

d-i pkgsel/update-policy select none

### Boot loader installation

# This is fairly safe to set, it makes grub install automatically to the MBR

# if no other operating system is detected on the machine.

d-i grub-installer/only_debian boolean true

### Finishing up the installation

# Avoid that last message about the install being complete.

3
SUBIDA DE NOTA SOR José Manuel Garrido Perejón 2º SMR

d-i finish-install/reboot_in_progress note

Fuera de esta carpeta pero manteniéndonos dentro de la otra, creamos el


archivo packer-1-2.json

Y ejecutamos en nuestra consola situándonos dentro del directorio adecuado el


siguiente comando: packer build packer-1-2.json y se ejecutará exactamente el
mismo proceso que en la actividad anterior.
A continuación, muestro las imágenes:

4
SUBIDA DE NOTA SOR José Manuel Garrido Perejón 2º SMR

5
SUBIDA DE NOTA SOR José Manuel Garrido Perejón 2º SMR

Y al finalizar nos debería de poner el siguiente mensaje en la consola:

Debemos de comprobar que se ha creado la máquina virtual dentro de una


carpeta con el mismo nombre.

You might also like