[TUTORIAL] lxc config common hook script for start-host,do not work

Olive Kingdom Qiu

New Member
Jan 25, 2024
5
0
1
proxmox version 7.4.1


execute command:
echo "lxc.hook.start-host = /usr/share/lxc/hooks/test" >/usr/share/lxc/config/common.conf.d/03-test.conf


under /usr/share/lxc/hooks/
touch test

test file content below :
Code:
#!/bin/bash

vmid=$1
output=$(lxc-info -n "$vmid" -iH )

echo "$output "
echo " testing \n $vmid  \n host script ..."


exit 0

chmod +x test

finally when exec command :
pct start 101 --debug
terminal has no content ,and the start job never stopped !


how can i use the script ?
 
Last edited:
figure out by other way, i get the contain ip by dhclient , with the common scripts :dhclient and dhclient-script. later do some nat network for my business
 

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!