Let's imagine that you have a server which is only accessible over ssh and want to install a virtual machine with kvm or qemu on it based on an Ubuntu server ISO or alternate CD. The logical way to perform this install would have normally been to use a VNC connection to perform the installation, but your machine is so far away that the latency renders this option almost unuseable. Here is a way to do this by redirecting the console output to the terminal and bypass the initial graphical boot screen.
#mount -o loop hardy-server-i386.iso /mnt
#qemu-img create -f qcow2 -c disk.qcow2 2G
#kvm -kernel /mnt/install/vmlinuz -initrd /mnt/install/initrd.gz -append 'file=/cdrom/preseed/ubuntu-server.seed initrd=/install/initrd.gz quiet console=ttyS0 --' -cdrom hardy-server-i386.iso -nographic -hda disk.qcow2
Note that qemu only supports 32 bit images, use qemu-system-x86_64 for 64 bit images. Kvm will support both 32 and 64 bit though.
Thanks to Soren Hansen helping me figuring this one out. Hope it can be useful to someone else.
Recent comments
1 hour 42 min ago
1 hour 43 min ago
2 days 10 hours ago
2 days 11 hours ago
2 days 11 hours ago
2 days 12 hours ago
2 days 12 hours ago
1 week 5 days ago
10 weeks 10 hours ago
10 weeks 17 hours ago