Host PC has internet connection but virt-man VMs don't.
Hi.
It did work before. Does anyone know a fix? Thanks. Note: I should have mentioned earlier that I upgraded from Debian 10 to 11 instead of doing a clean install. Perhaps that's a cause? |
you need to create a new bridge
I am on opensuse ( KDE) and not on Debian so as to just how you go about it ? i do not know . |
I also use AQEMU and have a FreeBSD VM. It can connect to the internet without issue.
|
Quote:
|
These steps did get internet working again in virt-man, before. I tried them again and it works again.
Code:
sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils libguestfs-tools genisoimage virtinst libosinfo-bin virt-manager Code:
sudo adduser $USER libvirt |
Upon bootup this morn, the internet is again not working in virt-man. :-(
|
Some lines from bootup (perhaps useful?):
Sep 18 12:44:52 mypcname NetworkManager[887]: <info> [1631965492.1979] device (lo): carrier: link connected Sep 18 12:45:10 mypcname kernel: r8169 0000:03:00.0: firmware: failed to load rtl_nic/rtl8168f-1.fw (-2) Sep 18 12:45:10 mypcname kernel: firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware Sep 18 12:45:10 mypcname kernel: r8169 0000:03:00.0: Direct firmware load for rtl_nic/rtl8168f-1.fw failed with error -2 Sep 18 12:45:10 mypcname kernel: r8169 0000:03:00.0: Unable to load firmware rtl_nic/rtl8168f-1.fw (-2) Sep 18 12:45:10 mypcname kernel: RTL8211E Gigabit Ethernet r8169-300:00: attached PHY driver [RTL8211E Gigabit Ethernet] (mii_bus:phy_addr=r8XYZ-300:00, irq=IGNORE) Sep 18 12:45:10 mypcname kernel: r8169 0000:03:00.0 enp3s0: Link is Down Sep 18 12:45:10 mypcname kernel: bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this. |
I again ran this but it's tiresome to have to reboot just to get back the internet in virt-man.
Code:
sudo adduser $USER libvirt && sudo reboot |
It's strange. When I run just the part:
Code:
sudo adduser $USER libvirt Code:
The user LS is already a member of libvirt. What's missing? Perhaps my upgrade from Debian 10 to 11 caused issues with some config files? |
I solved the virt-man issue by going to synaptic and completely removing all 'qemu' and 'virt-man' packages. Then did a reboot, then went through the virt-man setup from here: https://youtu.be/2SdSiJTGKLM
Update: The issue is back. |
1 Attachment(s)
I can't launch a VM when networking is disabled (right click option on Network Manager system tray icon). I get this message [see image attached]. Perhaps that gives a clue?
If I re-enable networking, then I can launch the VM but must do the reboot trick mentioned earlier to actually get the internet working in the VM. On Debian 10, I never had to have networking enabled to launch a VM - there were many times when I just wanted to do some brief task in a VM that didn't require the internet. |
In virt-manager right click on the QEMU/KVM connection to the server, choose Details->Virtual Networks. There you can set up autostart and apply. Any running VM will see the change in the network without rebooting.
|
Quote:
|
I have never had the default network enabled since I started using qemu-kvm. I chose to set the network source on the nic setting in virt-manager (host device eno1 macvtap). Could this be how your was set up? If so, could it be possible that your network adapter changed at some point? Also, I see from one of your post that your logs say that you were having some network setup problem during boot and that you may be missing some firmware. It might help to install or re-install linux-firmware.
|
Quote:
firmware-linux-free firmware-realtek intel-microcode ipxe-qemu ovmf I'll let ye know how it fares. :) |
Alas, reinstalling the firmware did nothing.
|
Quote:
|
Open a terminal on your host machine and type: sudo virsh net-list --all
If it tells you that your default network is inactive type: sudo virsh net-start default To make your default network start at boot type: sudo virsh net-autostart default For more information about using virsh check out the manual page: man virsh Hopefully this will help. |
Quote:
Code:
$ sudo virsh net-list --all Code:
$ sudo virsh net-start default Code:
$ sudo virsh net-autostart default |
I guess you still don't have it working. Well that was all I had to contribute. I see you attached an image of an error message that you got about the spice server not starting. Maybe if you can figure that out that will get you back on track. There are settings in the graphics section of the vm configuration file. Mine is pretty simple. It is default because I have not made any major changes in the way libvirt works. I don't know if there any global or custom settings elsewhere that would affect the operation of the spice server.
This is all there is in mine. <graphics type='spice' autoport='yes'> <listen type='address'/> <image compression='off'/> <gl enable='no' rendernode='/dev/dri/by-path/pci-0000:00:02.0-render'/> </graphics> You can pull this file up by typing: sudo virsh edit vmname |
Quote:
This (sudo adduser $USER libvirt && sudo reboot) still works to temporarily get internet back in Virt-Man. It's all very odd. |
3 Attachment(s)
Quote:
|
I have more in mine too. That was just the graphics section of the file. You are right it is odd that adding the user to the libvirt group and rebooting would temporarily restore the internet to the vm. I am just beginning to learn virtualization with qemu-kvm so I haven't encountered enough issues that would lead to any clues to why you are having these problems. I hope that when you do find the solution that you will post it back here just in case I run into something similar later.
|
Quote:
|
@mredc
After running [sudo adduser $USER libvirt && sudo reboot], I again tried your commands in https://www.linuxquestions.org/quest...ml#post6290486 -- I got the same output even though Virt-Man had internet again [for this session anyway]. :confused: |
It seems like this has finally solved the issue:
Code:
sudo apt install build-essential dkms linux-headers-$(uname -r) |
That's great. I am guessing that means it was a issue with drivers not loading correctly.
|
Quote:
|
Sad to hear that.
So is your host running Bullseye which was a distribution upgrade from Buster? Do you have multiple virtual machines exhibiting the same problem? Virtual machine adapter(s) up (turned on) when networking is failed? |
Quote:
|
So are you saying that if you don't turn your networking off on your host that your virtual machines in virt-manager do start as expected?
|
Quote:
Code:
sudo adduser $USER libvirt && sudo reboot |
To be honest and this is just me thinking out loud. You should only have to run that adduser command once unless it pertains to a different user each time.
But are you saying that you turn on your host internet, run those two commands to add a user to the libvirt group and reboot your host? This then allows you to start your virtual machines which obtain and maintain a persistent network connection? |
Quote:
|
I just tried 'sudo adduser $USER libvirt && sudo reboot' and now that doesn't even get the internet working inside virt-man.
|
I tried that command again. This time I had the virt-man program opened (no vm open). Maybe virt-man needs to be launched and then running that temporary fix command for it to work. 💡
Update: I can confirm this. I did the temp fix command again and forgot to open Virt Man first, the same thing happened. |
I've since installed Debian 11 on a new PC and new drive. At first all seemed fine -- now the issue back. Argh!
|
The usual temporary fix applies like before.
This must narrow down the cause. My old PC had an Intel CPU, this current PC has an AMD CPU. |
I never have this issue with AQEMU or GNOME Boxes - only virt-man. I wonder if there's an old config folder in my hold directory that's causing the issue? Or perhaps something to do with my wireless USB dongle?
|
This isn't too bad now since I recently moved from a HDD to SSD - the bootups are very quick.
I'd still love to know what could be causing this. |
I ran this:
Code:
sudo systemctl status libvirtd.service Code:
no servers found in /etc/resolv.conf, will retry |
You need to install iptables for it to work without having to manually keep setting it each time, its a dependency, and from reading your posts, you haven't actually added this;
sudo apt-get install iptables I had this issue myself with KVM and scratched my head for while ;) More information on virtual networking here; https://wiki.libvirt.org/page/VirtualNetworking |
Quote:
|
no servers found in /etc/resolv.conf, will retry
I use libvirt and in that file is just the nameservers IP, i.e. my router IPv4 and IPv6 and the 'domain'..(only router IP listed below of course) # Generated by NetworkManager nameserver 192.168.1.1 Do you use virt-manager or the CLI to admin your VM's? virt-manager does give helpful error messages.. |
Quote:
In /etc/resolv.conf, I have: Code:
# Generated by NetworkManager Code:
virt-manager |
Taken from the KVM docs here...
https://wiki.debian.org/KVM#Libvirt_default_network If you use libvirt to manage your VMs, libvirt provides a NATed bridged network named "default" that allows the host to communicate with the guests. This network is available only for the system domains (that is VMs created by root or using the qemu:///system connection URI). VMs using this network end up in 192.168.122.1/24 and DHCP is provided to them via dnsmasq. This network is not automatically started. To start it use: virsh --connect=qemu:///system net-start default To make the default network start automatically use: virsh --connect=qemu:///system net-autostart default |
Hi Fred.
Code:
virsh --connect=qemu:///system net-start default Code:
error: Failed to start network default Code:
virsh --connect=qemu:///system net-autostart default Code:
Network default marked as autostarted |
I would probably remove virt-manager, reboot, and then try installing it again, it sounds like something is amiss with it.. and at least then you know it should be 'default'
|
Quote:
|
After starting the PC this morn, I tried virt-man again. The issue is back. :banghead:
|
All times are GMT -5. The time now is 01:48 PM. |