I am planning to write a tutorial on how to start developing on LXD.
What I have in mind is,
- The general instructions are available at https://github.com/lxc/lxd
- For developing on the client (
lxcexecutable), the easiest is to compile LXD on the desktop system and then invoke ~/go/bin/lxc to run the freshly compiled version. This client would use the existing live LXD installation of the desktop system. This would easily work if LXD comes from the repositories. It is likely to work on LXD as a snap package with the appropriate
- For more involved developing, a KVM VM will be used. I plan to use
multipassand make instructions so that the environment would be easy to replicate with a few commands.
The part that I am missing, is how to initialize LXD in the KVM VM. I manage to compile LXD, but when I run
lxd init, it gets stuck. Specifically,
- I use the instructions at https://github.com/lxc/lxd on 16.04.3. The exception is that I get
gofrom the snap, as the repositories only have
go1.6. That version is too old for LXD and gives a (cryptic) error message when compiling.
- I run
ubuntu@lxd:~$ sudo -E $GOPATH/bin/lxd --group sudo init
WARN[01-30|18:31:44] CGroup memory swap accounting is disabled, swap limits will be ignored.
pscommand shows the following that are stuck there. Should’t
1323 pts/0 S+ 0:00 sudo -E /home/ubuntu/go/bin/lxd --group sudo init
1324 pts/0 Sl+ 0:00 /home/ubuntu/go/bin/lxd --group sudo init
1397 ? Sl 0:00 lxd-bridge-proxy --addr=[fe80::1%lxdbr0]:13128
1413 ? Ss 0:00 /bin/sh -e /usr/lib/lxd/profile-config
1417 ? Sl 0:00 lxc profile device get default eth0 nictype --force-local
- If I press Ctrl+C,
lxdis killed but there are other commands that are spawned. It is difficult to get a clean system and you have to restart the VM.
How should these issues be dealt with, so
~/go/bin/lxd works in KVM?