Ubuntu Server 22.04 LTS - VM Problem

So I installed Ubuntu Server and 3-4 times with different sizes of storage.
Screenshot_20221029_213217
This have happened after every reboot.

What have I done then?

sudo apt update && sudo apt upgrade -y
sudo apt purge cloud-init
sudo apt autoremove
sudo reboot and this was the answer afterwards.
Screenshot_20221029_213217

I started with 10GB, then 20GB and now 30GB with LWM grouping on, and one of 15GB with LWM grouping off.

What should I do? I’m trying to create a virtual machine for my bots, so that I can migrate it and add it to any new installation without having to deal with the hassle of the required installations such as npm, node & pm2, redis-server and a bunch of other applications that I keep forgetting every time I need to flush my computer, moving databases and rewriting the credentials etc. It’s boring and I just want it to work.

Reinstall in VM.

30GB space with LVM grouping OFF.
sudo apt purge cloud-init
sudo apt update && sudo apt upgrade -y
sudo reboot

No error message. I’m now going to clone the shit out of it, before I put anything on it.

@Querzion, I don’t understand the reason for running the following command. Sudo apt purge cloud-init As I understand Ubuntu’s command structure, you want to remove Ubuntu Server Cloud-init. What I don’t understand is why. I suspect removing Ubuntu’s Cloud-init will cause you problems later with ethernet and Wifi support unless I misunderstand what the Cloud-init job’s are.

It has more to do with SSH in my comprehension of it. I don’t want it at all it slows down the whole system boot up. I’m going to have 2 local bots on this vm that connects to discord and spews out some visuals to obs, and I’m going to have two bots that controls a bunch of stuff on two discord servers. That’s about it. I usually only have to reboot one of the bots when I am to stream, because when It doesn’t have any activity it stops working.

I don’t get it why I would need to have cloud init at all for such simple tasks. Going to start the firewall anyway so that there isn’t any communication except for the bots.

By LWM I assume you mean LVM?

On a fresh install of Ubuntu Server 22.04, removing cloud-init also removes ubuntu-server-minimal, so it seems like it’s more-or-less a “required” package these days. cloud-init is fairly innocuous and it mostly disables itself after first boot. I’ve never had a problem with it slowing anything down, so I’m not sure what your complaint is exactly.

If SSH is the problem, why are you choosing to install SSH in the installer? Are you just seeing host key generation? That only happens on the first boot. You’d need to do it anyway to make SSH work (assuming you want it).

Anyway, I typically find that I don’t need cloud-init after first boot in most of my installs. It’s a bit too “magical” for my tastes, so I disable it like so:

sudo touch /etc/cloud/cloud-init.disabled

Hope that helps.

@bambinone @Querzion While I was correct about removing Cloud-init, at least according to @bambinone. Was I wrong about removing Cloud-init causing trouble with Netmanager, which could cause problems with ethernet and WiFi Cards?

NetworkManager isn’t installed by default in Ubuntu Server 22.04, so… :smile: Removing cloud-init and ubuntu-server-minimal (and their dependencies) seems to leave systemd-networkd and netplan intact, which are the important bits. The installer writes out a simple netplan based on how you answered the networking prompts, and it uses the networkd renderer out of the box.

Now that I think about it, if you set up a WiFi connection in the installer that might trigger a dependency on NetworkManager. However, it doesn’t appear that the network-manager and/or wpasupplicant packages require cloud-init and/or ubuntu-server-minimal, so that should still be fine.

To reiterate what I wrote above, though, it doesn’t pass the sniff test to install Ubuntu Server and then do something that results in the ubuntu-server-minimal metapackage getting removed. That’ll lead to future problems down the line, e.g. during the next LTS update. Just leave cloud-init installed and disable it by touching that special file.

To make sure we both were on the same page, I was right. If @Querzion removed Cloud-init, they would have problems in the future, but I was wrong about NetworkManager having anything to do with it.

Thanks for the information from your last post; you just answered a question about why I have had trouble with Ubuntu Server; it’s the question the Ubuntu Server installer asks about how to set up networking. I have been getting around my problem by letting the Ubuntu Server installer set up a shared IP address first; then, when everything is set up on the new system, I modify Netplan for a static Ip address.

1 Like

I usually end up making my own netplan, partition tables, logical volumes, etc. Sometimes I wonder why I even use the installer in the first place. :joy:

1 Like