Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Artix VM in virt-manager has no network access (Read 365 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Artix VM in virt-manager has no network access

After I create a new VM in QEMU using virt-manager I have no network access. I've tried NAT and Bridged but the result is the same.

The host machine has network access as well as a second Ubuntu based VM.

I'm pretty sure this is something I need to configure that isn't listed in the installation guide or misconfigured in the live-cd.

I'm using the latest artix-base-openrc iso file: https://iso.artixlinux.org/iso/artix-base-openrc-20240823-x86_64.iso

Any ideas for what I can do?

Re: Artix VM in virt-manager has no network access

Reply #1
I figured it out, It seems I MUST start dhcpcd on the eth0 interface.

I'm not sure why this isn't listed as a step in the install guide: https://wiki.artixlinux.org/Main/Installation#Connect_to_the_Internet

funny enough I seem to have known this in the past but have forgotten it. I listed this in some steps using a live CD long ago: https://forum.artixlinux.org/index.php/topic,4622.msg29641.html#msg29641

Re: Artix VM in virt-manager has no network access

Reply #2
It's probably related to firewall rules, which dhcpcd takes care of for you.

artist

Re: Artix VM in virt-manager has no network access

Reply #3
I figured it out, It seems I MUST start dhcpcd on the eth0 interface.
.........
strange I have artix-dinit and artix-runit (plus others) in a virt-manager setup. 

The vms are based on artix xfce isos with connman using automatic dhcp derived setups on eth0.

The network device is the default virtio nat. I think I had to add firewall_backend = "iptables" in /etc/libvirt/network.conf to get the networking going. So far as I know dnsmasq is used to start dhcp on the virbr0 bridge.

 

Re: Artix VM in virt-manager has no network access

Reply #4
I figured it out, It seems I MUST start dhcpcd on the eth0 interface.
.........
strange I have artix-dinit and artix-runit (plus others) in a virt-manager setup. 

The vms are based on artix xfce isos with connman using automatic dhcp derived setups on eth0.

The network device is the default virtio nat. I think I had to add firewall_backend = "iptables" in /etc/libvirt/network.conf to get the networking going. So far as I know dnsmasq is used to start dhcp on the virbr0 bridge.

I don't think this is necessarily a problem with it being in a virtual machine. In the post I linked to earlier: https://forum.artixlinux.org/index.php/topic,4622.msg29641.html#msg29641 I had to do this step on real hardware as well using live CD. 

Re: Artix VM in virt-manager has no network access

Reply #5
I think maybe the dhcpcd service might just need to be added to the default run-level on OpenRC?
on my host machine it is.

Code: [Select]
$ rc-update --all | grep dhcpcd
               dhcpcd |      default

but on the live image it is not:
Code: [Select]
$ rc-update --all | grep dhcpcd
$

It does exist in the /etc/init.d folder
Code: [Select]
$ ls -la /etc/init.d | grep dhcpcd
-rwxr-xr-x   1 root root   389 May  5  2021 dhcpcd

Re: Artix VM in virt-manager has no network access

Reply #6
.........
I don't think this is necessarily a problem with it being in a virtual machine. In the post I linked to earlier: https://forum.artixlinux.org/index.php/topic,4622.msg29641.html#msg29641 I had to do this step on real hardware as well using live CD. 
On the host I run NetworkManager and that is connected to a router which is doing dhcp on the host network so perhaps I don't need a dhcp on the host.

I have hosts: ... libvirt .... in the nsswitch.conf so I can see the various vms by by dns.

Re: Artix VM in virt-manager has no network access

Reply #7
My guess would be that the guide is aimed at users who have installed on bare metal not a VM.
Getting a network connection on a VM depends on which brand of VM you are using to some degree.

In your first post you mention trying to use a bridge but your ip a output does not show a bridge?
You need a bridge on the host to connect a VM guest via a bridge.

Re: Artix VM in virt-manager has no network access

Reply #8
I'm not sure why this isn't listed as a step in the install guide: https://wiki.artixlinux.org/Main/Installation#Connect_to_the_Internet
My guess would be that the guide is aimed at users who have installed on bare metal not a VM.
Getting a network connection on a VM depends on which brand of VM you are using to some degree.

In your first post you mention trying to use a bridge but your ip a output does not show a bridge?
You need a bridge on the host to connect a VM guest via a bridge.


I remember having to do this step on real hardware as well when installing on my Framework laptop using the OpenRC live iso image.

Re: Artix VM in virt-manager has no network access

Reply #9
I figured it out, It seems I MUST start dhcpcd on the eth0 interface.
I'm not sure why this isn't listed as a step in the install guide: https://wiki.artixlinux.org/Main/Installation#Connect_to_the_Internet
It is, you were looking at the wrong section. Wired connection is autoconfigured ONLY in live environment, base install expects you to configure it yourself: https://wiki.artixlinux.org/Main/Installation#Network_configuration

Re: Artix VM in virt-manager has no network access

Reply #10
I figured it out, It seems I MUST start dhcpcd on the eth0 interface.
I'm not sure why this isn't listed as a step in the install guide: https://wiki.artixlinux.org/Main/Installation#Connect_to_the_Internet
It is, you were looking at the wrong section. Wired connection is autoconfigured ONLY in live environment, base install expects you to configure it yourself: https://wiki.artixlinux.org/Main/Installation#Network_configuration

I do see it detailed in the Network Configuration section you linked: https://wiki.artixlinux.org/Main/Installation#Network_configuration
However this is far after the first time the user must connect to the internet for starting ntp and downloading the base/base-devel packages. The first connection to the internet happens here: https://wiki.artixlinux.org/Main/Installation#Connect_to_the_Internet with the ping command. This fails on the OpenRC live cd unless you start dhcpcd. I think the live cd is missing having dhcpcd in the default run level for the live cd installation, or at least an small note should be added telling people to start it.

Re: Artix VM in virt-manager has no network access

Reply #11
This fails on the OpenRC live cd unless you start dhcpcd.
I'm not doubting you, but it's puzzling nonetheless, because the base-openrc is the first ISO I personally tested and installed without issues. It was in virtualbox though, this might be some QEMU thing. OpenRC by default uses dhcp to bring up wired interfaces.