0

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.

2
  • 1
    You shoulnd't be running the kvm command directly. This is exactly what virsh start ... is going to do, but I suspect you've confused it.
    – larsks
    May 21, 2012 at 20:10
  • I tried to run it with 'virsh start', as you suggest, but it's not making any difference.
    – wanson
    May 23, 2012 at 5:56

1 Answer 1

0

Try running 'brctl show' to see if vnet0 has been added to the virbr0 group. If it isn't there then you can try adding it manually ("brctl addbr virbr0 vnet0"). This may point at an underlying issue of needing a qemu-ifup script (mentioned in the link below) to bring it up automatically.

https://help.ubuntu.com/community/KVM/Directly

If you don't need NAT then you might be better off just setting up a bridge group to one of your NIC's and letting your vm's grab an address from your existing segment.

1
  • Yes, vnet0 has been added to the virbr0 group.
    – wanson
    May 23, 2012 at 6:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .