lxc / go-lxc

Go bindings for liblxc
https://linuxcontainers.org/lxc
Other
430 stars 76 forks source link

How to create new virtual machine? #165

Closed Gictorbit closed 2 years ago

Gictorbit commented 2 years ago

Since lxc supports virtual machines as well as containers, is it possible to create a new vm using vm images?

stgraber commented 2 years ago

This is the go-lxc repo which is the binding for the low-level liblxc library. That library only handles containers. What you're referring to is LXD's virtual machine support which uses QEMU to run virtual machines.

To do so, you need a running LXD daemon, then to drive it from Go, you can use the Go client for LXD (https://pkg.go.dev/github.com/lxc/lxd/client)

Gictorbit commented 2 years ago

Oh I see, thank you for your quick reply