Problem pct create

Xilmen

Active Member
Mar 30, 2017
26
0
41
34
Hello everybody,

I create my container with the command pct create.

Code:
pct create $CTID local:vztmpl/$Template.tar.gz --cpulimit $CORE --cpuunits 1024 --hostname $NAME --memory $MEMORY --net0 name=eth0,bridge=vmbr0,gw=$GWIP,ip=$IP/24,type=veth --onboot 1 --ostype centos --rootfs $STORAGES:$DiskSize --swap 512'


The problem I encounter is with my hosts file. This is how it is.

Code:
127.0.0.1 localhost LXC_NAME
# --- BEGIN PVE ---
:: 1 localhost.localnet localhost
$IP $NAME.lan $NAME
# --- END PVE ---


And I would like it to be like those created via the interface like:

Code:
127.0.0.1 localhost LXC_NAME
# --- BEGIN PVE ---
:: 1 localhost.localnet localhost
127.0.1.1 $NAME.lan $NAME
# --- END PVE ---


Can you help me ?
 

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!