Xin
Xin

Reputation: 75

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

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.

Upvotes: 1

Views: 786

Answers (1)

Karthik Nedunchezhiyan
Karthik Nedunchezhiyan

Reputation: 500

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

Upvotes: 1

Related Questions