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

Olive Kingdom Qiu

New Member
Jan 25, 2024
7
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