Windows 10: KVM/QEMU users - creating a Network Bridge

Discus and support KVM/QEMU users - creating a Network Bridge in Windows 10 Virtualization to solve the problem; Hi folks Those of you running a Linux host and wanting to run Windows VM's using KVM/QEMU then provided you've got a wired connection you should make... Discussion in 'Windows 10 Virtualization' started by jimbo45, Jul 8, 2020.

  1. jimbo45 Win User

    KVM/QEMU users - creating a Network Bridge


    Hi folks

    Those of you running a Linux host and wanting to run Windows VM's using KVM/QEMU then provided you've got a wired connection you should make a network bridge otherwise your VM will only be able to use NAT with connection limitations.

    so ensure net-tools and bridge-utils packages are installed

    before starting / creating the vm run this type of script :

    ifconfig enp3s0f1 0.0.0.0 <========= change the enp3s0f1 to whatever the name is of your ACTIVE ethernet connection
    brctl addbr br0
    brctl addif br0 enp3s0f1
    dhclient br0
    ifconfig

    the last ifconfig instruction is to verify bridge is up and has an ip address


    now you should have full network access and of course Internet access on your VM.

    Here you can see that the bridge (br0) is assigned ip address 192.168.1.16


    KVM/QEMU users - creating a Network Bridge [​IMG]


    Now the Windows VM's address is also 192.168.1.16 which is correct and has full connectivity.


    KVM/QEMU users - creating a Network Bridge [​IMG]


    (If you only have Wifi -- I haven't yet been able to get a bridge to work (it does on VMWare BTW) - so a get around --USB-->Lan adapter then lan cable into switch and then from switch to wifi extender if you want to avoid long cable runs

    I'm working in a shed (what some brits camma "SHOFFICE" -- Shed converted to an office with power heat etc around 100 metres from main router so this solution works really well -- not running 100 metres of LAN cable through a really freezing garden and hard packed ice in winter !!

    Cheers
    jimbo

    :)
     
    jimbo45, Jul 8, 2020
    #1
  2. jimbo45 Win User

    W10 VM Bridged networking QEMU/KVM (External Switch)

    Hi folks

    Really SIMPLE way of getting Bridged networking to work in QEMU KVM for proper VM access to rest of your LAN -- equivalent to external switch in HYPER-V

    Note you need to do this after re-boot from host each time --you can set a script etc for permanence but as I don't boot the Host very often this works fine.

    1) disable any DHCP from the PHYSICAL NIC i.e set the DHCP to disabled

    2) enter these commands now : assuming eth0 is your physical NIC you are using

    brctl addbr br0
    ifconfig eth0 0.0.0.0
    brctl addif br0 eth0
    dhclient br0

    then hey presto you should see your bridge have an ip address (a real one) and the physical nic not have one.


    KVM/QEMU users - creating a Network Bridge [​IMG]


    Now in the Windows VM

    set the nic to use shared device -- your bridge br0


    KVM/QEMU users - creating a Network Bridge [​IMG]


    it will now have a proper IP address on your LAN and this VM will be accessible to everything on your LAN (it can also access the rest of the LAN too)


    KVM/QEMU users - creating a Network Bridge [​IMG]


    I spent ages with all the quite complex answers on google and invariably ended up with a total mess --usually BOTH the physical NIC and the bridge (br0) having IP addresses so of course internet didn't work on host and VM !!!!!!!

    You need to install dhclient -- ifconfig is also deprecated bit it still is easier for this type of simple command.

    Cheers
    jimbo
     
    jimbo45, Jul 8, 2020
    #2
  3. jimbo45 Win User
    Networking on Windows VM from KVM/ QEMU Host via Bridge

    Hi folks

    For those running Windows VM's on Linux Hosts and want to try the Linux Hypervisor (VMWare and VBOX will run concurrently so you don't even need to power off any running Windows VM's) with decent networking you need to set up a network Bridge (roughly analogous to External Switch in HYPER-V). Otherwise the VM will have access to the Internet only and other parts of your LAN but no host access either way -- either from HOST TO VM or from VM to HOST.

    I've assumed you've already installed basic networking and managed to create a Virtual Machine . (You can create the bridge of course before creating the Virtual Machine to test if it's working properly).

    1) On the HOST install bridge-utils
    2) Create the bridge -- this is done with a simple file in /etc/netctl directory -- my example is kvm-bridge
    3) here's the simplest possible file . If you don't like the basic vi editor (ugh !!!!) you can use a wysisyg full screen editor e.g kate that allows root save to root access only folders.

    Interface=br0
    Connection=bridge
    BindsToInterfaces=(enp2s0f1) ===>to a physical device in your system --
    IP=dhcp

    4) start the bridge : netctl start kvm-bridge

    5) automatically start at Host boot

    netctl enable kvm-bridge

    6) Check via any command if interfaces all working (via ifconfig or any appropriate command). To display the bridge use the command brctl show.

    7) In Samba add these two lines to /etc/samba.conf file

    bind interfaces only = yes
    interfaces = br0 >>>>> Name of your bridge

    If you don't do this on the HOST (only) the host will not have any access to any VM's on the LAN whatever host they are attached to -- even those on different physical machines - it will still be able to access physical machines and the Internet though.

    8) in the VM config for windows (Easy GUI is to use lib-virt - Virtual machine manager) create virtual network --- specify network source -- etc as shown (for Virtio install the win-virtio drivers otherwise a physical nic card will come up - can be used also but virtio is streets ahead for better for Windows)


    KVM/QEMU users - creating a Network Bridge [​IMG]


    9) Now your VM has full network access


    KVM/QEMU users - creating a Network Bridge [​IMG]


    10 ) And from the HOST (Hestur) -- the 2nd VM is a VMWare W10 VM on a different host (wulf) not running KVM.


    KVM/QEMU users - creating a Network Bridge [​IMG]


    Job Done "Seeemples" !!!


    enjoy !!!! ( it's a lot more fun than just starting up VMWare player !!!!!)


    Cheers

    jimbo
     
    jimbo45, Jul 8, 2020
    #3
  4. KVM/QEMU users - creating a Network Bridge

    qemu-kvm

    virt-manager is the gui that can be used to do exactly this.

    from the open source project:QEMU is a generic and open source machine emulator and virtualizer.

    When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC). By using dynamic translation, it achieves very good performance.

    When used as a virtualizer, QEMU achieves near native performances by executing the guest code directly on the host CPU. QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, server and embedded PowerPC, and S390 guests.
     
    Easy Rhino, Jul 8, 2020
    #4
