I have a dedicated hosted server box with ubuntu 10.04 64 bit installed. I would like to run kvm with ubuntu 8.04 installed for some php 5.2 compatible apps(they don't work right with php 5.3, the default in ubuntu 10.04).

I installed KVM as instructed at https://help.ubuntu.com/community/KVM/Installation . I installed the vm using virt-manager. I never could figure out how use virt-install or any of those automated installers. I just installed it using the disc. I set up bridged networking as per https://help.ubuntu.com/community/KVM/Networking . However, the bridged connection doesn't work.

Here's my /etc/network/interfaces on the host, running ubuntu 10.04. (with specific public ip blanked)

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
        address xx.xx.xx.xx
        gateway xx.xx.xx.xa
        bridge_ports eth0
        bridge_stp on
        bridge_fd 0
        bridge_maxwait 10

Here's my /etc/network/interfaces on the guest, running ubuntu 8.04.

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address xx.xx.xx.xy
gateway xx.xx.xx.xa

The two vm's can communicate to each other. But, the guest vm can't access anyone in the real world.

Here's my /etc/libvirt/qemu/store_804.xml

<domain type='kvm'>
            <type arch='x86_64' machine='pc-0.12'>hvm</type>
            <boot dev='hd'/>
  <clock offset='utc'/>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/store_804.img'/>
      <target dev='hda' bus='ide'/>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
                    <interface type='bridge'>
      <mac address='52:54:00:26:0b:c6'/>
      <source bridge='br0'/>
      <model type='virtio'/>
    <console type='pty'>
      <target port='0'/>
    <console type='pty'>
      <target port='0'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
            <sound model='es1370'/>
      <model type='cirrus' vram='9216' heads='1'/>

Any idea where I've gone wrong?


You can't use bridge mode in such environment, you can almost be certain that the hosting partner will block all traffic not originating from the MAC-address of the real NIC in your server. You'll need to setup a routed setup, in which all traffic to/from VM guests are send through your host. One way of doing this is using the native Libvirt support of routed networking ("forward mode="route" in the XML-configuration of the network).

There's a German server hosting company who has written a couple of guides on the subject, you can use Google translate to translate it into English, in case you don't understand German :) http://wiki.hetzner.de/index.php/Kategorie:KVM

  • Thanks. That makes perfect sense. I shall try it and report back if all works well. – senorsmile Jan 16 '11 at 6:13
  • Thats odd Kenni, I'm doing exactly this in my data center at the moment. Works fine. – Peter NUnn Feb 24 '11 at 11:20
  • Depends on the data center; mine don't allow it either. It's a reasonable decision for them to take and they do provide instructions to work around it, but can't get the damn thing to work anyway... wiki.hetzner.de/index.php/… – El Yobo Jul 17 '12 at 2:07

The guest also needs a default route. Do you have that?

So, you're doing all this just to get a new (downgraded) version of an app? Why not just build (or find, or install from source) a PHP 6.2 package in the host?

  • I had already checked that. Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface xx.xx.xx.8 * U 0 0 0 eth0 default xx.xx.xx.9 UG 100 0 0 eth0 That is the automatically generated routes table, which looks good to me. – senorsmile Jan 11 '11 at 16:54
  • As far as building PHP 5.2 from source, or downgrading manually; I have followed some procedures install PHP 5.2 manually. However, there are many more things needed like mysqli and phpmyadmin, all of which I couldn't easily figure out how to downgrade. Instead of chasing a bunch of dependencies, I would rather just install the store software on a supported platform. – senorsmile Jan 11 '11 at 16:57
  • Ah well, just switch to Gentoo. ;-) – Keith Jan 11 '11 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.