Firecracker microVM: how to execute a script file when a Firecracker microVM startup?

557 Views Asked by At

I went through Get Start Guide and api_request_doc to find a way to execute a script when start a microVM? But there is not way to do it.

Is there a way to achieve it? I want to run some script when a vm startup or execute a script without login.

1

There are 1 best solutions below

0
On

So, far firecracker has not provided any support to start a script on startup.

You can use system daemons like openrc (for alpine based) and systemd to start the script on the startup.

to start script using systemd on startup, check https://linuxconfig.org/how-to-automatically-execute-shell-script-at-startup-boot-on-systemd-linux