Skip to main content
Topic: KVM (Read 93 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

KVM

Is anyone aware of a simple KVM and QEMU tutorial to create a virtual machine that can be assiged a static IP  so that one can run  a webserver from it.

I wanted to set up my webservers that are running in metal, into vms, and have them use the same IP addresses that the metal is now currently using.    I'm not so sure why networking for the VM is so hard.

I've seen situations where servers even have multiple IP addresses assinged to systems with virtual network interfaces such as

eth0.1
eth0.2

etc.  Sonic Walls do this.

Why do I need a whole networking wrapper for the VM.  Can't I just assign the virtual network device inside the VM to the ethernet device on the metal, as you can will all the other devices, mouse, keyboard, tty, sound.  The VM just maps this stuff as part of the VMs inherent ability.  Why does networking require an entire wrapper virtual network?

I've been told the key to doing this is to build a bridge device (so we now have a who bunch of new devices).  But I can't find any tutorials to do this, just a lot of confusing and, IMO, poorly written documentation.

I so miss the old days of Linux HowTOs

 

Re: KVM

Reply #1
You can forward needed ports from host to vm

Re: KVM

Reply #2
maybe this
https://www.linux-kvm.org/page/Networking

with systemd now everywhere, it will be worth while to get something like this for artix

Code: [Select]

Solution 1: Using Distribution-Specific Scripts
RedHat Debian SuSE

    Edit /etc/sysconfig/network-scripts/ifcfg-eth0
        comment out BOOTPROTO
        Add BRIDGE=br0
    Create /etc/sysconfig/network-scripts/ifcfg-br0
        The content should be:

DEVICE=br0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Bridge



/etc/network/interfaces

# Replace old eth0 config with br0
auto eth0 br0

# Use old eth0 config for br0, plus bridge stuff
iface br0 inet dhcp
    bridge_ports    eth0
    bridge_stp      off
    bridge_maxwait  0
    bridge_fd       0



    Start YaST
    Go to Network Configuration
    Add new device -> Bridge
    Tick your existing network device
    done

    /etc/init.d/networking restart
    The bridge br0 should get the IP address (either static/dhcp) while the physical eth0 is left without an IP address.

Re: KVM

Reply #3
You can forward needed ports from host to vm


not if you need to use both, independenly.  That is why you have these virtual network devices on the metal, so that you can access two different processes on a single real network device