If you need dhclient
spesific interface every VM booting you can try this workaround
for Example spesific interface on this workaround are ens18
- Create this script
sudo nano /etc/init.d/dhclient-ens18
#!/bin/bash
### BEGIN INIT INFO
# Provides: dhclient-ens18
# Required-Start: $network $local_fs
# Required-Stop: $network $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Run dhclient on ens18
# Description: Run dhclient on interface ens18 to obtain an IP address
### END INIT INFO
case "$1" in
start)
/sbin/dhclient ens18
;;
stop)
# Add any stop actions here, if necessary
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
sudo chmod +x /etc/init.d/dhclient-ens18
sudo update-rc.d dhclient-ens18 defaults