These notes are for creating a virtual server installed and running the way I like it, in under 2 minutes (time is dependent on the hosting hardware, Internet connection speed, and how many packages have been updated since you created the template).
It's based on the previous notes I wrote when doing this for Chimaera.
kpartx -a /dev/LVM/VMname mount /dev/mapper/LVM-VMname1 /mnt rsync -Pav fs.Daedalus.tgz /mnt cd /mnt rsync -Pav var/log/ var/log.pristine rm -f etc/apt/sources.list etc/apt/sources.list~ sed -i "s/export PATH/export PATH\nexport HISTSIZE=10000\nexport HISTFILESIZE=10000\nexport HISTCONTROL=none\nexport HISTTIMEFORMAT=\"%F %T \"\nexport QUOTING_STYLE=literal/" etc/profile echo -e "PermitRootLogin yes\nPubkeyAcceptedKeyTypes=+ssh-dss" >etc/ssh/sshd_config.d/dss.conf echo "HashKnownHosts no" >etc/ssh/ssh_config.d/nohash.conf sed -i "s/sulogin/sulogin -t 30/" etc/init.d/checkfs.sh sed -i "s/#kernel.printk = 3 4 1 3/kernel.printk = 3 4 1 3/" etc/sysctl.conf sed -i "s/:root:/:MyHostNameGoesHere:/" etc/passwd cd ~ umount /mnt dd if=/dev/zero of=/dev/mapper/LVM-VMname2 kpartx -d /dev/LVM/VMname
etc/apt/apt.conf.d/42norecommendationsplease etc/apt/apt.conf.d/42nosuggestionsplease etc/apt/sources.list.d/Daedalus.list etc/boot.d/firstboot etc/cron.midnight/ etc/cron.midnight/.placeholder etc/cron.minutely/ etc/cron.minutely/.placeholder etc/cron.yearly/ etc/cron.yearly/.placeholder etc/cron.daily/backup etc/crontab etc/fstab etc/network/interfaces etc/timezone etc/rsyslog.d/default.conf etc/rsyslog.d/central.conf home/youruser/.ssh/authorized_keys root/.ssh/authorized_keys root/.ssh/backup.id_rsa root/.ssh/backup.id_rsa.pub root/.ssh/known_hosts
These will be unpacked onto the new system in the next step.
tune2fs -L rootfs /dev/vda1 ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime cd / tar -xvf fs.Daedalus.tgz rm -f fs.Daedalus.tgz apt-get install -y aptitude aptitude install -y less ntp rsync vim aptitude purge -y nano vim-tiny echo 'syntax off' >>~/.vimrc [ -e /etc/default/su ] || echo ALWAYS_SET_PATH=yes >/etc/default/su cat /etc/default/su | grep -q ALWAYS_SET_PATH || echo ALWAYS_SET_PATH=yes >>/etc/default/su aptitude install -y parted acpi{d,-support-base} sendmail s-nail dnsutils echo 'RESUME=LABEL=swap' >/etc/initramfs-tools/conf.d/resume update-initramfs -k all -u
You now have a VM server image which can be ddrescue'd over the top of a blank VM partition (2 Gbytes or bigger), and when booted, will be a usable VM in under 2 minutes using the NewInstantVM script..
Go up
Return to main index.