I started a new VM with:
lxc launch images:debian/11 kerneltest2 --vm
Now I have two problems:
- Sometimes the LXD-agent is not available:
Note: Is maybe already fixed in the images, only apply if you experience the problem!
Workaround is described here:
Error: Failed to connect to lxd-agent
This appears (very often but not always) when I restart a vm and try to connect to it via:
lxc exec kerneltest2 bash
When it occurs, I can’t connect via bash anymore (no matter how often I restart the vm), I need to restart the host.
- first start of vm is working most of the time
- it seems to occur less often, when I wait longer between stopping and starting the vm again
- I can always still connect via “lxc console”
Something that could be related to the problem is this error (shown in the console when stopping the vm):
[FAILED] Failed unmounting /run/lxd_config/9p
But this message also occurs when the bash command is still working.
Additional problem is:
I can’t connect as root, because “lxc console” wants a root password, which I don’t have (I will try to (re)set the password).
System Info (Host):
OS: Debian Testing
LXD: 4.0.1 (snap)
- I can’t activate shiftfs for lxd inside the VM:
This is a special case of course, but I wanted to test some kernel modules, so I installed shiftfs via my dkms script (seemed to work well) and then I wanted to activate shiftfs in lxd.
I ran the commands:
sudo snap set lxd shiftfs.enable=true
sudo systemctl reload snap.lxd.daemon
But “lxc info” still shows (also after restarts and retrys):
For others reading this, the problem was that I installed unsigned kernel modules via dkms.
The kernel modules (i.e. shiftfs) were then blocked by secure boot (which is enabled by default in many VM images).
The solution is to disable Secure boot in the VMs.
You can do this with following command:
lxc config set [name of vm] security.secureboot=false