Debugging Proxmox Debian VM Network Issues - myomaniac/myomaniaclab GitHub Wiki

Debugging Proxmox Debian VM Network Issues

Overview

This document provides a step-by-step log of the issues encountered while setting up networking for a Debian VM on Proxmox, why they happened, and how they were resolved.


Issue 1: Debian VM Had No Network Interface

Symptoms:

  • Running ip link show inside the VM only displayed lo (loopback), with no eth0 or ensX.
  • The VM was unable to reach the Proxmox host or external networks.

Cause:

  • The Virtio network adapter was present in Proxmox but was not being detected by Debian.
  • The necessary driver (virtio_net) was not initializing the network interface correctly.

Solution:

  1. Verify that the Virtio network device was present:

    lspci | grep -i ethernet
    

    Output confirmed that the Virtio network adapter was present (Red Hat, Inc. Virtio network device).

  2. Manually load the Virtio network module:

    sudo modprobe virtio_net
    

    However, this did not make the interface appear.

  3. Force a PCI bus rescan:

    echo 1 > /sys/bus/pci/rescan
    

    This also did not help, confirming the issue was deeper.


Issue 2: Proxmox VM Was Not Properly Attached to vmbr0

Symptoms:

  • Running brctl show vmbr0 on Proxmox did not list the VM's interface.

Cause:

  • The VM's network interface (net0) was assigned to vmbr0 in Proxmox but was not properly attached.

Solution:

  1. Remove and re-add the network interface in Proxmox:

    qm set 102 -delete net0
    qm set 102 -net0 virtio,bridge=vmbr0
    
  2. Restart the VM:

    qm stop 102
    qm start 102
    
  3. Confirm the VM’s network interface appeared inside Debian:

    ip link show
    

    Success! The interface (ens18) appeared.


Issue 3: No IP Assigned to Network Interface

Symptoms:

  • ens18 was now detected, but it had no IP address.
  • The VM could not communicate with the Proxmox host or the internet.

Cause:

  • DHCP did not automatically assign an IP to the interface.

Solution:

  1. Manually request an IP via DHCP:

    sudo dhclient ens18
    

    Success! The VM was assigned an IP (10.0.0.95).

  2. To make the configuration persistent, we updated /etc/network/interfaces:

    nano /etc/network/interfaces
    

    Added:

    auto ens18
    iface ens18 inet dhcp
    
  3. Restart networking service:

    systemctl restart networking
    

Final Fixes for Persistence

To ensure the network remains functional after reboot:

  1. Ensure the Virtio network module loads at boot:

    echo "virtio_net" >> /etc/modules
    
  2. (Optional) Set a Static IP:

    nano /etc/network/interfaces
    

    Add:

    auto ens18
    iface ens18 inet static
        address 10.0.0.162
        netmask 255.255.255.0
        gateway 10.0.0.1
        dns-nameservers 8.8.8.8 8.8.4.4
    

    Then apply changes:

    systemctl restart networking
    

Summary of Problems & Fixes

Issue Cause Solution
Debian VM had no network Virtio network adapter not initializing Loaded virtio_net module, forced PCI rescan
VM not attached to vmbr0 Proxmox misconfiguration Removed and re-added net0 in Proxmox
No IP assigned DHCP did not request an IP Manually ran dhclient ens18

Final Status: VM networking is fully functional and persistent after reboot! 🚀

⚠️ **GitHub.com Fallback** ⚠️