Imported lxc container ip doesnt come up in incus

Hi,
I have just tried incus and it looks fine but I wonder one thing why imported lxd container ip address doesnt come up for the first time. I have compared with the original container and found out that the parameter dhcp-identifier: mac is missing. Why do we need this?
Another observation is that when i have executed the incus shell <imported_container>, system replied with this warning -bash: /usr/local/Homebrew/bin/brew: No such file or directory.
Regards.

We’ve had dhcp-identifier: mac for quite a while in our images, basically it’s needed so systemd-networkd uses the MAC address for the DHCP lease rather than a derivative of the machine-id.

It normally should not result in a failed DHCP lease though but not using the correct identifier means that LXD/Incus has no idea what container requested the address and things like static DHCP leases (ipv4.address on the nic) can’t work properly.

For the /bin/brew thing, that’s an odd one, could you show the output of env on your system, there’s probably something interesting in there.

Sorry for the delay, thanks for the dhcp answer and here is my env environment. I open a ssh session from mac to the linux host by the way. Regards.

SHELL=/bin/bash
EDITOR=/usr/bin/vi
PWD=/home/localadmin
LOGNAME=localadmin
XDG_SESSION_TYPE=tty
MOTD_SHOWN=pam
HOME=/home/localadmin
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
LC_TERMINAL=iTerm2
SSH_CONNECTION=XXXXXX
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
TERM=xterm-256color
LESSOPEN=| /usr/bin/lesspipe %s
USER=localadmin
LC_TERMINAL_VERSION=3.4.20
SHLVL=1
XDG_SESSION_ID=2043
XDG_RUNTIME_DIR=/run/user/1000
SSH_CLIENT=192.XXX.X.XX 54663 22
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
SSH_TTY=/dev/pts/0
_=/usr/bin/env

Sorry, nothing obvious jumps at me here, it’s pretty odd.

Do you get the same when you do incus exec NAME -- bash?

Here is the output of two states.
Regards.

localadmin@d0051:~$ incus shell web
-bash: /usr/local/Homebrew/bin/brew: No such file or directory
root@web:~# exit
logout
localadmin@d0051:~$ incus exec web -- bash
root@web:~#

Hmm, that’s interesting. Can you install strace if you don’t already have it and then run:
strace -f -o out incus shell web, then once you get the shell, just ctrl+d and upload the out file somewhere.

Sorry for the late response, here is the out.txt file.
https://tmpfiles.org/dl/2727742/out.txt

Getting a 404 from that link :frowning:

Sorry, that link has some limitations, here is another link.
https://file.io/KGFBnfI7zMH6
Regards.

Thanks, sadly that doesn’t help much other than show the same error.

Does incus exec web -- su -l get you the same result?

Yes, same result.

localadmin@d0051:~$ incus exec web -- su -l
-bash: /usr/local/Homebrew/bin/brew: No such file or directory

Okay, I’m starting to wonder if we’re looking at something that has nothing to do with your client being a Mac but instead with that particular container (web) having or having had the Linux version of Homebrew installed?

Could you do grep -ri homebrew /etc in that container?

localadmin@d0051:~$ incus shell web
-bash: /usr/local/Homebrew/bin/brew: No such file or directory
root@web:~#
root@web:~#
root@web:~# grep -ri homebrew /etc
root@web:~#

And just to confirm, once you’re in the instance like above, running su -l also causes the error to show up?

Yes, here is the output.

root@web:~# su -l
-bash: /usr/local/Homebrew/bin/brew: No such file or directory

But it is just a reminder I migrated that web container from lxd.

Can you show env from inside of that web container?

root@web:~# env
SHELL=/bin/bash
PWD=/root
LOGNAME=root
HOME=/root
LANG=en_US.UTF-8
TERM=xterm-256color
USER=root
SHLVL=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
MAIL=/var/mail/root
_=/usr/bin/env

okay, so still nothing odd here, that pretty much just leaves the user’s own profile.

grep -ri homebrew /root/

root@web:~# grep -ri homebrew /root/
/root/.bash_profile:eval "$(/usr/local/Homebrew/bin/brew shellenv)"

Bingo! :slight_smile: