canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.52k stars 631 forks source link

Mounting: Mount source path does not exist (non snap, linux, qemu) #3462

Closed v4nderstruck closed 6 days ago

v4nderstruck commented 3 months ago

Describe the bug Hi, I'm trying to mount a directory and multipass fails with "Mount source path ... does not exist." I have built multipass from source (running on Manjarom, used the AUR package https://aur.archlinux.org/packages/canonical-multipass ) and other functionalities seem to work fine (creating VMs, shell...)

To Reproduce for example, I try mounting my neovim config dir multipass mount /home/v4nderstruck/.config/nvim dev:/home/ubuntu/.config/nvim

Expected behavior Mounting should work

Logs Nothing really usefull in daemon logs. I set it to trace and there is no report (except certificate validation) when mounting...

Mouting with Command with -vvvv

[2024-04-05T11:47:48.375] [debug] [mount cmd] /home/v4nderstruck/.cache/yay/canonical-multipass/src/multipass/src/client/cli/cmd/mount.cpp:234 parse_args(): adding default uid mapping
[2024-04-05T11:47:48.375] [debug] [mount cmd] /home/v4nderstruck/.cache/yay/canonical-multipass/src/multipass/src/client/cli/cmd/mount.cpp:274 parse_args(): adding default gid mapping
mount failed: Mount source path "/home/v4nderstruck/.config/nvim" does not exist.

And I have part of the strace where things may be interesting. Should not be a permission issue and the directory seems to exist.

....
access("/home/v4nderstruck/.config/nvim", F_OK) = 0                                                                                                                                          
statx(AT_FDCWD, "/home/v4nderstruck/.config/nvim", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFDIR|0777, stx_size=4096
, ...}) = 0                                                                                                                                                                                  
access("/home/v4nderstruck/.config/nvim", R_OK) = 0     

Additional info

Additional context Add any other context about the problem here.

ricab commented 3 months ago

Hi @v4nderstruck, that is not really a supported way of running Multipass, but if everything else seems to work, perhaps AppArmor is denying visibility of that directory to the Multipass daemon? Do you see anything in dmesg | grep apparmor=\"DENIED\"? Does if work if there when the source path does not involve directories/files starting with dot?

ricab commented 3 months ago

BTW, others seemed to have had issues with the QEMU version from the AUR package: https://github.com/canonical/multipass/issues/3441#issuecomment-2007054913 . But I doubt that is related to your issue.

v4nderstruck commented 3 months ago

Hi, I have no apparmor running and regardless of whether the path has a "." or not, it does not work.

apparmor module is loaded.                                                                
apparmor filesystem is not mounted.

any other ideas?

ricab commented 3 months ago

Hi @v4nderstruck, what compiler/version did you use to build? I ask because our CMake may be allowing compilers without full standard C++17 support yet (requiring only -std=C++1z). If that is your case, it is possible that you didn't have full compliant std::filesystem library support yet. We have had cases of compilers with incomplete C++17 support causing runtime issues in the past.

townsend2010 commented 2 months ago

Hi @v4nderstruck!

Could you please provide the answers to the question @ricab asked? If we don't hear back from you soon, we will close this issue. Thanks!

ricab commented 6 days ago

Closing for lack of activity.