[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Guest can't see hosts network connection using QEMU-KVM



Gary L. Roach wrote:

> AMD-64 4 cpu processor
> 
> Host Debian Buster
> 
> Guest kubuntu 18.04
> 
> Virtual Machine QEMU

Why don't you take virtualbox or vmplayer?

Choosing QEMU in such a case is masochism pure.

You've been using https://wiki.debian.org/QEMU - right?
There it says it was tested in Squeeze. Things change with time.

Last week I looked into Qemu again cause I wanted to try RPi emulation,
however recalled pretty fast why I compiled it from scratch few years ago.

OK, about the network: perhaps try without the bridge first and let qemu
configure. Read once again the notes on the QEMU I wrote back then
(2015) -very likely it was stretch. You can replace the variables with
yours and of course eth0 may be something else
----- strat -----
#
# First take eth0 down, then bring it up with IP address 0.0.0.0
#
/sbin/ifdown eth0
/sbin/ifconfig eth0 0.0.0.0 promisc up
#
# Bring up the tap device (name specified as first argument, by QEMU)
#
/usr/sbin/openvpn --mktun --dev $IF --user emanoil
/sbin/ifconfig $IF 0.0.0.0 promisc up
#
# create the bridge between eth0 and the tap device
#
/sbin/brctl addbr br0
/sbin/brctl addif br0 eth0
/sbin/brctl addif br0 $IF
#
# only a single bridge so loops are not possible, turn off spanning tree
protocol
#
/sbin/brctl stp br0 off
#
# Bring up the bridge with ETH0IPADDR and add the default route
#
/sbin/ifconfig br0 $ETH0IPADDR netmask 255.255.255.0 broadcast $BROADCAST
/sbin/route add default gw $GATEWAY
/sbin/ifconfig eth0 $ETH0IPADDR netmask 255.255.255.0 broadcast $BROADCAST
----- end -----

when you finsih

----- strat -----
/sbin/ifdown eth0
/sbin/ifdown br0
/sbin/ifconfig br0 down
#
# Delete the bridge
#
/sbin/brctl delbr br0
#
# bring up eth0 in "normal" mode
#
/sbin/ifconfig eth0 -promisc
/sbin/ifup eth0
#
# delete the tap device
#
/usr/sbin/openvpn --rmtun --dev $IF
----- end -----
I hope it helps


Reply to: