diff --git a/kiwi-templates-Minimal/Minimal.kiwi b/kiwi-templates-Minimal/Minimal.kiwi
index fae6642..d7db39e 100644
--- a/kiwi-templates-Minimal/Minimal.kiwi
+++ b/kiwi-templates-Minimal/Minimal.kiwi
@@ -13,6 +13,7 @@
+
@@ -133,6 +134,32 @@
+
+ 16.0.0
+ zypper
+ openSUSE
+ openSUSE
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 24
+
+
+
+
+
+
16.0.0
zypper
@@ -443,7 +470,7 @@
-
+
@@ -453,11 +480,11 @@
-
+
-
+
@@ -467,7 +494,7 @@
-
+
@@ -498,6 +525,11 @@
+
+
+
+
+
@@ -527,7 +559,7 @@
-
+
diff --git a/kiwi-templates-Minimal/_multibuild b/kiwi-templates-Minimal/_multibuild
index 18d0b3f..37cc4d0 100644
--- a/kiwi-templates-Minimal/_multibuild
+++ b/kiwi-templates-Minimal/_multibuild
@@ -4,6 +4,7 @@
kvm
kvm-encrypt
VMware
+ Vagrant
MS-HyperV
Cloud
RaspberryPi
diff --git a/kiwi-templates-Minimal/config.sh b/kiwi-templates-Minimal/config.sh
index eb496bb..8114dae 100644
--- a/kiwi-templates-Minimal/config.sh
+++ b/kiwi-templates-Minimal/config.sh
@@ -64,6 +64,81 @@ baseSetRunlevel 3
#--------------------------------------
suseImportBuildKey
+#======================================
+# Vagrant
+#--------------------------------------
+function vagrantSetup {
+ # This function configures the image to work as a vagrant box.
+ # These are the following steps:
+ # - add the vagrant user
+ # - add the vagrant user to /etc/sudoers
+ # - insert the insecure vagrant ssh key
+ # - create the default /vagrant share
+ # - apply some recommended ssh settings
+
+ echo "Add user vagrant"
+ # create vagrant user
+ useradd vagrant
+
+ # insert the default insecure ssh key from here:
+ # https://github.com/hashicorp/vagrant/blob/master/keys/vagrant.pub
+ mkdir -p /home/vagrant/.ssh/
+ chmod 0700 /home/vagrant/.ssh/
+ echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > /home/vagrant/.ssh/authorized_keys
+ chmod 0600 /home/vagrant/.ssh/authorized_keys
+ chown -R vagrant:vagrant /home/vagrant/
+
+ # apply recommended ssh settings for vagrant boxes
+ SSHD_CONFIG=/etc/ssh/sshd_config.d/99-vagrant.conf
+ if [[ ! -d "$(dirname ${SSHD_CONFIG})" ]]; then
+ SSHD_CONFIG=/etc/ssh/sshd_config
+ # prepend the settings, so that they take precedence
+ echo -e "UseDNS no\nGSSAPIAuthentication no\n$(cat ${SSHD_CONFIG})" > ${SSHD_CONFIG}
+ else
+ echo -e "UseDNS no\nGSSAPIAuthentication no" > ${SSHD_CONFIG}
+ fi
+
+ # vagrant assumes that it can sudo without a password
+ # => add the vagrant user to the sudoers list
+ echo "vagrant ALL=(ALL)NOPASSWD:ALL" > /etc/sudoers.d/vagrant
+ visudo -cf /etc/sudoers.d/vagrant
+ chmod 440 /etc/sudoers.d/vagrant
+
+ # the default shared folder
+ mkdir -p /vagrant
+ chown -R vagrant:vagrant /vagrant
+
+ # SSH service
+ baseInsertService sshd
+
+ # start vboxsf service only if the guest tools are present
+ if rpm -q virtualbox-guest-tools 2> /dev/null; then
+ echo vboxsf > /etc/modules-load.d/vboxsf.conf
+ fi
+
+ # drop any network udev rules for libvirt, so that the networks are called
+ # ethX
+ # this is not required for Virtualbox as it handles networking differently
+ # and doesn't need this hack
+ if [ "${kiwi_profiles}" != "virtualbox" ]; then
+ rm -f /etc/udev/rules.d/*-net.rules
+ fi
+
+ # setup DHCP on eth0 properly
+ mkdir /etc/sysconfig/network/
+ cat << EOF > /etc/sysconfig/network/ifcfg-eth0
+STARTMODE=auto
+BOOTPROTO=dhcp
+EOF
+}
+
+#======================================
+# Configure Vagrant specifics
+#--------------------------------------
+if [[ "$kiwi_profiles" == *"Vagrant"* ]]; then
+vagrantSetup
+fi
+
#======================================
# Enable sshd
#--------------------------------------
@@ -82,6 +157,15 @@ if [[ "$kiwi_profiles" =~ s390x-(dasd|fba|fcp) ]]; then
systemctl enable systemd-firstboot
# Enable prompting for the root password
echo 'root:!unprovisioned' | chpasswd -e
+elif [[ "$kiwi_profiles" =~ Vagrant ]]; then
+
+ echo "Disable jeos-firstboot.service for Vagrant boxes"
+ systemctl disable jeos-firstboot.service
+ systemctl mask jeos-firstboot.service
+ echo "Disable systemd-firstboot.service for Vagrant boxes"
+ systemctl disable systemd-firstboot.service
+ systemctl mask systemd-firstboot.service
+
elif rpm -q --whatprovides jeos-firstboot >/dev/null; then
# Enable jeos-firstboot
mkdir -p /var/lib/YaST2