Is it possible to lock an instance?

I cant open a new topic. So i’ll ask it here :slight_smile:

I created a new VM template with Windows and sysprep. Is it possible to lock a VM or container. Sounds strange: I don’t want the VM to be able to start. Is this possible?

It means when you reboot your host vm or container do not start, change boot.autostart properties of vm/container can solve the problem if I can clearly understand the question.
Regards.

Moved to a new topic.

I have the same question. My use case is that I have backup/standby containers created with copy --refresh on the same L2 network as the sources and I would like to make sure noone starts them by accident as they will have the same MAC address as the sources which wreaks all kinds of havoc

One idea I had is to remove or rename /sbin/init
another idea is to set init commmand to something bogus

lxc config set name raw.lxc lxc.init.cmd=/bin/false

1 Like

Sounds like we could do with adding an instance security.protection.start setting. Please can you open an issue. Thanks

1 Like

Yep, check proxmox VM templates for example. I want to clone the VM template after sysprep. Annoying to start the VM with lxc start --all by accident for ex.

https://github.com/canonical/lxd/issues/12110