How to make a Virtual Machine present itself to my home network as if it were another physical computer

Here’s the CLI method for setting up a bridge:

# Create bridge
sudo nmcli connection add type bridge \
    connection.id bridge ifname br0 bridge.stp no
sudo nmcli connection add type ethernet \
    connection.id ether master bridge
sudo nmcli connection up bridge
sudo nmcli connection up ether

# Delete old connection
sudo nmcli connection show
sudo nmcli connection delete "Wired connection 1"

# Allow using bridge in session mode
sudo tee -a /etc/qemu/bridge.conf << EOF > /dev/null
allow br0
EOF

# Update VM config
virsh list --all
virsh shutdown win7
EDITOR="sed -i -e /bridge=/s/virbr0/br0/" virsh edit win7
virsh start win7

Disabling STP helps avoid delays during connection activation.
Deleting the old Ethernet connection prevents race conditions.

1 Like