On 5/7/24 13:13, jeremy ardley wrote:


On 5/7/24 10:30, Felix Miata wrote:
I think there are more than one. One thing is to check what is enabled, then
disable or uninstall whatever owns the unit(s):

    systemctl list-unit-files | egrep 'net|dhcp'

Do the same with whatever "manages" /etc/resolv.conf, and create a regular file of
your own design.

I don't use VMs, but I did several hours ago instruct several hours ago using systemd-network to setup static IP service for a *buntu user who couldn't get
netplan sorted:

There seems to be some misunderstanding here.

dhcpd services for a vm are provided by the host running the vm. Depending on the vm software e.g. KVM/QEMU or VMWare Workstation there will be different mechanisms to configure or disable this service to the vm client.

However it is not necessary if you configure the vm client using the systemd networking client service - as the OP has done.

More relevant is explicitly disabling any competing network clients on the vm that may affect things like DNS.

I recommend :

sudo systemctl disable NetworkManager.service
sudo systemctl stop NetworkManager.service
sudo systemctl mask NetworkManager.service

sudo systemctl disable systemd-networkd
sudo systemctl stop systemd-networkd
sudo systemctl mask systemd-networkd

I reiterate that if DNS resolution is needed it needs to be set in /etc/hosts and/or in /etc/resolv.conf

(I also use systemd-networkd in preference to the other two types of client networking)

One further point is that the interface name seen by a client vm may not be eth0 and could be one of many 'predictable' interface names e.g enp1s0

I guess I'm 'lucky' that I have set up literally hundreds of vms in the past few months using linux and windows hosts and clients including debian, fedora, centos, ubuntu, RHEL, windows server, windows workstation, and hosting using VMWare Workstation, esxi hosts, KVM/QEMU

One obnoxious thing about most of the linuxes is the reliance on NetworkManager which may be fine for a beginner in a simple scenario such as a laptop but can be extremely unhelpful in many scenarios. (As can be VMWare Workstation)

Reply via email to