How to install a KVM CentOS6.4 guest with NAT + PXE?

Discussion in 'General Linux' started by maicheng365, Jul 8, 2013.

  1. maicheng365

    maicheng365 New Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I want to test virt-install with PXE + NAT in my VMware Workstation.
    It has two vm VMware Workstation:CentOS1 and CentOS2,below it's description:

    CentOS1: IP 192.168.1.77,as PXE server :192.168.1.77/pub , net type : bridge ,OS:CentOS6.4

    CentOS2: IP 192.168.1.76,need to install a KVM guest named CentOS3 , net type: bridge , OS:CentOS6.4

    I already configured CentOS1,it can automatic intall a CentOS 6.4 ,only need to connect to 192.168.1.77

    CentOS2 like a physical machine ,it has a lot of KVM guest.But I just has one IP address for CentOS2,so these KVM guests network should use NAT.

    My virt-install command line is :

    "virt-install -n CentOS_Http_1 -r 512 --vcpus 1 --accelerate --disk path=/data/virhost/CentOS_Http/node1.img --nographics -w network=default,model=virtio --os-variant=rhel6 --autostart --pxe --force"

    I konw it's wrong ,because I change it several times.There is a screenshot when i run it.

    skydrive image:

    http://sdrv.ms/16Z92Q8

    QQ截图20130708143104.png

    It seems can't find gateway 192.168.1.1,cause the KVM guest gateway use virbr0: 192.168.122.1.

    For now I just know when the guest booting ,if it can find gw 192.168.1.1,not just gw 192.168.122.1,the installation will be success.And I think maybe the nat virtual network configure is very import.


    So how to configure CentOS2 or "virt-install" command line that I can install KVM guest with "virt-install --PXE" ?
    I really need a step-by-step help!

  2. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,128
    Likes Received:
    376
    Trophy Points:
    83
  3. maicheng365

    maicheng365 New Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    My purpose is install a vm in the CentOS2,CentOS2 is also a vm ,I just want to test : install this vm use pxe , and this vm use nat network ,when I run the virt-install command line ,this vm start booting,the dhcp server or virtual network manager give him a IP:192.168.122.* ,and it start to search pxe Server IP = 192.168.122.1-192.168.122.254 ,not 192.168.1.*,he can't find pxe Server(192.168.1.77),so how to configure CentOS2 , make it can find pxe Server.

    And the problem is not about vmware workstation,vmware has two vm ,CentOS1 and CentOS2,both can connect intenet and connect each other,but I install the vm:CentOS3 is in CentOS2,use virt-intall command line ,not in vmware workstation.

Share This Page