Cloud-init:Network Stage hangs :(

SYSTEM INFORMATION
OS type and version Ubuntu 20.04.6 LTS
Webmin version 2.111
Virtualmin version 7.10.0
Webserver version Apache version 2.4.41
Related packages maybe cloud-init

I have had very little trouble with this amazing system and also I am not sure its even related to Virtualmin, but maybe the Ubuntu being an older version 22.04 - but there is no way to upgrade from virtualmin, so I wont.

My problem is that when my server reboots now it freezes and never starts up when trying to start the network adapter. It freezes after these lines in the boot:
[ OK ] Finished cloud-init: Local Stage (pre-network).
Starting cloud-init: Network Stage


This is a huge problem as I am not often close to my server.

When I try and reboot in Ubuntu recovery mode I can see the adapter changes name from eth0 to eno1 and when manual choosing to resume normal ubuntu login it starts up, gets the right static IP address and everything works
 until next reboot

My question is: How do I get around this? Why cant I just have the name eno1 for good so my virtualmin server can boot normally if the power goes off - and not hang like it does now.

Hope someone has had similar issue and fixed it - next step might be removing harddrive to a new computer, but I am not sure that will fix anything so I might need a full backup and restore it to a new installation of virtualmin :frowning:
Hope someone has a quickfix for this “hanging” with the network interface. Thank you so much.

1 Like

This looks like an OS issue not a virtualmin issue as the OS fails before webmin/virtualmin is loaded. As this is a local computer not a vps have you installed anything on the pc that could adjust the network ? Also what happens if you boot in recovery mode does the NIC change names ?

1 Like

The NIC changes name from eth0 to eno1 when I boot in recovery mode.

I am not sure what to install on the OS because I am afraid it will ruin my Virtualmin installation and me and my customers are depending on mails and webservers running.

Is the working interface listed in the interface?

1 Like

Yes With the new name. Everything works when starting to boot into recovery mode and choosing to continue normal boot.
That means I have to be at the computer to get the computer booted.
If I dont choose recovery mode at the beginning the system freezes - probably because a normal boot does not change the NIC name - only when trying recover.

I’ve never noticed/seen this before. Seems these things alias and yours is failing to alias for some reason.

root@main:~# ip a

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/etherxx:xx:99:8b:58:69 brd ff:ff:ff:ff:ff:ff
    altname enp2s0

If you’re talking about a virtual machine at a hosting provider, you shouldn’t be fiddling with the network configuration. It can only ever break things.

cloud-init is usually used by hosting providers to configure the system, sometimes for network, sometimes for other stuff.

You can look at the configuration for it to try to figure out what it’s doing, but I wouldn’t recommend you change anything there.

A couple of other people have had similar problems recently, some think installing Virtualmin triggers the issue, but I can’t figure out how it could (we don’t touch cloud-init and we don’t mess with network configuration in the general case
the installer might set the hostname, if your server didn’t already have a fully qualified domain name when you started the installation).

But, you can’t change your network configuration in a virtual machine on a network managed by someone else. It can only break things.

I have run Virtualmin for years without problems and this just started recently.
I run it on my own server with an Ubuntu 20.04.6 LTS under the Virtualmin.

This is how mine looks:

root@mail:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 1c:69:7a:6f:a5:7b brd ff:ff:ff:ff:ff:ff
inet 192.168.0.20/24 scope global eno1
valid_lft forever preferred_lft forever
inet6 fe80::1e69:7aff:fe6f:a57b/64 scope link
valid_lft forever preferred_lft forever
3: wlp0s20f3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 34:2e:b7:9e:bc:c7 brd ff:ff:ff:ff:ff:ff
root@mail:~#

earlier it was called eth0 and not eno1 - eno1 is only when I boot up in recovery mode to later in the recovery menu to continue booting normal. When booting from scratch without choosing recovery mode the system hangs when trying to setup the NIC.

Sounds like it is something he has his hands on because he intervenes in the boot process.

But honestly. This is a question for the Ubuntu folks. Why isn’t the alias name working during normal bootup?

But the real answer? If Ubuntu broke something on an update, it probably is time to migrate to a new installation. Gotta do it sometime. :wink:

Ilia believes it’s a bug in the latest cloud-init package on Ubuntu. If that’s so, then the update that happens as part of the Virtualmin install could have triggered it, if you weren’t already up to date, but Virtualmin wouldn’t be the cause of it.

Try downgrading cloud-init to an earlier version and hold it at that version with apt-mark hold cloud-init unless and until Ubuntu fixes the problem.

Let us know if that sorts it. I’m not super confident it’s the cause, but I am reasonably confident it’s not our bug. We don’t mess with network in the general case
you’d have to be poking around in network configuration pages or configuring Virtualmin to manage interfaces for multiple IPs, and hopefully you’d know that will effect network configuration (which shouldn’t be messed with by end users in a web hosting virtual machine).

Joe, I would love for you to let me know exactly how to downgrade cloud-init.

I have just tried changing my 00-installer-config.yaml to the following:

network:
version: 2
ethernets:
eth0:
addresses: [‘192.168.0.20/24’]
gateway4: 192.168.0.1
nameservers:
addresses: [4.2.2.2, 8.8.8.8, 127.0.0.1]
match:
macaddress:
set-name: eth0

That sorted out the name for my NIC - also under recovery but still the system hangs when trying to boot normally.

Hope you can show me the commands to downgrade cloud-init from version 24.4 to version 24.3 and also if the command after the downgrade is just “apt-mark hold cloud-init” and also how to stop the hold


Thank you so much Joe :slight_smile:

After I just told you that messing about with the cloud-init or network configuration was almost certainly a bad idea?

Yes, sorry. But I am sitting next to my server now, so can always change the configuration back :wink:

Ah, different situation entirely.

Downgrading cloud-init is the same as downgrading any package on Debian/Ubuntu.

Find the versions available:

apt-cache madison cloud-init

Install an older version than the current one:

apt install cloud-init=<someversion>

I can confirm that reverting to cloud-init version 23 resolves the problem:

apt install cloud-init=23.1.2-0ubuntu0~20.04.2
2 Likes

Same here, thank you for your help Joe :slight_smile:

Yes thank you @Joe and @Ilia for the help. After the update and rebooting server this morning I had same issue and downgrading cloud-init solved the issue.

Edit to add (1/15/2025):

They are discussing this issue over at Cloud-ini Github

I was certain that it was Virtualmin’s issue, because that’s the only configuration I’ve changed related to networking
 but yeah, the new ‘cloud-init’ package is broken. On all of my servers. cheers.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.