Stop LXC container changing the container hostname

Aug 30, 2023
88
12
8
Luxembourg
How can I stop LXC changing the changing the container's hostname to that of the container?

My preference is for the label you see in the console to be just the name e.g. 101 (FRED), but the container or VM the hostname to be fred.mydomain.com but when I do this LXC changes it back.

This works for VMs but I can't see how to stop the hostname in the container being changed.
 
I tried setting it to unmanaged, and it still changes it

Code:
arch: amd64
cores: 2
features: nesting=1
hostname: RALPH
memory: 1024
nameserver: 192.168.1.1
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.1.1,hwaddr=BC:24:11:5C:32:75,ip=192.168.1.9/24,type=veth
ostype: unmanaged
rootfs: local-zfs:subvol-102-disk-0,size=16G
swap: 1024
tags: container;linux
timezone: Europe/Luxembourg
unprivileged: 1
 
I think you will need to reset the hostname manually inside the container after making the changes. Other than that I'm out of ideas.
Tried that twice and rebooted after I changed it to unmanaged in case it was something like that, but still the same.

Do you think I should report it as a bug, especially if it's still changing things when set to unmanaged?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!