You are not logged in.

#1 2024-04-22 01:03:07

JessicaJill
Member
Registered: 2022-01-04
Posts: 20

[SOLVED] VM (GPU Passthrough) stops ethernet connection

Im having a problem with my Ethernet link shutting down when I launch my VM (GPU passthrough).

This is a recent problem ever since I decided to switch from wifi to ethernet.  After making the switch, the Ethernet (enp4s0) failed to start after reboot, and had to be manually started using 'sudo modprobe r8169'
I attempted to add it to mkinitcpio.conf with no luck, eventually I just created a service to run at boot seems to be fine now.  (*Im not sure if this is related to the problem but I thought it was worth mentioning)

When using Wifi, I can launch the VM and access the internet on my local machine or from the VM.  This is how I would like it to work when using the Ethernet.
When using the Ethernet adapter, once the VM starts, enp4s0 is turned off, but Im able to access the internet from the VM, just not my local machine.

After rebooting I check 'ip link'

❯ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlp5s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 9c:fc:e8:f5:73:c8 brd ff:ff:ff:ff:ff:ff
3: virbr1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:a3:7b:92 brd ff:ff:ff:ff:ff:ff
4: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether a8:a1:59:8e:65:d3 brd ff:ff:ff:ff:ff:ff
5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:69:e8:6c brd ff:ff:ff:ff:ff:ff

dmesg logs

[    7.395945] r8169 0000:04:00.0: enabling device (0000 -> 0003)
[    7.396067] r8169 0000:04:00.0: can't disable ASPM; OS doesn't have ASPM control
[    7.408852] r8169 0000:04:00.0 eth0: RTL8125B, a8:a1:59:8e:65:d3, XID 641, IRQ 147
[    7.408856] r8169 0000:04:00.0 eth0: jumbo features [frames: 9194 bytes, tx checksumming: ko]
[    7.409733] r8169 0000:04:00.0 enp4s0: renamed from eth0
[    7.500728] RTL8226B_RTL8221B 2.5Gbps PHY r8169-0-400:00: attached PHY driver (mii_bus:phy_addr=r8169-0-400:00, irq=MAC)
[    7.704189] r8169 0000:04:00.0 enp4s0: Link is Down
[    8.282744] r8169 0000:04:00.0: invalid VPD tag 0x00 (size 0) at offset 0; assume missing optional EEPROM
[   10.382752] r8169 0000:04:00.0 enp4s0: Link is Up - 1Gbps/Full - flow control off
[   10.383737] r8169 0000:04:00.0 enp4s0: Link is Up - 1Gbps/Full - flow control off

I can start virt-manager without any issues, but once I start the windows VM itself... dmesg immediately shows:

[  766.549824] r8169 0000:04:00.0 enp4s0: Link is Down

(nothing else shown in dmesg)

ip link shows #4 (enp4s0) was brought down and #6 (vnet0) is now up

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlp5s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 9c:fc:e8:f5:73:c8 brd ff:ff:ff:ff:ff:ff
3: virbr1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:a3:7b:92 brd ff:ff:ff:ff:ff:ff
5: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 52:54:00:69:e8:6c brd ff:ff:ff:ff:ff:ff
6: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master virbr0 state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether fe:54:00:25:98:7a brd ff:ff:ff:ff:ff:ff

The NIC setup in virt-manager is very basic:
Network Source: Virtual Network 'default' to NAT
Device Model: virtio

<interface type="network">
  <mac address="52:54:00:25:98:7a"/>
  <source network="default"/>
  <model type="virtio"/>
  <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>

Any ideas whats happening here or what I should try so that I can access the internet from both locally or via the VM?

Last edited by JessicaJill (2024-04-22 22:57:11)

Offline

#2 2024-04-22 07:19:41

seth
Member
Registered: 2012-09-03
Posts: 51,739

Re: [SOLVED] VM (GPU Passthrough) stops ethernet connection

Is the nic in the same IOMMU group as the GPU?
https://wiki.archlinux.org/title/PCI_pa … _are_valid

Plugging the latter into a different PCI slot might help with that, but also not possible in case there's only one PEG slot (and the GPU doesn't work in others at all)

Offline

#3 2024-04-22 12:05:14

JessicaJill
Member
Registered: 2022-01-04
Posts: 20

Re: [SOLVED] VM (GPU Passthrough) stops ethernet connection

Its an onboard nic but is in a different IOMMU group (9 below)