Thema:

KVM/QEMU users - creating a Network Bridge

Loading...
  1. KVM/QEMU users - creating a Network Bridge - Similar Threads - KVM QEMU users

  2. W10 VM Bridged networking QEMU/KVM (External Switch)

    in Windows 10 Virtualization
    W10 VM Bridged networking QEMU/KVM (External Switch): Hi folks Really SIMPLE way of getting Bridged networking to work in QEMU KVM for proper VM access to rest of your LAN -- equivalent to external switch in HYPER-V Note you need to do this after re-boot from host each time --you can set a script etc for permanence but as I...
  3. Bridging network connections

    in Windows 10 Network and Sharing
    Bridging network connections: Hello, I am trying to bridged my mobile internet connection which is connected to laptop via usb to my router which is connected to my laptop via ethernet. The connection works fine as I am able to connect to my router and have internet access! The issue is after running in...
  4. Networking on Windows VM from KVM/ QEMU Host via Bridge

    in Windows 10 Virtualization
    Networking on Windows VM from KVM/ QEMU Host via Bridge: Hi folks For those running Windows VM's on Linux Hosts and want to try the Linux Hypervisor (VMWare and VBOX will run concurrently so you don't even need to power off any running Windows VM's) with decent networking you need to set up a network Bridge (roughly analogous to...
  5. NETWORK BRIDGED MODE

    in Windows 10 Network and Sharing
    NETWORK BRIDGED MODE: MY MODEM HAS NO IPV6 ADDRESS DUE TO BRIDGED MODE. WHAT WILL HAPPEN IF I RESET IT? WHAT IS THE BEST OPTION TO FIX IT? https://answers.microsoft.com/en-us/windows/forum/all/network-bridged-mode/7cb9e208-c131-403f-baaa-0d0fc29d125a
  6. VPN and Network Bridge

    in Windows 10 Network and Sharing
    VPN and Network Bridge: Hello, I have been having an issue with NAT type on my Nintendo switch. If I plug into the ethernet directly It has a NAT type error. This could be fixed on the router, but I do not have access. I then tried to use my computer as a hotspot, running the hotspot through a...
  7. network bridge connection

    in Windows 10 Network and Sharing
    network bridge connection: I set network bridge connection with my friend to share internet. It worked without any problems till yesterday when I came home I saw a triangle with a explanation mark on it with words "network unidentified". What could happen? I can work on the computer but without the...
  8. Network Bridge not working correctly

    in Windows 10 Network and Sharing
    Network Bridge not working correctly: Recently moved my PC to a new place, but forgot my wireless adapter (hence the use of a network bridge). The bridge is from a Windows 8.1 laptop to a Windows 10 desktop. (Wifi -> Ethernet) This worked for a few days, but suddenly I am unable to connect. I've tried doing...
  9. Windows network bridge

    in Windows 10 Customization
    Windows network bridge: I have an issue with my laptop, usually i use an IPO phone in my profession, and would like to make a bridge between WLAN and LAN network so i could connect my phone to internet via Ethernet. But when i starting a bridge the Wi-Fi just stops working, it still can see the...
  10. Can't create a Network Bridge.

    in Windows 10 Network and Sharing
    Can't create a Network Bridge.: Hello everyone, I have installed Windows 10 Insider Preview Build 14267, and when I go to adapter settings in Network and Sharing Center, I can't make a Network Bridge. I am trying to get Wifi and Ethernet together to get internet on my desktop PC, it doesnt have Wifi. Also...