Add debian-8
diff --git a/README.md b/README.md
index 8ba9777..acd41aa 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,8 @@
### Operating Systems
- - Ubuntu 14.04
+ - Ubuntu 14.04 (trusty)
+ - Debian 8 (jessie)
### Providers
diff --git a/debian-8/.gitignore b/debian-8/.gitignore
new file mode 100644
index 0000000..336d238
--- /dev/null
+++ b/debian-8/.gitignore
@@ -0,0 +1,3 @@
+images/
+packer_cache/
+
diff --git a/debian-8/configs/cloud/cloud.cfg b/debian-8/configs/cloud/cloud.cfg
new file mode 100644
index 0000000..93f6357
--- /dev/null
+++ b/debian-8/configs/cloud/cloud.cfg
@@ -0,0 +1,72 @@
+# If this is set, 'root' will not be able to ssh in and they
+# will get a message to login instead as the above $user (ubuntu)
+disable_root: false
+
+# This will cause the set+update hostname module to not operate (if true)
+preserve_hostname: false
+
+# Better let managing of /etc/hosts on salt and others
+# manage_etc_hosts: localhost
+
+# The modules that run in the 'init' stage
+cloud_init_modules:
+ - migrator
+ - seed_random
+ - bootcmd
+ - write-files
+ - growpart
+ - resizefs
+ - set_hostname
+ - update_hostname
+ - update_etc_hosts
+ - ca-certs
+ - rsyslog
+ - users-groups
+ - ssh
+
+# The modules that run in the 'config' stage
+cloud_config_modules:
+# Emit the cloud config ready event
+# this can be used by upstart jobs for 'start on cloud-config'.
+ - emit_upstart
+ - disk_setup
+ - mounts
+ - ssh-import-id
+ - locale
+ - set-passwords
+ - grub-dpkg
+ - apt-pipelining
+ - apt-configure
+ - package-update-upgrade-install
+ - landscape
+ - timezone
+ - puppet
+ - chef
+ - salt-minion
+ - mcollective
+ - disable-ec2-metadata
+ - runcmd
+ - byobu
+
+# The modules that run in the 'final' stage
+cloud_final_modules:
+ - rightscale_userdata
+ - scripts-vendor
+ - scripts-per-once
+ - scripts-per-boot
+ - scripts-per-instance
+ - scripts-user
+ - ssh-authkey-fingerprints
+ - keys-to-console
+ - phone-home
+ - final-message
+ - power-state-change
+
+datasource:
+ Ec2:
+ timeout: 5 # (defaults to 50 seconds)
+ max_wait: 10 # (defaults to 120 seconds)
+ OpenStack:
+ timeout: 5 # (defaults to 50 seconds)
+ max_wait: 10 # (defaults to 120 seconds)
+
diff --git a/debian-8/configs/cloud/cloud.cfg.d/99_tcp.cfg b/debian-8/configs/cloud/cloud.cfg.d/99_tcp.cfg
new file mode 100644
index 0000000..dd58838
--- /dev/null
+++ b/debian-8/configs/cloud/cloud.cfg.d/99_tcp.cfg
@@ -0,0 +1,16 @@
+datasource:
+ Ec2:
+ timeout: 5 # (defaults to 50 seconds)
+ max_wait: 10 # (defaults to 120 seconds)
+ OpenStack:
+ timeout: 5 # (defaults to 50 seconds)
+ max_wait: 10 # (defaults to 120 seconds)
+
+growpart:
+ mode: auto
+ devices: ['/']
+
+#swap:
+# filename: /swap.img
+# size: auto
+# maxsize: 1000000000
diff --git a/debian-8/http/preseed.cfg b/debian-8/http/preseed.cfg
new file mode 100644
index 0000000..5348e8c
--- /dev/null
+++ b/debian-8/http/preseed.cfg
@@ -0,0 +1,52 @@
+d-i mirror/country string manual
+d-i mirror/http/hostname string ftp.cz.debian.org
+d-i mirror/http/directory string /debian
+d-i mirror/http/proxy string
+
+d-i debian-installer/framebuffer boolean false
+d-i debconf/frontend select noninteractive
+d-i base-installer/kernel/override-image string linux-server
+d-i clock-setup/utc boolean true
+d-i clock-setup/utc-auto boolean true
+d-i finish-install/reboot_in_progress note
+d-i grub-installer/only_debian boolean true
+d-i grub-installer/with_other_os boolean true
+d-i netcfg/get_domain string unassigned-domain
+d-i netcfg/get_hostname string unassigned-hostname
+
+d-i partman-auto/disk string /dev/sda /dev/vda
+d-i partman-auto/method string regular
+d-i partman/choose_partition select finish
+d-i partman/confirm boolean true
+d-i partman/confirm_nooverwrite boolean true
+d-i partman/confirm_write_new_label boolean true
+d-i partman-basicfilesystems/no_swap boolean false
+d-i partman-auto/choose_recipe select boot-root
+
+d-i partman-auto/expert_recipe string \
+ boot-root :: \
+ 512 512 -1 ext4 \
+ $primary{ } $bootable{ } \
+ method{ format } format{ } \
+ use_filesystem{ } filesystem{ ext4 } \
+ mountpoint{ / } \
+ options/noatime{ noatime } \
+ . \
+
+d-i pkgsel/include string openssh-server
+d-i pkgsel/install-language-support boolean false
+d-i pkgsel/update-policy select unattended-upgrades
+popularity-contest popularity-contest/participate boolean false
+
+d-i pkgsel/upgrade select none
+
+d-i time/zone string UTC
+d-i passwd/root-login boolean true
+d-i passwd/make-user boolean false
+d-i openssh-server/permit-root-login boolean true
+d-i user-setup/allow-password-weak boolean true
+d-i user-setup/encrypt-home boolean false
+tasksel tasksel/first multiselect minimal, ssh-server, openssh-server
+
+d-i preseed/late_command string \
+ in-target sed -i 's/PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
diff --git a/debian-8/scripts/base.sh b/debian-8/scripts/base.sh
new file mode 100644
index 0000000..f9370f7
--- /dev/null
+++ b/debian-8/scripts/base.sh
@@ -0,0 +1,28 @@
+## Base packages and setup
+apt-get update
+
+# Cleanup old kernels, ensure latest is installed via virtual package
+if [ ! -f /tmp/no_install_kernel ]; then
+ # Update grub cmdline
+ sed -i 's|GRUB_CMDLINE_LINUX_DEFAULT=.*|GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
+ sed -i 's|GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
+ update-grub
+fi
+
+apt-get -y upgrade
+apt-get -y dist-upgrade
+
+apt-get autoremove --purge
+
+# Useful tools
+apt-get -y install curl wget tmux vim-nox byobu iputils-ping traceroute htop
+
+# Tmux fixes
+cat << 'EOF' >> /etc/tmux.conf
+set -g default-terminal "screen-256color"
+set -g set-titles on
+set -g xterm-keys on
+EOF
+
+# Setup cloud-init
+apt-get -y install cloud-init
diff --git a/debian-8/scripts/cleanup.sh b/debian-8/scripts/cleanup.sh
new file mode 100644
index 0000000..5a7d528
--- /dev/null
+++ b/debian-8/scripts/cleanup.sh
@@ -0,0 +1,17 @@
+apt-get -y autoremove --purge
+apt-get -y clean
+
+echo "cleaning up guest additions"
+rm -rf VBoxGuestAdditions_*.iso VBoxGuestAdditions_*.iso.? || true
+
+echo "cleaning up dhcp leases"
+rm /var/lib/dhcp/* || true
+
+echo "cleaning up udev rules"
+rm -f /etc/udev/rules.d/70-persistent-net.rules || true
+rm -rf /dev/.udev/ || true
+rm -f /lib/udev/rules.d/75-persistent-net-generator.rules || true
+
+echo "cleaning up minion_id for salt"
+rm -f /etc/salt/minion_id || true
+
diff --git a/debian-8/scripts/docker.sh b/debian-8/scripts/docker.sh
new file mode 100644
index 0000000..9e06fb9
--- /dev/null
+++ b/debian-8/scripts/docker.sh
@@ -0,0 +1,6 @@
+# This should simulate preseed behavior
+
+apt-get -y install curl
+
+# Kernel makes no sense in docker, let base.sh know
+touch /tmp/no_install_kernel
diff --git a/debian-8/scripts/foreman.sh b/debian-8/scripts/foreman.sh
new file mode 100644
index 0000000..648edd4
--- /dev/null
+++ b/debian-8/scripts/foreman.sh
@@ -0,0 +1,6 @@
+# One-time key for Foreman provisioning
+
+[ ! -d ~/.ssh ] && mkdir -m 700 ~/.ssh
+cat << EOF >> ~/.ssh/authorized_keys
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDWc8adBL8rzHwG3k+OMxSa/7aQzKY2Mw1JtYfK3xgj7yigSw8kfPg1UV8ZOe2HPTArQnaqkinKO7c7Uq3OH6lsygousjTDkHWpsB607P0AQYcB9m+oo7UwJYEDRfrwyGLgR0yMy9aC2sUAgOsiylZLfCy7jF6lXChNkv6td6Co+EzVN5RyVc8tgB25wXPn1DSp33stzy/hBWgMuWRDObpzQvZlr2i0Ed87CdBLCCP3DGDGHv9jYCxPpT0Sobr/FZApbeDWwsxVJC3GTkgFTcfrPO1LXI72NlhRlCvaoehrjilePHk6+5Ap1/hXg0Vmqq0KsCQ3MlaLO4XOjJ7F/UGYJKczztdqvqPXwQ1+q7ZqDW/uCKXrI9H0XmuaI61xiTbC1Tvjws4HZrq5mp23RPfT29ETcHm3cxFNchzkGlvod3rH1hUWqufuEGnBIhQTfcZbDS34cxACKYfiP61rqVdoHu27d81gwyN7RcjoNuOm2qo3JwW8FyQEBVw0H5HjQxtRk042ghME11CLTA4G8OTQ1BMbrxfz9QPXEc8y71ZT9YyZ9AjgUY487+Rw6KBgEvK4xrdDCt7HhxwGeU3s8+4eETcCicBr+58ykhcyjm3EuH/t/lMggCnuPWejfYbJae4Gh3lLZW1ZHLR7adsAw89Ju1OF5XTcS+O69p5vi8X6yw== foreman@provisioner
+EOF
diff --git a/debian-8/scripts/salt.sh b/debian-8/scripts/salt.sh
new file mode 100644
index 0000000..ceec857
--- /dev/null
+++ b/debian-8/scripts/salt.sh
@@ -0,0 +1 @@
+apt-get -y install salt-minion reclass
diff --git a/debian-8/scripts/security.sh b/debian-8/scripts/security.sh
new file mode 100644
index 0000000..0a83f9f
--- /dev/null
+++ b/debian-8/scripts/security.sh
@@ -0,0 +1,50 @@
+# Auto login root on tty1
+sed 's|/sbin/agetty|/sbin/agetty --autologin root|g' /etc/systemd/system/getty.target.wants/getty@tty1.service > /etc/systemd/system/getty-autologin@.service
+systemctl daemon-reload
+systemctl disable getty@tty1.service
+systemctl enable getty-autologin@tty1.service
+
+# Libvirt serial console support
+cat << 'EOF' >> /etc/systemd/system/getty-serial@.service
+[Unit]
+Description=Getty on %I
+Documentation=man:agetty(8) man:systemd-getty-generator(8)
+Documentation=http://0pointer.de/blog/projects/serial-console.html
+After=systemd-user-sessions.service plymouth-quit-wait.service
+After=rc-local.service
+
+Before=getty.target
+IgnoreOnIsolate=yes
+
+ConditionPathExists=/dev/ttyS0
+
+[Service]
+ExecStart=-/sbin/agetty --autologin root -8 --noclear %I 115200 $TERM
+Type=idle
+Restart=always
+RestartSec=0
+UtmpIdentifier=%I
+TTYPath=/dev/%I
+TTYReset=yes
+TTYVHangup=yes
+TTYVTDisallocate=yes
+KillMode=process
+IgnoreSIGPIPE=no
+SendSIGHUP=yes
+
+Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
+
+[Install]
+WantedBy=getty.target
+DefaultInstance=ttyS0
+EOF
+
+systemctl daemon-reload
+systemctl enable getty-autologin@ttyS0.service
+
+# Disable password root login
+usermod -p '!' root
+
+# Disable SSH password authentication and permit root login
+sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config
+sed -i 's|[#]*PermitRootLogin no|PermitRootLogin yes|g' /etc/ssh/sshd_config
diff --git a/debian-8/scripts/vagrant.sh b/debian-8/scripts/vagrant.sh
new file mode 100644
index 0000000..06b02cf
--- /dev/null
+++ b/debian-8/scripts/vagrant.sh
@@ -0,0 +1,7 @@
+
+mkdir /home/vagrant/.ssh
+wget --no-check-certificate \
+ 'https://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' \
+ -O /home/vagrant/.ssh/authorized_keys
+chown -R vagrant /home/vagrant/.ssh
+chmod -R go-rwsx /home/vagrant/.ssh
diff --git a/debian-8/scripts/virtualbox.sh b/debian-8/scripts/virtualbox.sh
new file mode 100644
index 0000000..f42d6d6
--- /dev/null
+++ b/debian-8/scripts/virtualbox.sh
@@ -0,0 +1 @@
+apt-get -y install virtualbox-guest-utils
diff --git a/debian-8/scripts/vmware.sh b/debian-8/scripts/vmware.sh
new file mode 100644
index 0000000..bd193ee
--- /dev/null
+++ b/debian-8/scripts/vmware.sh
@@ -0,0 +1,2 @@
+apt-get -y install open-vm-tools
+#echo -n ".host:/ /mnt/hgfs vmhgfs rw,ttl=1,uid=my_uid,gid=my_gid,nobootwait 0 0" >> /etc/fstab
diff --git a/debian-8/scripts/zerodisk.sh b/debian-8/scripts/zerodisk.sh
new file mode 100644
index 0000000..6a658ed
--- /dev/null
+++ b/debian-8/scripts/zerodisk.sh
@@ -0,0 +1,2 @@
+dd if=/dev/zero of=/EMPTY bs=1M || true
+rm -f /EMPTY
diff --git a/debian-8/template.json b/debian-8/template.json
new file mode 100644
index 0000000..71d9ee6
--- /dev/null
+++ b/debian-8/template.json
@@ -0,0 +1,240 @@
+{
+ "variables": {
+ "user": "root",
+ "password": "ho5uo7Uome5d",
+ "do_api_token": "{{ env `DO_API_TOKEN` }}",
+ "distro": "debian-8-x64",
+ "disk_size": "8000"
+ },
+
+ "provisioners": [
+ {
+ "type": "shell",
+ "execute_command": "echo '{{user `user`}}' |sudo -S sh '{{.Path}}'",
+ "override": {
+ "virtualbox-iso": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/salt.sh",
+ "scripts/vagrant.sh",
+ "scripts/virtualbox.sh",
+ "scripts/security.sh",
+ "scripts/cleanup.sh",
+ "scripts/zerodisk.sh"
+ ]
+ },
+ "vmware-iso": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/salt.sh",
+ "scripts/vmware.sh",
+ "scripts/security.sh",
+ "scripts/cleanup.sh",
+ "scripts/zerodisk.sh"
+ ]
+ },
+ "qemu": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/salt.sh",
+ "scripts/foreman.sh",
+ "scripts/security.sh",
+ "scripts/cleanup.sh",
+ "scripts/zerodisk.sh"
+ ]
+ },
+ "docker": {
+ "scripts": [
+ "scripts/docker.sh",
+ "scripts/base.sh",
+ "scripts/salt.sh",
+ "scripts/cleanup.sh"
+ ]
+ },
+ "digitalocean": {
+ "scripts": [
+ "scripts/base.sh",
+ "scripts/salt.sh",
+ "scripts/security.sh",
+ "scripts/cleanup.sh"
+ ]
+ }
+ }
+ },
+ {
+ "type": "file",
+ "source": "configs/cloud/cloud.cfg.d/99_tcp.cfg",
+ "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
+ },
+ {
+ "type": "file",
+ "source": "configs/cloud/cloud.cfg",
+ "destination": "/etc/cloud/cloud.cfg"
+ }
+ ],
+ "post-processors": [
+ {
+ "type": "vagrant",
+ "keep_input_artifact": true,
+ "output": "images/{{ user `distro` }}-{{.Provider}}-{{ timestamp }}.box",
+ "except": [ "digitalocean", "docker" ]
+ },
+ {
+ "type": "docker-tag",
+ "repository": "cloudlab/debian",
+ "tag": "8",
+ "only": ["docker"]
+ },
+ {
+ "type": "docker-save",
+ "path": "images/{{ user `distro` }}-docker-{{ timestamp }}.tar",
+ "only": ["docker"]
+ }
+ ],
+ "builders": [
+ {
+ "type": "virtualbox-iso",
+ "boot_command": [
+ "<esc><wait>",
+ "install<wait>",
+ " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
+ " debian-installer=en_US<wait>",
+ " auto<wait>",
+ " locale=en_US<wait>",
+ " console-setup/ask_detect=false<wait>",
+ " console-setup/layoutcode=us<wait>",
+ " console-setup/modelcode=pc105<wait>",
+ " debconf/frontend=noninteractive<wait>",
+ " fb=false<wait>",
+ " initrd=/install/initrd.gz<wait>",
+ " kbd-chooser/method=us<wait>",
+ " keyboard-configuration/xkb-keymap=us <wait>",
+ " passwd/root-password={{user `password`}} ",
+ " passwd/root-password-again={{user `password`}} ",
+ " netcfg/get_hostname=debian-8<wait>",
+ " netcfg/get_domain=cloudlab.cz<wait>",
+ " noapic<wait>",
+ "<enter><wait>"
+ ],
+ "boot_wait": "5s",
+ "disk_size": "{{ user `disk_size`}}",
+ "output_directory": "images/{{ user `distro` }}-vbox-{{ timestamp }}",
+ "guest_os_type": "Debian_64",
+ "http_directory": "http",
+ "iso_checksum": "762eb3dfc22f85faf659001ebf270b4f",
+ "iso_checksum_type": "md5",
+ "iso_url": "http://cdimage.debian.org/debian-cd/8.2.0/amd64/iso-cd/debian-8.2.0-amd64-netinst.iso",
+ "ssh_username": "{{user `user`}}",
+ "ssh_password": "{{user `password`}}",
+ "ssh_port": 22,
+ "ssh_wait_timeout": "10000s",
+ "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
+ "headless": true,
+ "vboxmanage": [
+ [ "modifyvm", "{{.Name}}", "--memory", "1024" ],
+ [ "modifyvm", "{{.Name}}", "--cpus", "2" ],
+ [ "modifyvm", "{{.Name}}", "--vrde", "on" ],
+ [ "modifyvm", "{{.Name}}", "--vrdeport", "5000-5050" ],
+ [ "modifyvm", "{{.Name}}", "--vrdeaddress", "127.0.0.1" ]
+ ]
+ },
+ {
+ "type": "vmware-iso",
+ "boot_command": [
+ "<esc><wait>",
+ "install<wait>",
+ " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
+ " debian-installer=en_US<wait>",
+ " auto<wait>",
+ " locale=en_US<wait>",
+ " console-setup/ask_detect=false<wait>",
+ " console-setup/layoutcode=us<wait>",
+ " console-setup/modelcode=pc105<wait>",
+ " debconf/frontend=noninteractive<wait>",
+ " fb=false<wait>",
+ " initrd=/install/initrd.gz<wait>",
+ " kbd-chooser/method=us<wait>",
+ " keyboard-configuration/xkb-keymap=us <wait>",
+ " passwd/root-password={{user `password`}} ",
+ " passwd/root-password-again={{user `password`}} ",
+ " netcfg/get_hostname=debian-8<wait>",
+ " netcfg/get_domain=cloudlab.cz<wait>",
+ " noapic<wait>",
+ "<enter><wait>"
+ ],
+ "boot_wait": "5s",
+ "disk_size": "{{ user `disk_size`}}",
+ "disk_type_id": 4,
+ "vmdk_name": "{{ user `distro`}}",
+ "output_directory": "images/{{ user `distro` }}-vmware-{{ timestamp }}",
+ "guest_os_type": "linux",
+ "http_directory": "http",
+ "iso_checksum": "762eb3dfc22f85faf659001ebf270b4f",
+ "iso_checksum_type": "md5",
+ "iso_url": "http://cdimage.debian.org/debian-cd/8.2.0/amd64/iso-cd/debian-8.2.0-amd64-netinst.iso",
+ "ssh_username": "{{user `user`}}",
+ "ssh_password": "{{user `password`}}",
+ "ssh_port": 22,
+ "ssh_wait_timeout": "10000s",
+ "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
+ "vmx_data": {
+ "memsize": "1024",
+ "numvcpus": "1",
+ "cpuid.coresPerSocket": "1"
+ }
+ },
+ {
+ "type": "qemu",
+ "vm_name": "{{ user `distro` }}-{{ timestamp }}",
+ "output_directory": "images/{{ user `distro` }}-qemu-{{ timestamp }}",
+ "format": "qcow2",
+ "accelerator": "kvm",
+ "disk_size": "{{ user `disk_size`}}",
+ "iso_url": "http://cdimage.debian.org/debian-cd/8.2.0/amd64/iso-cd/debian-8.2.0-amd64-netinst.iso",
+ "iso_checksum_type": "md5",
+ "iso_checksum": "762eb3dfc22f85faf659001ebf270b4f",
+ "http_directory": "http",
+ "headless": true,
+ "ssh_username": "{{user `user`}}",
+ "ssh_password": "{{user `password`}}",
+ "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",
+ "boot_wait": "2s",
+ "ssh_wait_timeout": "10000s",
+ "boot_command": [
+ "<esc><wait>",
+ "install<wait>",
+ " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
+ " debian-installer=en_US<wait>",
+ " auto<wait>",
+ " locale=en_US<wait>",
+ " console-setup/ask_detect=false<wait>",
+ " console-setup/layoutcode=us<wait>",
+ " console-setup/modelcode=pc105<wait>",
+ " debconf/frontend=noninteractive<wait>",
+ " fb=false<wait>",
+ " initrd=/install/initrd.gz<wait>",
+ " kbd-chooser/method=us<wait>",
+ " keyboard-configuration/xkb-keymap=us <wait>",
+ " passwd/root-password={{user `password`}} ",
+ " passwd/root-password-again={{user `password`}} ",
+ " netcfg/get_hostname=debian-8<wait>",
+ " netcfg/get_domain=cloudlab.cz<wait>",
+ " noapic<wait>",
+ "<enter><wait>"
+ ]
+ },
+ {
+ "type": "docker",
+ "image": "debian:8",
+ "commit": true
+ },
+ {
+ "type": "digitalocean",
+ "api_token": "{{user `do_api_token`}}",
+ "image": "{{user `distro`}}",
+ "snapshot_name": "{{ user `distro` }}-{{ timestamp }}",
+ "region" : "ams2",
+ "size" : "1gb"
+ }
+ ]
+}
diff --git a/ubuntu-14.04/scripts/base.sh b/ubuntu-14.04/scripts/base.sh
index bf48d89..babf3a8 100644
--- a/ubuntu-14.04/scripts/base.sh
+++ b/ubuntu-14.04/scripts/base.sh
@@ -30,23 +30,5 @@
set -g xterm-keys on
EOF
-# Libvirt serial console support
-cat << 'EOF' >> /etc/init/ttyS0.conf
-# ttyS0 - getty
-#
-# This service maintains a getty on tty1 from the point the system is
-# started until it is shut down again.
-
-start on stopped rc RUNLEVEL=[2345] and (
- not-container or
- container CONTAINER=lxc or
- container CONTAINER=lxc-libvirt)
-
-stop on runlevel [!2345]
-
-respawn
-exec /sbin/getty --autologin root -8 115200 ttyS0 xterm
-EOF
-
# Setup cloud-init
apt-get -y install cloud-init
diff --git a/ubuntu-14.04/scripts/security.sh b/ubuntu-14.04/scripts/security.sh
index 7dd89b6..3026626 100644
--- a/ubuntu-14.04/scripts/security.sh
+++ b/ubuntu-14.04/scripts/security.sh
@@ -1,6 +1,24 @@
# Auto login root on tty1
sed -i 's|/sbin/getty|/sbin/getty --autologin root|g' /etc/init/tty1.conf
+# Libvirt serial console support
+cat << 'EOF' >> /etc/init/ttyS0.conf
+# ttyS0 - getty
+#
+# This service maintains a getty on tty1 from the point the system is
+# started until it is shut down again.
+
+start on stopped rc RUNLEVEL=[2345] and (
+ not-container or
+ container CONTAINER=lxc or
+ container CONTAINER=lxc-libvirt)
+
+stop on runlevel [!2345]
+
+respawn
+exec /sbin/getty --autologin root -8 115200 ttyS0 xterm
+EOF
+
# Disable password root login
usermod -p '!' root