Hi all,
I have been putting off migrating from VirtualBox to QEMU/KVM because for almost two years every time I tried to figure out how to setup the guest VM to be on the same subnet, I either got to a thread that got me more confused than before (for example this thread) or got me to end up disabling my host network by obviously making a mistake (for example this site).
I do admit sometimes it is too overwhelming to read all different advises and end up with nothing or not get anywhere.
I only want to achieve same results as VirtualBox, meaning guest being on same subnet as host (192.168.0.x), but with virt-manager, and regular NAT connection internet works but guest is on (192.168.122.x).
The setup of hypervisor was through YaST by installing KVM Server and libvirt LXC daemon. Installed virt-manager, qemu-kvm, and libvirt-client through zypper.
sudo virsh net-autostart default
sudo usermod -a -G libvirt USERNAME
sudo usermod -a -G kvm USERNAME
Right now I have:
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether d8:bb:c1:47:1b:db brd ff:ff:ff:ff:ff:ff
altname enp5s0
inet 192.168.0.10/24 brd 192.168.0.255 scope global dynamic noprefixroute eth1
valid_lft 59340sec preferred_lft 59340sec
inet6 fe80::1872:946c:c577:4092/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 42:be:c9:a8:c1:92 brd ff:ff:ff:ff:ff:ff permaddr 64:79:f0:44:e9:2c
altname wlo1
altname wlp0s20f3
7: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:66:41:3b brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
9: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether ea:19:f5:ed:5d:8e brd ff:ff:ff:ff:ff:ff
inet 192.168.0.192/24 brd 192.168.0.255 scope global noprefixroute br0
valid_lft forever preferred_lft forever
and,
nmcli device show
GENERAL.DEVICE: eth1
GENERAL.TYPE: ethernet
GENERAL.HWADDR: D8:BB:C1:47:1B:DB
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: eth0
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/1
WIRED-PROPERTIES.CARRIER: on
IP4.ADDRESS[1]: 192.168.0.10/24
IP4.GATEWAY: 192.168.0.1
IP4.ROUTE[1]: dst = 0.0.0.0/0, nh = 192.168.0.1, mt = 100
IP4.ROUTE[2]: dst = 192.168.0.0/24, nh = 0.0.0.0, mt = 100
IP4.DNS[1]: 192.168.0.1
IP6.ADDRESS[1]: fe80::1872:946c:c577:4092/64
IP6.GATEWAY: fe80::264b:feff:feae:3ef8
IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 100
IP6.ROUTE[2]: dst = ::/0, nh = fe80::264b:feff:feae:3ef8, mt = 20100
GENERAL.DEVICE: br0
GENERAL.TYPE: bridge
GENERAL.HWADDR: EA:19:F5:ED:5D:8E
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: bridge_virt
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/7
IP4.ADDRESS[1]: 192.168.0.192/24
IP4.GATEWAY: --
IP4.ROUTE[1]: dst = 192.168.0.0/24, nh = 0.0.0.0, mt = 425
GENERAL.DEVICE: virbr0
GENERAL.TYPE: bridge
GENERAL.HWADDR: 52:54:00:66:41:3B
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected (externally))
GENERAL.CONNECTION: virbr0
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/5
IP4.ADDRESS[1]: 192.168.122.1/24
IP4.GATEWAY: --
IP4.ROUTE[1]: dst = 192.168.122.0/24, nh = 0.0.0.0, mt = 0
IP6.GATEWAY: --
GENERAL.DEVICE: wlan0
GENERAL.TYPE: wifi
GENERAL.HWADDR: F6:50:9C:08:EB:30
GENERAL.MTU: 1500
GENERAL.STATE: 30 (disconnected)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
GENERAL.DEVICE: p2p-dev-wlan0
GENERAL.TYPE: wifi-p2p
GENERAL.HWADDR: (unknown)
GENERAL.MTU: 0
GENERAL.STATE: 30 (disconnected)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
GENERAL.DEVICE: lo
GENERAL.TYPE: loopback
GENERAL.HWADDR: 00:00:00:00:00:00
GENERAL.MTU: 65536
GENERAL.STATE: 10 (unmanaged)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
IP4.ADDRESS[1]: 127.0.0.1/8
IP4.GATEWAY: --
IP6.ADDRESS[1]: ::1/128
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = ::1/128, nh = ::, mt = 256
I created the br0 following this website but instead of using ‘nmtui’ I used NetworkManager connections and gave it 192.168.0.192 as a static IP thinking I can dedicate the said IP to that VM on my router (which I used to do when using VirtualBox) so I can port forward to guest VM.
I would appreciate if someone could help me I would greatly appreciate it. I am not as tech savvy as most people are, but I try my best.
Greatly appreciate your help and guidance.