Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
        netmask 255.255.255.248
        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
netmask 255.255.255.248
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'>
  <name>store_804</name>
  <uuid>27acfb75-4f90-a34c-9a0b-70a6927ae84c</uuid>
  <memory>2097152</memory>
  <currentMemory>2097152</currentMemory>
  <vcpu>2</vcpu>
  <os>
            <type arch='x86_64' machine='pc-0.12'>hvm</type>
            <boot dev='hd'/>
              </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
      <on_crash>restart</on_crash>
      <devices>
            <emulator>/usr/bin/kvm</emulator>
    <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>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
            </disk>
                    <interface type='bridge'>
      <mac address='52:54:00:26:0b:c6'/>
      <source bridge='br0'/>
      <model type='virtio'/>
        </interface>
    <console type='pty'>
      <target port='0'/>
    </console>
    <console type='pty'>
      <target port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
            <sound model='es1370'/>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
    </video>
  </devices>
</domain>

Any idea where I've gone wrong?

share|improve this question

2 Answers 2

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

share|improve this answer
    
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?

share|improve this answer
    
I had already checked that. Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface xx.xx.xx.8 * 255.255.255.248 U 0 0 0 eth0 default xx.xx.xx.9 0.0.0.0 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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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