Quote from
Mario on April 9, 2021, 4:59 pm
Here is a work around for the antlets not autostarting on the Nano.
Create a script which will start the antlets. The command to start a specific antlet is
virsh start ANTLET_NAME
or
virsh -c lxc:/// ANTLET_NAME
Use the '-c lxc:///' option for lxc antlets
So if I had a KVM antlet named 'gitlab' and two LXC antlets named 'webserver-1' and 'webserver-2' and wanted these three to autostart on a reboot...
Open a new file for editing. If you are not familiar with using the vim editor, install the 'nano' editor first with `yum install nano`
nano /root/autostart-antlets
You can name the file what ever you like.
Then add the following contents
#!/bin/bash
sleep 30
virsh start gitlab
virsh -c lxc:/// start webserver-1
virsh -c lxc:/// start webserver-2
Make the file executable
chmod +x /root/autostart-antlets
Edit the crontab to run the script at reboot
EDITOR=nano crontab -e
Add the following line to the file
@reboot /root/autostart-antlets
Thats it.
Edit the 'autostart-antlets' file as needed to add or remove antlets for autostart
Here is a work around for the antlets not autostarting on the Nano.
Create a script which will start the antlets. The command to start a specific antlet is
virsh start ANTLET_NAME
or
virsh -c lxc:/// ANTLET_NAME
Use the '-c lxc:///' option for lxc antlets
So if I had a KVM antlet named 'gitlab' and two LXC antlets named 'webserver-1' and 'webserver-2' and wanted these three to autostart on a reboot...
Open a new file for editing. If you are not familiar with using the vim editor, install the 'nano' editor first with `yum install nano`
nano /root/autostart-antlets
You can name the file what ever you like.
Then add the following contents
#!/bin/bash
sleep 30
virsh start gitlab
virsh -c lxc:/// start webserver-1
virsh -c lxc:/// start webserver-2
Make the file executable
chmod +x /root/autostart-antlets
Edit the crontab to run the script at reboot
EDITOR=nano crontab -e
Add the following line to the file
@reboot /root/autostart-antlets
Thats it.
Edit the 'autostart-antlets' file as needed to add or remove antlets for autostart
spollock has reacted to this post.