Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

"bash: line 1: cd: {some_dir}: No such file or directory" will prompt in some directories #833

hcmlinj started this conversation in General
Discussion options

I might have got bash: line 1: cd: {some_dir}: No such file or directory in some working directory for nerdctl.lima command.
It executed successfully but got unexpected warning message.
Execute shell in Lima was all expected without warning message.

$ sw_vers 
ProductName:	macOS
ProductVersion:	12.2.1
BuildVersion:	21D62
$ uname -m
arm64
$ limactl list 
NAME STATUS SSH ARCH CPUS MEMORY DISK DIR
default Running 127.0.0.1:60022 aarch64 4 4GiB 100GiB /Users/jamie/.lima/default
# expetced
$ pwd
/Users/jamie
$ nerdctl.lima ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
# with warning
$ pwd
/Users/jamie/Desktop
$ nerdctl.lima ps
bash: line 1: cd: /Users/jamie/Desktop: No such file or directory
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
# expetced
$ pwd
/etc
$ nerdctl.lima ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
# with warning
$ pwd
/etc/ppp
$ nerdctl.lima ps
bash: line 1: cd: /etc/ppp: No such file or directory
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

I might have got bash: line 1: cd: {some_dir}: No such file or directory in some working directory for nerdctl.lima command. It executed successfully but got unexpected warning message. Execute shell in Lima was all expected without warning message.

This happens when the current working directory in the host is not mapped into the guest.

# with warning
$ pwd
/Users/jamie/Desktop
$ nerdctl.lima ps
bash: line 1: cd: /Users/jamie/Desktop: No such file or directory
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

The ~/Desktop directory is protected on macOS. Make sure you have granted your shell (e.g. Terminal or iTerm2) "Full Disk Access".

# expetced
$ pwd
/etc
$ nerdctl.lima ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

This may be "expected" but only works accidentally: The /etc directory is not mounted inside the guest, but it has its own /etc directory. You are running the command in the context of that directory, and not the /etc directory on the host.

# with warning
$ pwd
/etc/ppp
$ nerdctl.lima ps
bash: line 1: cd: /etc/ppp: No such file or directory
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

The /etc/ppp directory only exists on the host but not inside the guest.

You must be logged in to vote
3 replies
Comment options

The ~/Desktop directory is protected on macOS. Make sure you have granted your shell (e.g. Terminal or iTerm2) "Full Disk Access".

On second thoughts, I'm not sure about this: how could this be the current directory if the terminal has not access to it? So there may be a different reason it isn't accessible from inside the guest.

Comment options

Yes, this is my concern.
There is a clue about the bash is for guest, the host shell is zsh.
I've done an experiment about limactl shell default then sudo mkdir /etc/ppp at guest.
I've executed nerdctl.lima ps in the host in /etc/ppp without warning message.

I have some deductions from these observes:

  1. guest did change directory before execute nerdctl.lima.
  2. the warning message only occur when the guest without the directory when host in.
  3. I think it's a warning message due to nerdctl.lima execution always successfully.

Is this an expected behavior?

Comment options

I'd love to fix this. Thanks for your insights @hcmlinj - did you find out what it was?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /