Create a minimal image (without recommended packages), ~20min:
sudo vmbuilder kvm ubuntu --arch 'amd64' --rootsize '4096' \
--kernel-flavour 'server' --components 'main,universe' \
--addpkg eucalyptus-nc --user 'ubuntu' --pass 'ubuntu' \
-v --debug
N.B. The most important option above, for the sake of this tutorial, is --kernel-flavour 'server'. By default, vmbuilder includes the linux-image-virtual kernel, which lacks some drivers necessary for booting and running from real hardware. vmbuilder supports many options which are not documented in the manpage:vmbuilder kvm ubuntu --help
qemu-img convert -O raw *.qcow2 disk.raw
Optionally, compress the image for transfer over the network, ~90sec:
lzma disk.raw
Finally, decompress it and write it directly to disk. For this step, I often use an Ubuntu Desktop liveCD, and change to the root user.
sudo -s
lzma -dc disk.raw.lzma > /dev/sda
photo © MIROSLAV VAJDIĆ
from openphoto.net CC:Attribution-ShareAlike
nice tutorial. Thansk! But can i set the keyboard layout? I start the vm with ./run.sh but then i have the english keyboard layout but i have a german keyboard.
ReplyDeletei tried to edit the run.sh scipt and added "-k de" to the kvm command, but that does not help. any ideas?