From 6e851ff1c831ad211c080c35b5e03890e4546d3c Mon Sep 17 00:00:00 2001 From: Adam Fairbrother Date: Wed, 27 Oct 2021 14:07:14 -0700 Subject: [PATCH] Added support for Bridge mode networking. (#160) * Added support for Bridge mode networking. added config file option "bridge" set to a correctly configured bridge device to enable qemu-bridge-helper * Added Docs for Bridge network feature --- README.md | 7 +++++++ quickemu | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index 8533326..b267d03 100644 --- a/README.md +++ b/README.md @@ -443,6 +443,13 @@ In the example above: * Port 8123 on the host is forwarded to port 8123 on the guest. * Port 8888 on the host is forwarded to port 80 on the guest. +# Bridged networking + +Connect your virtual machine to a preconfigured network bridge. +Add an additional line to your virtual machine configuration + + * `bridge="br0"` + # USB redirection Quickemu supports USB redirection via SPICE pass-through and host pass-through. diff --git a/quickemu b/quickemu index 841ab2e..4bc0836 100755 --- a/quickemu +++ b/quickemu @@ -815,6 +815,9 @@ function vm_boot() { # See https://github.com/wimpysworld/quickemu/issues/115 if [ "${guest_os}" == "windows" ] && [ -n "${iso}" ]; then args+=(-nic none) + elif [ -n "${bridge}" ]; then + # Enable bridge mode networking + args+=(-nic bridge,br=${bridge},model=virtio-net-pci) else # shellcheck disable=SC2054,SC2206 args+=(-device ${NET_DEVICE},netdev=nic -netdev ${NET},id=nic) @@ -965,6 +968,7 @@ function usage() { # Lowercase variables are used in the VM config file only boot="efi" +bridge="" cpu_cores="" disk_img="" disk_size=""