I'm trying to set up a test VM in KVM according to the steps described here:
https://wiki.iac.isu.edu/index.php/KVM_Virtualization#Example_vmbuilder_Commands
My host system is Ubuntu 10.04. This is what I do:
vmbuilder kvm ubuntu --suite=lucid --flavour=server --arch=amd64 \
--mirror=http://archive.ubuntu.com/ubuntu -o --libvirt=qemu:///system \
--ip=192.168.122.2 --part=vmbuilder.partition --templates=templates --user=superuser \
--name=Administrator --pass=Phaeyu3u \
--addpkg=unattended-upgrades --addpkg=acpid --firstboot=/root/kvm/boot.sh \
--mem=256 --hostname=testvm1
Command finishes successfully. Then I run the following command to start kvm:
exec kvm -m 256 -nographic -smp 1 -drive file=tmpKY9ICg.qcow2 "$@"
Then I think I have to run: virsh start testvm1
When I then check if it's running (virsh 'list --all') it says it's starting up. And it's starting up forever. Nothing else happens. When I type ifconfig I can see I have 2 new interfaces:
virbr0 Link encap:Ethernet HWaddr fe:54:00:12:47:e8
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::2cea:7eff:2cea:7eff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:158 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:13540 (13.5 KB)
vnet0 Link encap:Ethernet HWaddr fe:54:00:12:47:e8
inet6 addr: fe80::fc54:ff:2cea:7eff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:257 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:13660 (13.6 KB)
I'd rather expect that the VM would run, install openssh-server and listen on 192.168.122.2:22 so that I could log in via ssh. But it's not:
$netstat -nl | grep 192
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN
udp 0 0 192.168.122.1:53 0.0.0.0:*
What am I doing wrong?
Notice that virbr0 has ip 192.168.122.1 - not .2 - that may be somehow caused by my previous (unsuccessful) tries.
kvm
command directly. This is exactly whatvirsh start ...
is going to do, but I suspect you've confused it.