Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: KVM & networking question

  1. #11
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,521
    Distro
    Ubuntu Development Release

    Re: KVM & networking question

    Quote Originally Posted by dnedzel View Post
    I don't understand why VM's don't just use DHCP like a regular computer,
    They can, and you are almost there, since you already have the bridge set up. You just need to tell your VM to use it.

    There are other ways to do this, but here is how I do it:
    For an existing VM, use virsh edit and change this area (substitute your MAC, as I just copied one of mine)):
    Code:
        <interface type='network'>
          <mac address='52:54:00:0d:ed:95'/>
          <source network='default'/>
          <model type='virtio'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
        </interface>
    To this:
    Code:
        <interface type='bridge'>
          <mac address='52:54:00:0d:ed:95'/>
          <source bridge='br0'/>
          <model type='virtio'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
        </interface>
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  2. #12
    Join Date
    Jul 2008
    Beans
    9

    Re: KVM & networking question

    Thanks Doug - do I run virsh in the host or the guest?

    thanks!

  3. #13
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,521
    Distro
    Ubuntu Development Release

    Re: KVM & networking question

    Quote Originally Posted by dnedzel View Post
    do I run virsh in the host or the guest?
    You run virsh edit in the host, with the guest not running. You are going to edit the guests definition file. Say your guest name was desk_dev, then the definition file will be /etc/libvirt/qemu/desk_dev.xml. But you must use "virsh edit desk_dev" (from any directory) to to the edit as some checks are done upon save exit from the editor.

    Note 1: the default editor used by virsh edit is as defined by the $EDITOR environment variable, or VI if it does not exist. add export EDITOR="/bin/nano" to your ~/.bashrc file to set, for example, nano as your default editor.

    Note 2: There is a way to do this with virt-manager, but I do not use it and do not know how.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  4. #14
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: KVM & networking question

    You can run virsh or virt-manager from anywhere on the network - it can use an ssh connection to manage VMs.
    virt-manager is 1000x easier than virsh - it is a GUI like virtualBox or vSphere.

    Don't use the built-in bridge (the one that was created by libvirt automatically) if you care about stability.
    a) it is NAT
    b) it goes up and down
    c) a manually created bridge is rock, stable.

    virt-manager has an "apply" button when you are editing settings for a VM.
    virt-manager can be run from anywhere on the network that has ssh access into the VM host.
    There are a few things that virt-manager cannot do but for a beginner - it makes everything around KVM VMs easier. What won't it do?
    * create qcow2 virtual HDDs
    * create lxc containers
    Those are the big ones off my head. There are probably other things too, but I don't use them.

    virt-manager means never needing to have Windows to manage a group of VM hosts with a GUI. !!!!!! That always bothered me about vsphere. OTOH, I don't think there is a Windows virt-manager client, so you'll want a Linux desktop "somewhere" to manage VMs.

    Plus with libvirt on the hostOS and management workstation (which can be the same or different systems), the VM manager doesn't need root/sudo. Membership in the libvirtd group is sufficient authority to create, manage, start, stop, destroy, and delete VMs.

    I've been meaning to make a short video about setting of KVM + virt-manager ... someday. Most people only show these things on 1 PC. My KVM servers are headless - doesn't matter - as long as the machine running virt-manager is running X/Windows and virt-manager w/ ssh access.
    http://blog.jdpfu.com/ALE/ALE-NW/201...alization.html has a presentation I've given on this. Bridge config is on pg 15. This isn't really meant to be presented without a speaker - sorry.

    BTW - if you are the last poster and need to update something, please just edit your last post. We don't need 30 posts with the same ifconfig.

  5. #15
    Join Date
    Jul 2008
    Beans
    9

    Re: KVM & networking question

    Doug and TheFu,

    Thanks so much guys! This is super helpful info! Up to my eyeballs in iOS coding right now, will work on the KVM networking this evening. Should be pretty easy now.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •