This commit is contained in:
Vyacheslav Anzhiganov 2016-05-24 20:50:39 +00:00
parent 8904660822
commit 3a9bef25c0
2 changed files with 13 additions and 5 deletions

View file

@ -201,11 +201,13 @@ class QEMU:
"--rootsize=%s" % storage,
"--swapsize=%s" % swap,
"--templates=/tmp/libvirt/%s/templates/libvirt" % vm_id,
"--user=ubuntu",
# "--user=ubuntu",
# "--name=administrator",
"--pass=%s" % password,
# "--pass=%s" % password,
# "--ssh-user-key=/tmp/libvirt/%s/authorized_keys" % vm_id,
"--lock-user",
"--rootpass=%s" % password,
"--ssh-user-key=/tmp/libvirt/%s/authorized_keys" % vm_id,
"--ssh-key=/tmp/libvirt/%s/authorized_keys" % vm_id,
"--addpkg=linux-image-generic",
"--addpkg=vim-nox",
"--addpkg=nano",

View file

@ -1,10 +1,13 @@
#firstrun.sh
#!/bin/bash
# This script will run the first time the virtual machine boots
# It is ran as root.
# Expire the user account
passwd -e administrator
# passwd -e administrator
# Remove default `ubuntu` user
deluser --remove-home --remove-all-files ubuntu
# Install openssh-server
apt-get update
@ -13,3 +16,6 @@ apt-get install -qqy --force-yes openssh-server
locale-gen en_US.UTF-8
locale-gen ru_RU.UTF-8
locale-gen
# remove file firstboot.sh
rm -f /root/firstboot.sh /root/firstboot_done