KVM VM problems

uberwebguruuberwebguru Member Posts: 29 ■□□□□□□□□□
I am faced with couple questions with my lab laptop

1. Why is that the host system doesn't have an ipv4 address when system is connected through wifi? The other VMs do have ipv4 except the host system


2. Why is it that the VMs cannot communicate to each other like ssh and so on?

3. I am trying to test the VNC remote access from VM to VM...how do i do this?


Thanks.

Comments

  • onesaintonesaint Member Posts: 801
    Hi uberwbguru,

    All those questions require background information in order to figure out how things are configured and why they aren't working like they should. With that,

    1a. for your host, what OS are you running? Can you paste the output from an ifconfig? Are there other devices getting an IP from your AP? Have you configured the wifi interface correctly?
    1b. KVM is creating network interfaces for the VMs.

    2. VM network interfaces are NATed by default. So, the VMs are NATed (in different subnets) to either your physical wifi nic or to eth0. In either case, outbound traffic from the VM will have no knowledge of other NATed networks, unless you add routes for the VM subnets, e.g.:

    Physical nic: 192.168.0.2/24
    VM1: 192.168.1.2/24
    VM2: 192.168.2.2/24

    there is no route from 192.168.1.x to 192.168.2.X. Add one with route or to IPtables. see here: Networking - KVM and here: http://wiki.libvirt.org/page/Networking

    3. With the info from q.2 you should then be able to connect VNC provided you've got those ports allowed in IPtables and that traffic is routed to the VMs correctly. You might want to start by VNCing from hypervisor to VM, then VM to VM.

    Good luck!
    Work in progress: picking up Postgres, elastisearch, redis, Cloudera, & AWS.
    Next up: eventually the RHCE and to start blogging again.

    Control Protocol; my blog of exam notes and IT randomness
  • uberwebguruuberwebguru Member Posts: 29 ■□□□□□□□□□
    onesaint wrote: »
    Hi uberwbguru,

    All those questions require background information in order to figure out how things are configured and why they aren't working like they should. With that,

    1a. for your host, what OS are you running? Can you paste the output from an ifconfig? Are there other devices getting an IP from your AP? Have you configured the wifi interface correctly?
    1b. KVM is creating network interfaces for the VMs.

    2. VM network interfaces are NATed by default. So, the VMs are NATed (in different subnets) to either your physical wifi nic or to eth0. In either case, outbound traffic from the VM will have no knowledge of other NATed networks, unless you add routes for the VM subnets, e.g.:

    Physical nic: 192.168.0.2/24
    VM1: 192.168.1.2/24
    VM2: 192.168.2.2/24

    there is no route from 192.168.1.x to 192.168.2.X. Add one with route or to IPtables. see here: Networking - KVM and here: libvirt: Wiki: Networking

    3. With the info from q.2 you should then be able to connect VNC provided you've got those ports allowed in IPtables and that traffic is routed to the VMs correctly. You might want to start by VNCing from hypervisor to VM, then VM to VM.

    Good luck!

    #1
    Host OS is RHEL 6.3


    Output of ifconfig:

    #####
    [[email protected] ~]# ifconfig
    eth0 Link encap:Ethernet HWaddr 00:24:E8:BB:8C:56
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
    Interrupt:22 Memory:f6ae0000-f6b00000

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:91027 errors:0 dropped:0 overruns:0 frame:0
    TX packets:91027 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:945432934 (901.6 MiB) TX bytes:945432934 (901.6 MiB)

    virbr0 Link encap:Ethernet HWaddr 52:54:00:EB:73:64
    inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:39009 errors:0 dropped:0 overruns:0 frame:0
    TX packets:68379 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:3050435 (2.9 MiB) TX bytes:88632680 (84.5 MiB)

    vnet0 Link encap:Ethernet HWaddr FE:54:00:CB:19:30
    inet6 addr: fe80::fc54:ff:fecb:1930/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:34606 errors:0 dropped:0 overruns:0 frame:0
    TX packets:61115 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:500
    RX bytes:3112001 (2.9 MiB) TX bytes:70417151 (67.1 MiB)

    wlan0 Link encap:Ethernet HWaddr 00:21:6A:53:AC:2A
    inet addr:192.168.1.16 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::221:6aff:fe53:ac2a/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:347298 errors:0 dropped:0 overruns:0 frame:0
    TX packets:217771 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:453725104 (432.7 MiB) TX bytes:25346604 (24.1 MiB)


    #2
    How do i add routes for the Vm subnets?

    Thanks.
  • onesaintonesaint Member Posts: 801
    For #1
    1. Why is that the host system doesn't have an ipv4 address when system is connected through wifi?
    wlan0 Link encap:Ethernet HWaddr 00:21:6A:53:AC:2A
    inet addr:192.168.1.16


    For #2 read over those links I posted. They include iptables/routing notes, then google.

    Good luck!
    Work in progress: picking up Postgres, elastisearch, redis, Cloudera, & AWS.
    Next up: eventually the RHCE and to start blogging again.

    Control Protocol; my blog of exam notes and IT randomness
  • uberwebguruuberwebguru Member Posts: 29 ■□□□□□□□□□
    Would be much better help just pointing me to what i need to add/remove
    i learn better by example or steps
    looking at those links just isn't working..at least yet
    but if u cant its cool

    thanks
  • uberwebguruuberwebguru Member Posts: 29 ■□□□□□□□□□
    onesaint wrote: »
    Hi uberwbguru,

    All those questions require background information in order to figure out how things are configured and why they aren't working like they should. With that,

    1a. for your host, what OS are you running? Can you paste the output from an ifconfig? Are there other devices getting an IP from your AP? Have you configured the wifi interface correctly?
    1b. KVM is creating network interfaces for the VMs.

    2. VM network interfaces are NATed by default. So, the VMs are NATed (in different subnets) to either your physical wifi nic or to eth0. In either case, outbound traffic from the VM will have no knowledge of other NATed networks, unless you add routes for the VM subnets, e.g.:

    Physical nic: 192.168.0.2/24
    VM1: 192.168.1.2/24
    VM2: 192.168.2.2/24

    there is no route from 192.168.1.x to 192.168.2.X. Add one with route or to IPtables. see here: Networking - KVM and here: libvirt: Wiki: Networking

    3. With the info from q.2 you should then be able to connect VNC provided you've got those ports allowed in IPtables and that traffic is routed to the VMs correctly. You might want to start by VNCing from hypervisor to VM, then VM to VM.

    Good luck!

    Where in those links do i look for how to make VMs connect and access each other? and also for host to be able to access VMs like via http, ftp, ssh et cetera
  • uberwebguruuberwebguru Member Posts: 29 ■□□□□□□□□□
    • You need the following commands installed on your system, and if you don't want to run as root, the user you want to use needs to be able to sudo the following command:

    /sbin/ip /usr/sbin/brctl /usr/sbin/tunctl


    Ho in hell do i install those commands? I mean i don't see yum or anything so i am confused
  • uberwebguruuberwebguru Member Posts: 29 ■□□□□□□□□□
    can someone please help me?
  • onesaintonesaint Member Posts: 801
    Ok, I'll give this one more shot.

    try typing "man sudo" in your shell then pressing enter. Do that also for "man brctl" and "man tunctl". Google them with KVM networking to see what the issue is.

    Linux is not an OS that you just get handed commands for and wham! you can admin the OS. It requires an interest in the OS' functionality, which requires reading and lots of it. Don't understand sudo, brctl, find, or any other of the base linux tools? search for them on the web. Find out what they do then go back and try to work things out.

    I appreciate that you're setting up a lab and I don't have any insight into your previous experience. With that, the few pages I directed you at have information that should and can lead you to other things to search for. The questions you're asking delve into many areas of Linux and if you truly want to know the OS, you need to search for answers and draw your own conclusions. Then ask questions if you can't do specific things. Thanks.
    Work in progress: picking up Postgres, elastisearch, redis, Cloudera, & AWS.
    Next up: eventually the RHCE and to start blogging again.

    Control Protocol; my blog of exam notes and IT randomness
  • uberwebguruuberwebguru Member Posts: 29 ■□□□□□□□□□
    I resolved the issue by following this url Creating a CentOS 6 KVM Networked Bridge Interface - Techotopia
    Everything works now

    Thanks for the help @onesaint
  • onesaintonesaint Member Posts: 801
    Glad to see you got it working!

    Have fun.
    Work in progress: picking up Postgres, elastisearch, redis, Cloudera, & AWS.
    Next up: eventually the RHCE and to start blogging again.

    Control Protocol; my blog of exam notes and IT randomness
  • log32log32 Users Awaiting Email Confirmation Posts: 217
Sign In or Register to comment.