This page documents the procedure for creating a new KVM guest on a mayfirst server. This document is not complete! Do not use it to actually create a new KVM guest yet. = Creating a new KVM guest = 1. Install the [https://support.mayfirst.org/wiki/install_debian_kvm_manager kvm-manager] scripts 1. Run kvm-creator to create the new LV for the guest and the needed directory and files in /etc/sv/kvm/: {{{ USAGE: kvm-creator create|destroy|demo guestname [volumegroup [disksize [ram [tap [mac] ] ] ] }}} 1. Initially it's a good idea to run the demo. This will give you a breakdown of how the server will be created. {{{ kvm-creator demo GUESTNAME }}} 1. After determining the settings you want the machine to have, run the demo command and then the 'create' command. {{{ EXAMPLE WITH OUTPUT: 0 negri:~/preseed-repo/squeeze# kvm-creator demo hay vg_negri0 15G 512 NAME : hay VG : vg_negri0 SIZE : 15G RAM : 512 TAP : tap5 MAC : 02:01:00:00:00:06 DISK : /dev/mapper/vg_negri0-hay 0 negri:~/preseed-repo/squeeze# kvm-creator create hay vg_negri0 15G 512 Adding user `hay' ... Adding new group `hay' (1005) ... Adding new user `hay' (1005) with group `hay' ... Creating home directory `/home/hay' ... Copying files from `/etc/skel' ... Logical volume "hay" created 0 negri:~/preseed-repo/squeeze# }}} 1. Add at least one user to the access list for the new KVM guest's serial console 1. Monkeysphere way: 1. Add a uid to the /home//.monkeysphere/authorized_user_ids file 1. Rebuild the monkeysphere-controlled SSH authorized_keys files: {{{ monkeysphere-authentication update-users }}} 1. SSH key way 1. Add an SSH key to the /home//.ssh/authorized_keys file 1. If you are installing an operating system to the new KVM guest: 1. Put the iso in the {{{ /usr/local/share/ISOs }}} directory. Be sure to verify the checksums on downloaded ISOs! 1. Customize the iso with details for the server you are installing 1. First edit /root/server-specifics.cfg - change values to match the server you are building 1. Change into /usr/local/share/ISOs: {{{ cd /usr/local/share/ISOs }}} 1. Run: {{{ di-maker install.iso /root/preseed.cfg /root/server-specifics.cfg /root/late_command }}} 1. Create a symlink called cd.iso in the /home//vms// directory with a target of the desired ISO: {{{ ln -s /usr/local/share/ISOs/.iso /home//cd.iso }}} 1. Tell runit to start the guest automatically {{{ update-service --add /etc/sv/kvm/SERVER-NAME }}} 1. Log into the new guest via ssh: {{{ ssh SERVER-NAME@HOST-NAME }}} 1. Install an OS: everything should be handled by preseed file