Issue with /sys being read-only

1 reply
pjhunter
29 posts

Folks,

Been doing some work on a Ubuntu antlet and updating the .yaml file.  After finishing, I attempt a "sudo netplan apply" command but it fails with an error message:

eth0: Failed to write 'change' to '/sys/devices/virtual/net/eth0/uevent': Read-only file system

I did some research (using CoPilot) who suggested that I could adjust the container's configuration file to allow write access to /sys.  Specifically I should make a change to the <container-name>.conf file in either the /etc/lxc/ directory or the /var/lib/lxc/ directory. Unfortunately there doesn't seem to be directories at those locations on the Antsle.

If found, the suggestion was to add a line:

lxc.mount.entry = sys sysfs rw 0 0

then execute the following two commands:

lxc-stop -n <container-name>

lxc-start -n <container-name>

I'm not entirely sure what <container-name> refers to.  Either "lxc" or "ubuntu" (the antlet's name)

Any suggestions/insights?

Antsle TeamStaff
32 posts

That error is expected inside a container antlet: LXC antlets can't write to /sys, so netplan apply can't reconfigure the interface live. You don't need to change the container configuration on the host. Save your edited netplan .yaml file and restart the antlet (or restart systemd-networkd inside it), and the new settings are applied at startup.

— Antsle Team

Log in to reply. New here? It takes a minute.