Differences between revisions 1 and 8 (spanning 7 versions)
Revision 1 as of 2017-11-11 23:37:45
Size: 1088
Editor: shran
Comment:
Revision 8 as of 2018-01-01 20:57:36
Size: 1614
Comment:
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
Define your [[KVM Guest Disk Layout|disk layout]], then go ahead and install Debian. Make sure this is an installation with a minimum of packages. Once Debian has been installed, leave the template alone. Define your [[KVM Guest Disk Layout|disk layout]], then go ahead and install Debian. Make sure this is an installation with a minimum of packages. Once Debian has been installed, leave the template alone. On a fresh minimal installation, not much diskspace is used.
{{{
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg1-root 1,9G 791M 954M 46% /
/dev/vda1 243M 53M 162M 25% /boot
}}}
Line 15: Line 20:
Start by [[Domain Cloning|cloning your template]], Start by [[Domain Cloning|cloning your template]].
Line 37: Line 42:
service hostname restart
Line 40: Line 44:
==== sshd ==== ==== Unique sshd keys ====
Line 42: Line 46:
Make sure the ssh keys are unique. Make sure your clone does indeed have unique ssh keys. This is a really important step when cloning. Consider all your clones had the same ssh keys, that would really be a mess.
Line 51: Line 55:
Make sure downloaded .deb files are removed after they have been installed.
{{{
echo "APT::Keep-Downloaded-Packages \"false\";" > /etc/apt/apt.conf.d/01keep-debs
}}}

KVM Guest Operating System

The KVM Guest is a sparse installation.

KVM Guest Template

Install Debian

Define your disk layout, then go ahead and install Debian. Make sure this is an installation with a minimum of packages. Once Debian has been installed, leave the template alone. On a fresh minimal installation, not much diskspace is used.

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg1-root  1,9G  791M  954M   46% /
/dev/vda1             243M   53M  162M   25% /boot

KVM Guest Clone

Clone Your Template

Start by cloning your template.

Configure the New Guest

Root Password

Reset your root passwd.

passwd

Hostname

Your new system will need a new hostname.

  • /etc/hostname
  • /etc/hosts

sed -i 's/stretch-template/clone/g' /etc/hosts
sed -i 's/stretch-template/clone/g' /etc/hostname

Unique sshd keys

Make sure your clone does indeed have unique ssh keys. This is a really important step when cloning. Consider all your clones had the same ssh keys, that would really be a mess.

rm /etc/ssh/ssh_host_*
dpkg-reconfigure openssh-server
service sshd restart

Update

Make sure downloaded .deb files are removed after they have been installed.

echo "APT::Keep-Downloaded-Packages \"false\";" > /etc/apt/apt.conf.d/01keep-debs

Since the template can be quite old, you might as well update the new system.

apt-get update
apt-get upgrade

None: KVM Guest Operating System (last edited 2020-12-13 12:38:05 by Kristian Kallenberg)