❯ Holdtank/GPUPassThru/iommu_group_check.sh
Group 0:	[8086:9bc5] [R] 00:02.0  VGA compatible controller                CometLake-S GT2 [UHD Graphics 630]
Group 1:	[8086:9b43]     00:00.0  Host bridge                              10th Gen Core Processor Host Bridge/DRAM Registers
Group 2:	[8086:1901]     00:01.0  PCI bridge                               6th-10th Gen Core Processor PCIe Controller (x16)
		[1002:1478] [R] 01:00.0  PCI bridge                               Navi 10 XL Upstream Port of PCI Express Switch
		[1002:1479] [R] 02:00.0  PCI bridge                               Navi 10 XL Downstream Port of PCI Express Switch
		[1002:731f] [R] 03:00.0  VGA compatible controller                Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT]
		[1002:ab38]     03:00.1  Audio device                             Navi 10 HDMI Audio
Group 3:	[8086:43ed]     00:14.0  USB controller                           Tiger Lake-H USB 3.2 Gen 2x1 xHCI Host Controller
USB:		[1d6b:0002]		 Bus 001 Device 001                       Linux Foundation 2.0 root hub 
USB:		[8087:0029]		 Bus 001 Device 002                       Intel Corp. AX200 Bluetooth 
USB:		[046d:c53d]		 Bus 001 Device 003                       Logitech, Inc. G631 Keyboard 
USB:		[046d:c547]		 Bus 001 Device 004                       Logitech, Inc. USB Receiver 
USB:		[174c:2074]		 Bus 001 Device 005                       ASMedia Technology Inc. ASM1074 High-Speed hub 
USB:		[26ce:01a2]		 Bus 001 Device 006                       ASRock LED Controller 
USB:		[041e:3255]		 Bus 001 Device 007                       Creative Technology, Ltd Sound BlasterX H6 
USB:		[1d6b:0003]		 Bus 002 Device 001                       Linux Foundation 3.0 root hub 
USB:		[174c:3074]		 Bus 002 Device 002                       ASMedia Technology Inc. ASM1074 SuperSpeed hub 
USB:		[090c:1000]		 Bus 002 Device 003                       Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Flash Drive 
		[8086:43ef]     00:14.2  RAM memory                               Tiger Lake-H Shared SRAM
Group 4:	[8086:43e0]     00:16.0  Communication controller                 Tiger Lake-H Management Engine Interface
Group 5:	[8086:43d2]     00:17.0  SATA controller                          Device 43d2
Group 6:	[8086:43c2] [R] 00:1b.0  PCI bridge                               Device 43c2
Group 7:	[8086:43ba] [R] 00:1c.0  PCI bridge                               Tiger Lake-H PCIe Root Port #3
Group 8:	[8086:4385]     00:1f.0  ISA bridge                               Z590 LPC/eSPI Controller
		[8086:f0c8]     00:1f.3  Audio device                             Device f0c8
		[8086:43a3]     00:1f.4  SMBus                                    Tiger Lake-H SMBus Controller
		[8086:43a4]     00:1f.5  Serial bus controller                    Tiger Lake-H SPI Controller
Group 9:	[10ec:8125] [R] 04:00.0  Ethernet controller                      RTL8125 2.5GbE Controller
Group 10:	[8086:2723] [R] 05:00.0  Network controller                       Wi-Fi 6 AX200

Im going to try to take out my Wifi card later today to see if that help but right now Im at a loss.

Offline

#4 2024-04-22 13:26:57

seth
Member
Registered: 2012-09-03
Posts: 51,739

Re: [SOLVED] VM (GPU Passthrough) stops ethernet connection

r8169 0000:04:00.0 enp4s0: Link is Down

Doesn't explain it absence from "ip a", you seem to bridge the wifi - any reason why you're not doing that w/ the ethernet instead of using (i guess) virtio-win?

Offline

#5 2024-04-22 22:56:25

JessicaJill
Member
Registered: 2022-01-04
Posts: 20

Re: [SOLVED] VM (GPU Passthrough) stops ethernet connection

As usual its something basic... obviously there was a conflict somewhere which caused the Ethernet adapter to drop on my local machine but continue to work on the VM.

I went through every piece of hardware listed in the virt-manager config and I found a PCI device specifically for the NIC... Im not sure when that was added but obviously it cant be configured as a PCI and NIC simultaneously, so I removed the PCI hardware and voila!

Thank you for taking the time to help me Seth!

Offline

Board footer

Powered by FluxBB