我有一个安装了Ubuntu 10.04 64位的专用主机服务器。 我想运行一些php 5.2兼容的应用程序(它们不适用于PHP 5.3,默认在Ubuntu 10.04)的Ubuntu 8.04安装KVM。
我按照https://help.ubuntu.com/community/KVM/Installation中的说明安装了KVM。 我使用virt-manager安装了虚拟机。 我永远无法弄清楚如何使用virt-install或任何这些自动安装程序。 我刚刚使用光盘安装了它。 根据https://help.ubuntu.com/community/KVM/Networking设置桥接networking。 但是,桥接连接不起作用。
这是我的主机上的/ etc / network / interfaces,运行ubuntu 10.04。 (具体公开ip空白)
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 `
这是我的/ etc / network / interfaces上的客户端,运行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
两个虚拟机可以互相沟通。 但是,guest虚拟机无法访问真实世界中的任何人。
这是我的/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>
任何想法我错了?
你不能在这样的环境中使用网桥模式,几乎可以肯定的是,托pipe合作伙伴将阻止所有的stream量不是源于你的服务器中的真实网卡的MAC地址。 您需要设置一个路由设置,在该设置中,通过主机发送/接收来自VM guest虚拟机的所有stream量。 这样做的一种方法是使用路由networking的本地Libvirt支持(networking的XMLconfiguration中的“forward mode =”route“)。
有一家德国服务器托pipe公司谁已经写了几个指南的主题,你可以使用谷歌翻译将其翻译成英文,万一你不明白德语:) http://wiki.hetzner.de/index。 PHP /类别:KVM
客人还需要一个默认路由。 你有吗?
那么,你只是为了得到一个新的(降级)版本的应用程序而做这一切? 为什么不直接在主机上构build(或者从源代码安装)一个PHP 6.2包?