Re: [lxc-users] How properly to find what consumes memory inside the container.
October 8, 2017 8:00 PM, "Ivan Kurnosov" <zer...@zerkms.ru (mailto:%22Ivan%20Kurnosov%22%20<zer...@zerkms.ru>)> wrote: So the question, how to monitor the memory consumption from the container reliably? And why does `free` count caches as used memory inside container? With best regards, Ivan Kurnosov I don't know on what version you are, but I watch memory and cpu consumption on LXD 2.18 with the command lxc info Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] lxc copy without snapshots?
On 13-09-17 19:09, Ingo Baab wrote: Hello Sjoerd, thank you for the answer, but I get (lxc --version says "2.0.10"): Usage: lxc copy [:][/] [[:]] [--ephemeral|e] Copy containers within or in between LXD instances. Options: --debug (= false) Enable debug mode -e, --ephemeral (= false) Ephemeral container --force-local (= false) Force using the local unix socket --no-alias (= false) Ignore aliases when determining what command to run --verbose (= false) Enable verbose mode I am on Ubuntu 16.04.3 LTS, with LXD 2.0.10 Any Ideas? Ingo Hmm yes I am on 2.17 (lxd ppa) so different indeed. Then what Renato suggested might be the solution. Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] lxc copy without snapshots?
On 13-09-17 16:07, Ingo Baab wrote: Hi All, how can I copy a container between LXD instances without all its snapshots? I read at https://insights.ubuntu.com/2016/03/22/lxd-2-0-your-first-lxd-container/ "The destination container will be identical in every way to the source one, except it won’t have any snapshot and volatile keys (MAC address) will be reset." But my invoked command "lxc copy remotebox:ubuntu16 ubuntu16" did copy all snapshots, which took a long time.. - both of my LXD servers are using ZFS. Have you tried with --container-only as well? If you would just give lxc copy you'll see the options you can pass and for --container-only it describes: --container-only (= false) Copy the container without its snapshots Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] ?= =?utf-8?q? "lxc network create" error
On 01-08-17 11:40, Tomasz Chmielewski wrote: On Tuesday, August 01, 2017 18:04 JST, Sjoerd <sjo...@sjomar.eu> wrote: On 30-07-17 17:15, Tomasz Chmielewski wrote: Bug or a feature? # lxc network create dev error: Failed to run: ip link add dev type bridge: Error: either "dev" is duplicate, or "bridge" is a garbage. # lxc network create devel Network devel created I vote for feature, since dev is most likely a reserved word, since it's short for device in routing terms. Unless someone has i.e. "prod" and "dev" environments. Unrelate imho. In this case you're trying to create a network, which implies routing commands under the hood, so than I find it logical that dev can't be used as name. i.e. setting routing can be done like : ip route add 192.168.10.0/24 via 10.2.2.1 dev eth0 But that's a different command. Yes, but as stated above...you're creating a network device, which needs routing applied. So I can imagine (but for details the developers might be better to explain), that lxc (a front-end) will use the ip route command under the hood to apply the IP address/routing like : ip route add 192.168.1.0/24 dev lxdbr1. Just take a look at the output of "ip route list" ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] "lxc network create" error
On 30-07-17 17:15, Tomasz Chmielewski wrote: Bug or a feature? # lxc network create dev error: Failed to run: ip link add dev type bridge: Error: either "dev" is duplicate, or "bridge" is a garbage. # lxc network create devel Network devel created I vote for feature, since dev is most likely a reserved word, since it's short for device in routing terms. i.e. setting routing can be done like : ip route add 192.168.10.0/24 via 10.2.2.1 dev eth0 So in you-re case the command would end like : dev dev ...I would be confused by that as well ;) ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] How to run GUI apps in an LXD container (with graphics acceleration)
May 2, 2017 1:19 PM, "Simos Xenitellis" <simos.li...@googlemail.com> wrote: > Hi All! > > I wrote the following on how to run GUI apps in an LXD container, > https://blog.simos.info/how-to-run-wine-graphics-accelerated-in-an-lxd-container-on-ubuntu > The common case is when we run already Ubuntu desktop and we want to > get a GUI app > to run in a container and the window to appear in the host's X server. > > I made some effort to minimize the requirements and in my case, I did > not even have to add the "gpu" device in LXC. > I tried these with LXC 2.13. > > It would be great if you could try the instructions as well, and > report if it works for you. > As a testing app, you can use "glxgears". > Thanks for the HOW-To, but why would you want to do: lxc exec wine-games -- sudo --login --user ubuntu ubuntu@wine-games:~$ sudo apt update ubuntu@wine-games:~$ sudo apt install x11-apps ubuntu@wine-games:~$ sudo apt install mesa-utils ubuntu@wine-games:~$ exit Sounds silly to me to go from a root shell to change to an user to execute root commands via sudo? Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] LXD firewall container?
As a little addition to this: has anyone being successfully able to get logging (-j LOG) to work with iptables in a container? In my container nothing gets logged, but iptables does do its job. Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] lxc config device add
April 18, 2017 1:28 PM, "Gabriel Marais" <gabriel.j.mar...@gmail.com> wrote: > Hi Guys > > I added a block device to a container through the command > > lxc config device add vmh01-db-master-01 storage disk > path=/var/lib/mysql source=/mnt/db-master-01-varlibmysql/ > > On the container:- > /dev/mapper/3600a098000a2f55303fe58f63589-part1 50G 52M 47G > 1% /var/lib/mysql > > On my host:-= > /dev/mapper/3600a098000a2f55303fe58f63589-part1 > 50G 52M 47G 1% /mnt/db-master-01-varlibmysql > > The permissions/owner in the container looks like this: > drwxr-xr-x 3 nobody nogroup 4096 Apr 18 09:02 mysql > > I am unable to change permissions or modify the user/group > > root@vmh01-db-master-01 [11:24:22] :~# chown root:root /var/lib/mysql > chown: changing ownership of '/var/lib/mysql': Operation not permitted > > I was trying to mount a block device where my mysql data would live. > How do I go about changing the permissions/ownership? I guess the easiest is to change the uid/guid on the host to match the desired uid/gid in the container. Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] DHCP or static ip address?
On 04-03-17 12:07, Yuri Kanivetsky wrote: Which way is better? Can it be any simpler? Is there any better way? Can you explain how to make use of dhcp? Without using lxd if possible. Meanwhile, I'm going to look into making CentOS work. I just installed dnsmasq on the (ubuntu 16.04) host and use it as dhcp (and dns) server. Define a dhcp range in /etc/dnsmasq.conf : dhcp-range=10.0.0.100,10.0.0.200,24h And a fixed ip like: dhcp-host=,10.0.0.11,24h where hostname is by default the container name Cheer, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] migrated to 2.9 but container gives "error: No storage pool specified"
On 18-02-17 21:10, Stéphane Graber wrote: On Sat, Feb 18, 2017 at 08:33:12PM +0100, Sjoerd wrote: On 18-02-17 20:18, Stéphane Graber wrote: Copy between varying LXD versions seems to not have been as tested as it should have been... We'll look into this next week and get it sorted out. Until then, assuming your storage pool is called "default" (see "lxc storage list"): lxc config device set vpn root pool default That should fix the pool issue you got. Thanks for the quick response, but sadly I get the same error: # lxc config device set vpn root pool default error: No storage pool specified. Hmm, that's more annoying than I thought it'd be... Do you know if your container uses any profile? yes. With the name priv, but can't edit this profile since it's in use :( If it does, then chances are that you can fix the situation by adding the root device to the profile. lxc profile device add PROFILE root disk path=/ pool=default No joy: # lxc profile device add priv root disk path=/ pool=default error: Cannot change root disk device of a profile if containers are still using it. If I try to edit it with "lxc profile edit priv" I get the same error. I'll try to move the working container back to the other host tomorrow and see if I then can clean the profile up by removing the lines following "used by:". Editing the container config doesn't work either. Maybe moving/copying all working containers to the other host again, start from scratch again (and checking the profiles before transferring) and transfer back might be faster ;) If it tells you that you already have a "disk" device in the profile, then just add the missing pool property to it: lxc profile device set PROFILE root pool default Anyway thanks for your help so far... Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] migrated to 2.9 but container gives "error: No storage pool specified"
On 18-02-17 20:18, Stéphane Graber wrote: Copy between varying LXD versions seems to not have been as tested as it should have been... We'll look into this next week and get it sorted out. Until then, assuming your storage pool is called "default" (see "lxc storage list"): lxc config device set vpn root pool default That should fix the pool issue you got. Thanks for the quick response, but sadly I get the same error: # lxc config device set vpn root pool default error: No storage pool specified. Output of "lxc storage list" : +-++---+-+ | NAME | DRIVER |SOURCE | USED BY | +-++---+-+ | default | zfs| data/asterix/lxd/data | 12 | +-++---+-+ The weird thing is that I can't find anything related to it in the /var/lib/lxd directory and beyond. It only seems to exist as an entry in the lxd database. Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
[lxc-users] migrated to 2.9 but container gives "error: No storage pool specified"
I just migrated from lxd 2.8 to 2.9, but something screwed up. Couldn't figure out what, but needed it up and running again, so destroyed al zfs datasets and started clean. So far so good. Then I started to move containers from another (working) LXD host to the fresh one, but it gave me the error "error: No storage pool specified" and now is stuck showing an ERROR in the lxc list output: +--+---+--+--++---+ | NAME | STATE | IPV4 | IPV6 |TYPE| SNAPSHOTS | +--+---+--+--++---+ | vpn | ERROR | | | PERSISTENT | | +--+---+--+--++---+ I looked at the profiles in use for this one and indeed in the privileged profile I used for the above, there wasn't any disk defined, so I added the default profile on the working host and moved the container again with a different name (otherwise I get the message that it already exists). That worked fine, but now I am stuck with the vpn container above which I can't remove with a "lxc delete vpn", cause it results in the error : error: No storage pool specified. Anyone who has a clue how to get rid of it, please let me know... Thanks in advance Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] LXD: loglevel defauilts to trace?
October 17, 2016 12:32 PM, sjo...@sjomar.eu wrote: > Hi all, > > I just had a LXD host (LXD version 2.0.4 on Ubuntu server 16.04) ran out of > diskspace and found out > that my LXD logs took almost 8GB. > > When looking at the /var/log/lxd/containernerme/lxd.conf file I see a > lxc.loglevel set to 0, which > means trace according to the manpage, so basically log all you can think of. > Is there an easy config to set to reduce logging? > It doesn't seem to work when I do a "lxc config set containername raw.lxc > 'lxc.loglevel = 8'" (for > only fatal error logging) > > It does show up in the configuration when doing a "lxc config show > containername", but when looking > at the /var/log(lxd/containername/lxd.conf it still shows level 0. > > Since this LXD host is running from a SD-card I would like to set logging to > an absolute minimum. > > NB: according to the manpage > (https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html) > default logging should be > level 5 (error), which is already way better than the default of 0. Nobody? Then I'll stay with truncating the logs on regularly basis I am afraid :'( Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
[lxc-users] LXD: loglevel defauilts to trace?
Hi all, I just had a LXD host (LXD version 2.0.4 on Ubuntu server 16.04) ran out of diskspace and found out that my LXD logs took almost 8GB. When looking at the /var/log/lxd/containernerme/lxd.conf file I see a lxc.loglevel set to 0, which means trace according to the manpage, so basically log all you can think of. Is there an easy config to set to reduce logging? It doesn't seem to work when I do a "lxc config set containername raw.lxc 'lxc.loglevel = 8'" (for only fatal error logging) It does show up in the configuration when doing a "lxc config show containername", but when looking at the /var/log(lxd/containername/lxd.conf it still shows level 0. Since this LXD host is running from a SD-card I would like to set logging to an absolute minimum. NB: according to the manpage (https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html) default logging should be level 5 (error), which is already way better than the default of 0. Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] LXD 2.0.3 and disk resource: not displayed for btrfs storage?
On 08/25/2016 01:00 PM, Fajar A. Nugraha wrote: On Thu, Aug 25, 2016 at 5:01 PM, Sjoerd <sjo...@sjomar.eu> wrote: Hi all, I've two servers with Ubuntu server 16.04 and LXD 2.0.3, both running on the same kernel 4.4.0-31-generic on x86_64. One server has a ZFS storage pool and the other has BTRFS as storage pool. When I do a : lxc info on the ZFS server I do get the results for disk storage usage, but for the BTRFS server I don't? Memory and network statistics are shown normally. From https://www.stgraber.org/2016/03/15/lxd-2-0-installing-and-configuring-lxd-212/ ... btrfs offers the same level of integration with the exception that it doesn’t properly report disk usage inside the container Thanks, I must have mist that. Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
[lxc-users] LXD 2.0.3 and disk resource: not displayed for btrfs storage?
Hi all, I've two servers with Ubuntu server 16.04 and LXD 2.0.3, both running on the same kernel 4.4.0-31-generic on x86_64. One server has a ZFS storage pool and the other has BTRFS as storage pool. When I do a : lxc info on the ZFS server I do get the results for disk storage usage, but for the BTRFS server I don't? Memory and network statistics are shown normally. The server with BTRFS is running in a KVM VPS if that matters. Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Btrfs - Disk quota and Ubuntu 15.10
On 30/06/2016 15:50, Benoit GEORGELIN - Association Web4all wrote: Yesterday I tried the kernel:v4.6.3-yakkety The command "lxc stop container" totaly crash the system . Hard reboot mandatory With v4.5.7-yakkety so far, everything looks fine, including the quota. But after what I read about btrfs, I'll find another FS for production system ready because I need the quota Hmmm that doesn't sound prommising then :'( Anyway for my local server I use ZFS on Linux (Ubuntu 16.04). Maybe that's something for you too? I don't use ZFS on my VPS, cause it doesn't have enough RAM (just 1GB) Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Btrfs - Disk quota and Ubuntu 15.10
On 30/06/2016 12:03, Tomasz Chmielewski wrote: "out of space" when doing snapshot affects kernels older than 4.6, no matter if you use RAID-1, RAID-5/6, or no RAID. It's especially annoying especially when snapshotting running containers with postgres, mysql, mongo etc. - as this causes database errors or crashes. Hmm didn't know that yet, so I'll have upgrade to kernel 4.6.x then (running on 4.4.0-24 now) Thanks for the info! Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Btrfs - Disk quota and Ubuntu 15.10
On 30/06/2016 11:17, Tomasz Chmielewski wrote: Please note that btrfs is not a stable filesystem, at least not in the latest Ubuntu (16.04). You may have "out of space" errors with them, especially when doing snapshots. kernels 4.6.x[1] behave stable for me. I am not using RAID5/6 with btrfs. Only the latter is still not production ready as I understood it. My amount of snapshots won't be a lot (maybe 50 max or so), since I delete them regurly. But I'll keep an eye on the metadata as well indeed.thanks for the hint.. ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] Btrfs - Disk quota and Ubuntu 15.10
On 29/06/2016 20:02, Benoit GEORGELIN - Association Web4all wrote: Hi, (without hijacking another thread) I'm sharing with you some information about BTRFS and Ubuntu 15.10, Kernel 4.2.0-30-generic regarding a quota disk error on my LXC containers If you plan tu use quota, this will be interesting for you to know. Yes I just read it on the btrfs-mailinglist ;) Anway besides the problems you describe, using quota also brings down btrfs send/receive speed to a crawl. I am backing up my containers with btrfs send/receive and because of all the quota problems described I am not using it anymore. Cheers, ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] LXD and /dev/fuse
On 11/05/2016 08:21, Fajar A. Nugraha wrote: On Wed, May 11, 2016 at 1:49 AM, Sjoerd <sjo...@sjomar.eu> wrote: Anyway I'll try to recreate the container instead of migrating it form the working LXC (just copied the rootfs from LXC over the the LXD version). Maybe that works... Just tried it with a fresh privileged xenial image (ubuntu:x), added the fuse device as an unix-char and still doesn't work :( Have to find another way I guess (probably mount the webdav on the host and then bind mount it in the container) Found this on /var/log/syslog on my test: May 11 13:05:27 xenial kernel: [2072055.430045] audit: type=1400 audit(1462946727.099:295): apparmor="DENIED" operation="mount" info="failed type match" error=-13 profile="lxd-dav_" name="/mnt/tmp/" pid=12224 comm="mount.davfs" fstype="fuse" srcname="http://localhost/dav/; flags="rw, nosuid, nodev" ... and sure enough, on /etc/apparmor.d/abstractions/lxc/container-base # allow fuse mounts everywhere mount fstype=fuse.*, the profile allows fuse.* mounts (e.g. sshfs use type "fuse.sshfs"), but it says nothing about type "fuse". As a workaround, adding "mount fstype=fuse" and "service apparmor reload" works for me. Brilliant! That works indeed :) Many thanks! Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] LXD and /dev/fuse
On 10-05-16 21:08, Serge Hallyn wrote: Quoting Sjoerd (sjo...@sjomar.eu): Just tried it with a fresh privileged xenial image (ubuntu:x), added the fuse device as an unix-char and still doesn't work :( Have to find another way I guess (probably mount the webdav on the host and then bind mount it in the container) Can you strace it? From the host or from inside the container? ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] LXD and /dev/fuse
Anyway I'll try to recreate the container instead of migrating it form the working LXC (just copied the rootfs from LXC over the the LXD version). Maybe that works... Just tried it with a fresh privileged xenial image (ubuntu:x), added the fuse device as an unix-char and still doesn't work :( Have to find another way I guess (probably mount the webdav on the host and then bind mount it in the container) Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] LXD and /dev/fuse
On 10/05/2016 16:08, Fajar A. Nugraha wrote: On Tue, May 10, 2016 at 8:57 PM, Sjoerd <sjo...@sjomar.eu> wrote: On 10/05/2016 15:36, Serge Hallyn wrote: Quoting Sjoerd (sjo...@sjomar.eu): Hi all, I just converted a perfct working LXC privileged container with use of /dev/fuse for mounting a webdav share via davfs2. Now with LXD (still privileged container) I am not able to mount the webdav share anymore and get: mount.davfs: can't open fuse device mount.davfs: trying coda kernel file system mount.davfs: no free coda device to mount I also tried to to reconfigure the container with: lxc config device add FUSE disk source=/dev/fuse path=dev/fuse You want to add a unix-char device: lxc config device add fuse unix-char path=/dev/fuse Does that work for you? I tried it, but no luck...same error messages. I tried it on the host to be sure that davfs would work there and it did, so there's still something missing/wrong with the LXD container set-up ... Works for me with xrdp (it uses fuse to map remote drive and file-copy-paste support) Hmm i see now that I can use s3ql just fine wich also uses fuse, so davfs2 is problematic then... Any other ideas are most welcome :) Have you set your container to be privileged (https://github.com/lxc/lxd/blob/master/doc/configuration.md#keyvalue-configuration-1)? fuse only works on privileged container. Yes I did..as noted in the OP ;) Anyway I'll try to recreate the container instead of migrating it form the working LXC (just copied the rootfs from LXC over the the LXD version). Maybe that works... Cheers, Sjoerd ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users