From 8904660822ad03eb3379e08cc4d1a898498632f0 Mon Sep 17 00:00:00 2001 From: vanzhiganov Date: Sat, 21 May 2016 20:15:52 +0000 Subject: [PATCH] support QEMU --- SWSCloudNode/qemu/__init__.py | 4 ++-- vm/firstboot.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 vm/firstboot.sh diff --git a/SWSCloudNode/qemu/__init__.py b/SWSCloudNode/qemu/__init__.py index 458c6d4..a7b972c 100644 --- a/SWSCloudNode/qemu/__init__.py +++ b/SWSCloudNode/qemu/__init__.py @@ -201,9 +201,9 @@ class QEMU: "--rootsize=%s" % storage, "--swapsize=%s" % swap, "--templates=/tmp/libvirt/%s/templates/libvirt" % vm_id, - # "--user=administrator", + "--user=ubuntu", # "--name=administrator", - # "--pass=%s" % values['password'], + "--pass=%s" % password, "--rootpass=%s" % password, "--ssh-user-key=/tmp/libvirt/%s/authorized_keys" % vm_id, "--addpkg=linux-image-generic", diff --git a/vm/firstboot.sh b/vm/firstboot.sh new file mode 100644 index 0000000..d98ca93 --- /dev/null +++ b/vm/firstboot.sh @@ -0,0 +1,15 @@ +#firstrun.sh + +# This script will run the first time the virtual machine boots +# It is ran as root. + +# Expire the user account +passwd -e administrator + +# Install openssh-server +apt-get update +apt-get install -qqy --force-yes openssh-server + +locale-gen en_US.UTF-8 +locale-gen ru_RU.UTF-8 +locale-gen